github.com/decomp/exp@v0.0.0-20210624183419-6d058f5e1da6/lift/x86/testdata/x86_32/arithmetic/arithmetic.ll (about)

     1  define void @div_r8() !addr !{!"0x10000000"} {
     2  ; <label>:0
     3  	%al = alloca i8
     4  	%bl = alloca i8
     5  	%ah = alloca i8
     6  	%ax = alloca i16
     7  	%eax = alloca i32
     8  	br label %block_10000000
     9  
    10  block_10000000:
    11  	store i32 84, i16* %ax
    12  	store i32 2, i8* %bl
    13  	%1 = load i8, i8* %bl
    14  	%2 = load i16, i16* %ax
    15  	%3 = zext i8 %1 to i16
    16  	%4 = udiv i16 %2, %3
    17  	%5 = urem i16 %2, %3
    18  	store i16 %4, i8* %al
    19  	store i16 %5, i8* %ah
    20  	%6 = load i32, i32* %eax
    21  	%7 = and i32 %6, 255
    22  	store i32 %7, i32* %eax
    23  	ret void
    24  }
    25  
    26  define void @div_m8() !addr !{!"0x1000000E"} {
    27  ; <label>:0
    28  	%al = alloca i8
    29  	%ah = alloca i8
    30  	%ax = alloca i16
    31  	%eax = alloca i32
    32  	br label %block_1000000E
    33  
    34  block_1000000E:
    35  	store i32 84, i16* %ax
    36  	store i32 2, i8* @m8
    37  	%1 = load i8, i8* @m8
    38  	%2 = load i16, i16* %ax
    39  	%3 = zext i8 %1 to i16
    40  	%4 = udiv i16 %2, %3
    41  	%5 = urem i16 %2, %3
    42  	store i16 %4, i8* %al
    43  	store i16 %5, i8* %ah
    44  	%6 = load i32, i32* %eax
    45  	%7 = and i32 %6, 255
    46  	store i32 %7, i32* %eax
    47  	ret void
    48  }
    49  
    50  define void @div_r16() !addr !{!"0x10000025"} {
    51  ; <label>:0
    52  	%ax = alloca i16
    53  	%dx = alloca i16
    54  	%bx = alloca i16
    55  	%eax = alloca i32
    56  	%"dx:ax" = alloca i32
    57  	br label %block_10000025
    58  
    59  block_10000025:
    60  	store i32 0, i16* %dx
    61  	store i32 84, i16* %ax
    62  	store i32 2, i16* %bx
    63  	%1 = load i16, i16* %bx
    64  	%2 = load i32, i32* %"dx:ax"
    65  	%3 = zext i16 %1 to i32
    66  	%4 = udiv i32 %2, %3
    67  	%5 = urem i32 %2, %3
    68  	store i32 %4, i16* %ax
    69  	store i32 %5, i16* %dx
    70  	%6 = load i32, i32* %eax
    71  	%7 = and i32 %6, 65535
    72  	store i32 %7, i32* %eax
    73  	ret void
    74  }
    75  
    76  define void @div_m16() !addr !{!"0x1000003A"} {
    77  ; <label>:0
    78  	%ax = alloca i16
    79  	%dx = alloca i16
    80  	%eax = alloca i32
    81  	%"dx:ax" = alloca i32
    82  	br label %block_1000003A
    83  
    84  block_1000003A:
    85  	store i32 0, i16* %dx
    86  	store i32 84, i16* %ax
    87  	store i32 2, i16* @m16
    88  	%1 = load i16, i16* @m16
    89  	%2 = load i32, i32* %"dx:ax"
    90  	%3 = zext i16 %1 to i32
    91  	%4 = udiv i32 %2, %3
    92  	%5 = urem i32 %2, %3
    93  	store i32 %4, i16* %ax
    94  	store i32 %5, i16* %dx
    95  	%6 = load i32, i32* %eax
    96  	%7 = and i32 %6, 65535
    97  	store i32 %7, i32* %eax
    98  	ret void
    99  }
   100  
   101  define void @div_r32() !addr !{!"0x10000058"} {
   102  ; <label>:0
   103  	%eax = alloca i32
   104  	%edx = alloca i32
   105  	%ebx = alloca i32
   106  	%"edx:eax" = alloca i64
   107  	br label %block_10000058
   108  
   109  block_10000058:
   110  	store i32 0, i32* %edx
   111  	store i32 84, i32* %eax
   112  	store i32 2, i32* %ebx
   113  	%1 = load i32, i32* %ebx
   114  	%2 = load i64, i64* %"edx:eax"
   115  	%3 = zext i32 %1 to i64
   116  	%4 = udiv i64 %2, %3
   117  	%5 = urem i64 %2, %3
   118  	store i64 %4, i32* %eax
   119  	store i64 %5, i32* %edx
   120  	ret void
   121  }
   122  
   123  define void @div_m32() !addr !{!"0x1000006A"} {
   124  ; <label>:0
   125  	%eax = alloca i32
   126  	%edx = alloca i32
   127  	%"edx:eax" = alloca i64
   128  	br label %block_1000006A
   129  
   130  block_1000006A:
   131  	store i32 0, i32* %edx
   132  	store i32 84, i32* %eax
   133  	store i32 2, i32* @m32
   134  	%1 = load i32, i32* @m32
   135  	%2 = load i64, i64* %"edx:eax"
   136  	%3 = zext i32 %1 to i64
   137  	%4 = udiv i64 %2, %3
   138  	%5 = urem i64 %2, %3
   139  	store i64 %4, i32* %eax
   140  	store i64 %5, i32* %edx
   141  	ret void
   142  }