github.com/decomp/exp@v0.0.0-20210624183419-6d058f5e1da6/lift/x86/testdata/x86_64/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  	%rax = alloca i64
     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 i64, i64* %rax
    21  	%7 = and i64 %6, 255
    22  	store i64 %7, i64* %rax
    23  	ret void
    24  }
    25  
    26  define void @div_m8() !addr !{!"0x1000000F"} {
    27  ; <label>:0
    28  	%al = alloca i8
    29  	%ah = alloca i8
    30  	%ax = alloca i16
    31  	%rax = alloca i64
    32  	br label %block_1000000F
    33  
    34  block_1000000F:
    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 i64, i64* %rax
    45  	%7 = and i64 %6, 255
    46  	store i64 %7, i64* %rax
    47  	ret void
    48  }
    49  
    50  define void @div_r16() !addr !{!"0x10000027"} {
    51  ; <label>:0
    52  	%ax = alloca i16
    53  	%dx = alloca i16
    54  	%bx = alloca i16
    55  	%rax = alloca i64
    56  	%"dx:ax" = alloca i32
    57  	br label %block_10000027
    58  
    59  block_10000027:
    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 i64, i64* %rax
    71  	%7 = and i64 %6, 65535
    72  	store i64 %7, i64* %rax
    73  	ret void
    74  }
    75  
    76  define void @div_m16() !addr !{!"0x1000003D"} {
    77  ; <label>:0
    78  	%ax = alloca i16
    79  	%dx = alloca i16
    80  	%rax = alloca i64
    81  	%"dx:ax" = alloca i32
    82  	br label %block_1000003D
    83  
    84  block_1000003D:
    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 i64, i64* %rax
    96  	%7 = and i64 %6, 65535
    97  	store i64 %7, i64* %rax
    98  	ret void
    99  }
   100  
   101  define void @div_r32() !addr !{!"0x1000005C"} {
   102  ; <label>:0
   103  	%eax = alloca i32
   104  	%edx = alloca i32
   105  	%ebx = alloca i32
   106  	%rax = alloca i64
   107  	%rbx = alloca i64
   108  	%"edx:eax" = alloca i64
   109  	br label %block_1000005C
   110  
   111  block_1000005C:
   112  	store i32 0, i32* %edx
   113  	store i32 84, i32* %eax
   114  	store i32 2, i32* %ebx
   115  	%1 = load i32, i32* %ebx
   116  	%2 = load i64, i64* %"edx:eax"
   117  	%3 = zext i32 %1 to i64
   118  	%4 = udiv i64 %2, %3
   119  	%5 = urem i64 %2, %3
   120  	store i64 %4, i32* %eax
   121  	store i64 %5, i32* %edx
   122  	store i32 -1, i32* %ebx
   123  	%6 = load i64, i64* %rax
   124  	%7 = load i64, i64* %rbx
   125  	%8 = and i64 %6, %7
   126  	store i64 %8, i64* %rax
   127  	ret void
   128  }
   129  
   130  define void @div_m32() !addr !{!"0x10000076"} {
   131  ; <label>:0
   132  	%eax = alloca i32
   133  	%edx = alloca i32
   134  	%ebx = alloca i32
   135  	%rax = alloca i64
   136  	%rbx = alloca i64
   137  	%"edx:eax" = alloca i64
   138  	br label %block_10000076
   139  
   140  block_10000076:
   141  	store i32 0, i32* %edx
   142  	store i32 84, i32* %eax
   143  	store i32 2, i32* @m32
   144  	%1 = load i32, i32* @m32
   145  	%2 = load i64, i64* %"edx:eax"
   146  	%3 = zext i32 %1 to i64
   147  	%4 = udiv i64 %2, %3
   148  	%5 = urem i64 %2, %3
   149  	store i64 %4, i32* %eax
   150  	store i64 %5, i32* %edx
   151  	store i32 -1, i32* %ebx
   152  	%6 = load i64, i64* %rax
   153  	%7 = load i64, i64* %rbx
   154  	%8 = and i64 %6, %7
   155  	store i64 %8, i64* %rax
   156  	ret void
   157  }
   158  
   159  define void @div_r64() !addr !{!"0x10000099"} {
   160  ; <label>:0
   161  	%eax = alloca i32
   162  	%edx = alloca i32
   163  	%ebx = alloca i32
   164  	%rax = alloca i64
   165  	%rdx = alloca i64
   166  	%rbx = alloca i64
   167  	%"rdx:rax" = alloca i128
   168  	br label %block_10000099
   169  
   170  block_10000099:
   171  	store i32 0, i32* %edx
   172  	store i32 84, i32* %eax
   173  	store i32 2, i32* %ebx
   174  	%1 = load i64, i64* %rbx
   175  	%2 = load i128, i128* %"rdx:rax"
   176  	%3 = zext i64 %1 to i128
   177  	%4 = udiv i128 %2, %3
   178  	%5 = urem i128 %2, %3
   179  	store i128 %4, i64* %rax
   180  	store i128 %5, i64* %rdx
   181  	ret void
   182  }
   183  
   184  define void @div_m64() !addr !{!"0x100000AC"} {
   185  ; <label>:0
   186  	%eax = alloca i32
   187  	%edx = alloca i32
   188  	%rax = alloca i64
   189  	%rdx = alloca i64
   190  	%"rdx:rax" = alloca i128
   191  	br label %block_100000AC
   192  
   193  block_100000AC:
   194  	store i32 0, i32* %edx
   195  	store i32 84, i32* %eax
   196  	store i32 2, i64* @m64
   197  	%1 = load i64, i64* @m64
   198  	%2 = load i128, i128* %"rdx:rax"
   199  	%3 = zext i64 %1 to i128
   200  	%4 = udiv i128 %2, %3
   201  	%5 = urem i128 %2, %3
   202  	store i128 %4, i64* %rax
   203  	store i128 %5, i64* %rdx
   204  	ret void
   205  }