xunge/DecIR huggingface dataset:
int verif_operateur_et_parentheses(char character) {
  if (character == 43 || character == 45 || character == 47 ||
      character == 42 || character == 40 || character == 41) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<verif_operateur_et_parentheses>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     1158 <verif_operateur_et_parentheses+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     1158 <verif_operateur_et_parentheses+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     1158 <verif_operateur_et_parentheses+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     1158 <verif_operateur_et_parentheses+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
je     1158 <verif_operateur_et_parentheses+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
jne    1164 <verif_operateur_et_parentheses+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <verif_operateur_et_parentheses+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verif_operateur_et_parentheses>:
add    $0xd8,%dil
xor    %eax,%eax
cmp    $0x7,%dil
ja     111a <verif_operateur_et_parentheses+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @verif_operateur_et_parentheses(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 43
br i1 %6, label %27, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 45
br i1 %10, label %27, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 47
br i1 %14, label %27, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 42
br i1 %18, label %27, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 40
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 41
br i1 %26, label %27, label %28
27: ; preds = %23, %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %29
28: ; preds = %23
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
@switch.table.verif_operateur_et_parentheses = [8 x i32] [i32 1, i32 1, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1]
define i32 @verif_operateur_et_parentheses(i8 signext %0) {
%2 = add i8 %0, -40
%3 = icmp ult i8 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.verif_operateur_et_parentheses, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int foo() {
  static int f = 0;
  f += 2;
  return f;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x2,%eax
mov    %eax,0x2f11(%rip)
mov    0x2f0b(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2f1e(%rip),%eax
add    $0x2,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@foo.f = internal global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.f
%2 = add nsw i32 %1, 2
store i32 %2, i32* @foo.f
%3 = load i32, i32* @foo.f
ret i32 %3
}

LLVM IR (-O2):
@foo.f = internal unnamed_addr global i32 0
define i32 @foo() {
%1 = load i32, i32* @foo.f
%2 = add nsw i32 %1, 2
store i32 %2, i32* @foo.f
ret i32 %2
}
void i2d_ASN1_SET(void) {}


x86 assembly (clang, -O0):
<i2d_ASN1_SET>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_ASN1_SET>:
ret

LLVM IR (-O0):
define void @i2d_ASN1_SET() {
ret void
}

LLVM IR (-O2):
define void @i2d_ASN1_SET() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ffree(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<ffree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ffree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @ffree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void avio_read_dir() {}


x86 assembly (clang, -O0):
<avio_read_dir>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<avio_read_dir>:
ret

LLVM IR (-O0):
define void @avio_read_dir() {
ret void
}

LLVM IR (-O2):
define void @avio_read_dir() {
ret void
}
/* Variables and functions */
scalar_t__ floatToRawIntBits(float);
float const intBitsToFloat(scalar_t__);
__attribute__((always_)) const float toward0f(float d) {
  return d == 0 ? 0 : intBitsToFloat(floatToRawIntBits(d) - 1);
}


x86 assembly (clang, -O0):
<toward0f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1151 <toward0f+0x31>
jp     1151 <toward0f+0x31>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    116c <toward0f+0x4c>
movss  -0x4(%rbp),%xmm0
call   1040 <floatToRawIntBits@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
call   1030 <intBitsToFloat@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toward0f>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112e <toward0f+0xe>
jp     112e <toward0f+0xe>
xorps  %xmm0,%xmm0
ret
push   %rax
call   1040 <floatToRawIntBits@plt>
lea    -0x1(%rax),%rdi
pop    %rax
jmp    1030 <intBitsToFloat@plt>

LLVM IR (-O0):
define float @toward0f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = call i64 @floatToRawIntBits(float %7)
%9 = sub nsw i64 %8, 1
%10 = call float @intBitsToFloat(i64 %9)
br label %11
11: ; preds = %6, %5
%12 = phi float [ 0.000000e+00, %5 ], [ %10, %6 ]
ret float %12
}

LLVM IR (-O2):
define float @toward0f(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @floatToRawIntBits(float %0)
%5 = add nsw i64 %4, -1
%6 = tail call float @intBitsToFloat(i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi float [ %6, %3 ], [ 0.000000e+00, %1 ]
ret float %8
}
int test_imm_EDint64_midword_reg(long long val) {
  return ((val >> 16) & (0xED << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EDint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xed,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EDint64_midword_reg>:
test   $0xed0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EDint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 237
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_EDint64_midword_reg(i64 %0) {
%2 = and i64 %0, 15532032
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long gfx_ind(unsigned short port) { return (0); }


x86 assembly (clang, -O0):
<gfx_ind>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_ind>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @gfx_ind(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
ret i64 0
}

LLVM IR (-O2):
define i64 @gfx_ind(i16 zeroext %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ ndelay(unsigned long);
void udelay(unsigned long msec) { ndelay(msec * 1000); }


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x3e8,-0x8(%rbp),%rdi
call   1030 <ndelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
imul   $0x3e8,%rdi,%rdi
jmp    1030 <ndelay@plt>

LLVM IR (-O0):
define void @udelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000
%5 = call i32 @ndelay(i64 %4)
ret void
}

LLVM IR (-O2):
define void @udelay(i64 %0) {
%2 = mul i64 %0, 1000
%3 = tail call i32 @ndelay(i64 %2)
ret void
}
/* Variables and functions */
void *bug1021_test_3(int x) { return (void *)(size_t)((long)x); }


x86 assembly (clang, -O0):
<bug1021_test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug1021_test_3>:
movslq %edi,%rax
ret

LLVM IR (-O0):
define i8* @bug1021_test_3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @bug1021_test_3(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
void test(int i) {}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
ret

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
unsigned int movulsrw(unsigned int x) { return (x & 65535) >> 4; }


x86 assembly (clang, -O0):
<movulsrw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shr    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movulsrw>:
mov    %edi,%eax
shr    $0x4,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @movulsrw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = lshr i32 %4, 4
ret i32 %5
}

LLVM IR (-O2):
define i32 @movulsrw(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 4095
ret i32 %3
}
long long zig_subw_longlong(long long lhs, long long rhs, long long min,
                            long long max) {
  return (long long)(((unsigned long long)lhs) - ((unsigned long long)rhs));
}


x86 assembly (clang, -O0):
<zig_subw_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_subw_longlong>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @zig_subw_longlong(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = sub i64 %9, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @zig_subw_longlong(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub i64 %0, %1
ret i64 %5
}
char fn1(char p1, int p2) { return 7 >> p2 ? p1 : p2; }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x7,%eax
sar    %cl,%eax
cmp    $0x0,%eax
je     112c <fn1+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <fn1+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
mov    %edi,%eax
cmp    $0x3,%esi
cmovae %esi,%eax
ret

LLVM IR (-O0):
define signext i8 @fn1(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 7, %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
br label %13
11: ; preds = %2
%12 = load i32, i32* %4
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @fn1(i8 signext %0, i32 %1) {
%3 = icmp ugt i32 %1, 2
%4 = zext i8 %0 to i32
%5 = select i1 %3, i32 %1, i32 %4
%6 = trunc i32 %5 to i8
ret i8 %6
}
void gtk_container_set_focus_vadjustment() {}


x86 assembly (clang, -O0):
<gtk_container_set_focus_vadjustment>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtk_container_set_focus_vadjustment>:
ret

LLVM IR (-O0):
define void @gtk_container_set_focus_vadjustment() {
ret void
}

LLVM IR (-O2):
define void @gtk_container_set_focus_vadjustment() {
ret void
}
void _Block_retain_object_default(const void *ptr) {
  if (!ptr)
    return;
}


x86 assembly (clang, -O0):
<_Block_retain_object_default>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <_Block_retain_object_default+0x18>
jmp    1118 <_Block_retain_object_default+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Block_retain_object_default>:
ret

LLVM IR (-O0):
define void @_Block_retain_object_default(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_Block_retain_object_default(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DesMem(void *, int, int /*<<< orphan*/);
void DesReadBlock(void *buf, int size) { DesMem(buf, size & 0xFFFFFFF0, 0); }


x86 assembly (clang, -O0):
<DesReadBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xfffffff0,%esi
xor    %edx,%edx
call   1030 <DesMem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DesReadBlock>:
and    $0xfffffff0,%esi
xor    %edx,%edx
jmp    1030 <DesMem@plt>

LLVM IR (-O0):
define void @DesReadBlock(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, -16
%8 = call i32 @DesMem(i8* %5, i32 %7, i32 0)
ret void
}

LLVM IR (-O2):
define void @DesReadBlock(i8* %0, i32 %1) {
%3 = and i32 %1, -16
%4 = tail call i32 @DesMem(i8* %0, i32 %3, i32 0)
ret void
}
int test_imm_97uint8_reg(unsigned char val) {
  return ((val) & (0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x97,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_97uint8_reg>:
test   $0x97,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_97uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 151
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_97uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -105
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main(void) { (void (*)(int))1; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void *_hkl_malloc(int size, const char *error) {
  void *tmp;
  tmp = calloc(1, size);
  if (!tmp) {
    fprintf(stderr, "%s", error);
    exit(128);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<_hkl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117e <_hkl_malloc+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x80,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hkl_malloc>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1147 <_hkl_malloc+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0x80,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define i8* @_hkl_malloc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i8* @calloc(i32 1, i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %4
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 128)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define noalias i8* @_hkl_malloc(i32 %0, i8* %1) {
%3 = tail call i8* @calloc(i32 1, i32 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 128)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void zombie_yin(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 100)) {
    add_status(target, 3);
  }
}


x86 assembly (clang, -O0):
<zombie_yin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x64,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <zombie_yin+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zombie_yin>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x64,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <zombie_yin+0x41>
mov    %r14,%rdi
mov    $0x3,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @zombie_yin(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 100)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 3)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @zombie_yin(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 100)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 3)
br label %8
8: ; preds = %6, %2
ret void
}
void rop3_197_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_197_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_197_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
or     %esi,%edx
or     %cl,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_197_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %5
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = xor i32 %30, -1
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_197_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Type definitions */
struct msqid_ds {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, int, struct msqid_ds *);
int msgctl(int q, int cmd, struct msqid_ds *buf) {
  return syscall(71, q, cmd | 0x100, buf);
}


x86 assembly (clang, -O0):
<msgctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
or     $0x100,%edx
mov    -0x10(%rbp),%rcx
mov    $0x47,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgctl>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
or     $0x100,%edx
mov    $0x47,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.msqid_ds = type { i32 }
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.msqid_ds*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.msqid_ds* %2, %struct.msqid_ds** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = or i32 %8, 256
%10 = load %struct.msqid_ds*, %struct.msqid_ds** %6
%11 = call i32 @syscall(i32 71, i32 %7, i32 %9, %struct.msqid_ds* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.msqid_ds = type { i32 }
define i32 @msgctl(i32 %0, i32 %1, %struct.msqid_ds* %2) {
%4 = or i32 %1, 256
%5 = tail call i32 @syscall(i32 71, i32 %0, i32 %4, %struct.msqid_ds* %2)
ret i32 %5
}
/* Variables and functions */
int is_category_Zl(unsigned int);
bool is_property_line_separator(unsigned int ch) { return is_category_Zl(ch); }


x86 assembly (clang, -O0):
<is_property_line_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_category_Zl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_property_line_separator>:
jmp    1030 <is_category_Zl@plt>

LLVM IR (-O0):
define i32 @is_property_line_separator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_category_Zl(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_property_line_separator(i32 %0) {
%2 = tail call i32 @is_category_Zl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ consumer();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  consumer();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <consumer@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <consumer@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @consumer()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @consumer()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_02int64_lowword_reg(long long val) {
  return ((val) & (0x02 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_02int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_02int64_lowword_reg>:
test   $0x2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_02int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_02int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 2
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
scalar_t__ strncmp(char *, char *, int /*<<< orphan*/);
int leads(char *in, char *lead) {
  return (strncmp(in, lead, strlen(lead)) == 0);
}


x86 assembly (clang, -O0):
<leads>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leads>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @leads(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @leads(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void encodeDmaKill(void) {}


x86 assembly (clang, -O0):
<encodeDmaKill>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encodeDmaKill>:
ret

LLVM IR (-O0):
define void @encodeDmaKill() {
ret void
}

LLVM IR (-O2):
define void @encodeDmaKill() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void riri(void) {
  printf("RIRI !\n");
  getchar();
}


x86 assembly (clang, -O0):
<riri>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<riri>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"RIRI !\0A\00"
define void @riri() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"RIRI !\00"
define void @riri() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
/* Variables and functions */
int strlen(char *);
void strremove(char *s) {
  int i = strlen(s);
  s[i - 1] = '\0';
}


x86 assembly (clang, -O0):
<strremove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strremove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @strremove(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
store i8 0, i8* %10
ret void
}

LLVM IR (-O2):
define void @strremove(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
char tolower(char);
void strtolower(char *s) {
  for (; *s != '\0'; s++)
    *s = tolower(*s);
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <strtolower+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strtolower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strtolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strtolower+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @strtolower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %13, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call signext i8 @tolower(i8 signext %10)
%12 = load i8*, i8** %2
store i8 %11, i8* %12
br label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int _larger_than(void *data, void *arg) {
  intptr_t num = (intptr_t)data;
  intptr_t cmp = (intptr_t)arg;
  return (num > cmp) ? 1 : 0;
}


x86 assembly (clang, -O0):
<_larger_than>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_larger_than>:
xor    %eax,%eax
cmp    %rsi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i32 @_larger_than(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = icmp sgt i64 %11, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @_larger_than(i8* readnone %0, i8* readnone %1) {
%3 = icmp sgt i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int bpf_map_delete_batch(int map_fd, const void *keys, size_t cnt) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<bpf_map_delete_batch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_map_delete_batch>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @bpf_map_delete_batch(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @bpf_map_delete_batch(i32 %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
A2_EvalXPathArgsContext() { return 0; }


x86 assembly (clang, -O0):
<A2_EvalXPathArgsContext>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<A2_EvalXPathArgsContext>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @A2_EvalXPathArgsContext() {
ret i32 0
}

LLVM IR (-O2):
define i32 @A2_EvalXPathArgsContext() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ diskInit();
void cmdDiskFwrite(char *path) {
  if (!diskInit()) {
    return;
  }
}


x86 assembly (clang, -O0):
<cmdDiskFwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <diskInit@plt>
cmp    $0x0,%eax
jne    1131 <cmdDiskFwrite+0x21>
jmp    1131 <cmdDiskFwrite+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdDiskFwrite>:
xor    %eax,%eax
jmp    1030 <diskInit@plt>

LLVM IR (-O0):
define void @cmdDiskFwrite(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @diskInit()
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @cmdDiskFwrite(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @diskInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
testDec() {
  int a, b;
  a = 3;
  b = a--;
  printf("3-- = %d %d\n", b, a);
}


x86 assembly (clang, -O0):
<testDec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDec>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"3-- = %d %d\0A\00"
define i32 @testDec() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
store i32 %4, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"3-- = %d %d\0A\00"
define i32 @testDec() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3, i32 2)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *, int);
void dot_count(FILE *out, const void *key, void *value) {
  fprintf(out, "%s: %d", (const char *)key, *(int *)value);
}


x86 assembly (clang, -O0):
<dot_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot_count>:
mov    %rsi,%rax
mov    (%rdx),%ecx
lea    0xee4(%rip),%rsi
mov    %rax,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %d\00"
define void @dot_count(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %d\00"
define void @dot_count(i32* nocapture %0, i8* %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_autoload_info_list() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_autoload_info_list"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_get_autoload_info_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pa_context_get_autoload_info_list>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [51 x i8] c"NOT IMPLEMENTED:pa_context_get_autoload_info_list\0A\00"
define i32 @pa_context_get_autoload_info_list() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [50 x i8] c"NOT IMPLEMENTED:pa_context_get_autoload_info_list\00"
define i32 @pa_context_get_autoload_info_list() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
long long int modular_pow(long long int base, long long int exponent) {
  long long int result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1)
      result = (result * base) % 1000000007;
    exponent = exponent >> 1;
    base = (base * base) % 1000000007;
  }
  return result;
}


x86 assembly (clang, -O0):
<modular_pow>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1176 <modular_pow+0x76>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x1,%rdx
jne    114e <modular_pow+0x4e>
mov    -0x18(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x8(%rbp),%rax
mov    $0x3b9aca07,%ecx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
jmp    1114 <modular_pow+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modular_pow>:
mov    $0x1,%r9d
test   %rsi,%rsi
jle    1174 <modular_pow+0x74>
movabs $0x89705f3112a28fe5,%r8
5f 70 89
jmp    1147 <modular_pow+0x47>
nopw   0x0(%rax,%rax,1)
mov    %rsi,%rcx
shr    %rcx
imul   %rdi,%rdi
mov    %rdi,%rax
mul    %r8
shr    $0x1d,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%rdi
cmp    $0x1,%rsi
mov    %rcx,%rsi
jbe    1174 <modular_pow+0x74>
test   $0x1,%sil
je     1120 <modular_pow+0x20>
imul   %rdi,%r9
mov    %r9,%rax
imul   %r8
add    %r9,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1d,%rdx
add    %rax,%rdx
imul   $0x3b9aca07,%rdx,%rax
sub    %rax,%r9
jmp    1120 <modular_pow+0x20>
mov    %r9,%rax
ret

LLVM IR (-O0):
define i64 @modular_pow(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 1, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %4
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = load i64, i64* %4
%11 = srem i64 %10, 2
%12 = icmp eq i64 %11, 1
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i64, i64* %5
%15 = load i64, i64* %3
%16 = mul nsw i64 %14, %15
%17 = srem i64 %16, 1000000007
store i64 %17, i64* %5
br label %18
18: ; preds = %13, %9
%19 = load i64, i64* %4
%20 = ashr i64 %19, 1
store i64 %20, i64* %4
%21 = load i64, i64* %3
%22 = load i64, i64* %3
%23 = mul nsw i64 %21, %22
%24 = srem i64 %23, 1000000007
store i64 %24, i64* %3
br label %6
25: ; preds = %6
%26 = load i64, i64* %5
ret i64 %26
}

LLVM IR (-O2):
define i64 @modular_pow(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %19
4: ; preds = %2, %13
%5 = phi i64 [ %14, %13 ], [ 1, %2 ]
%6 = phi i64 [ %15, %13 ], [ %1, %2 ]
%7 = phi i64 [ %17, %13 ], [ %0, %2 ]
%8 = and i64 %6, 1
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %4
%11 = mul nsw i64 %5, %7
%12 = srem i64 %11, 1000000007
br label %13
13: ; preds = %10, %4
%14 = phi i64 [ %12, %10 ], [ %5, %4 ]
%15 = lshr i64 %6, 1
%16 = mul nsw i64 %7, %7
%17 = urem i64 %16, 1000000007
%18 = icmp ult i64 %6, 2
br i1 %18, label %19, label %4
19: ; preds = %13, %2
%20 = phi i64 [ 1, %2 ], [ %14, %13 ]
ret i64 %20
}
/* Variables and functions */
void a_or_64(void volatile *, long);
void a_or_l(volatile void *p, long v) { return a_or_64(p, v); }


x86 assembly (clang, -O0):
<a_or_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <a_or_64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or_l>:
jmp    1030 <a_or_64@plt>

LLVM IR (-O0):
define void @a_or_l(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @a_or_l(i8* %0, i64 %1) {
tail call void @a_or_64(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ power(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int x, y;
  printf("enter the x:");
  scanf("%d", &x);
  printf("enter the y:");
  scanf("%d", &y);
  power(x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <power@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xec5(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1030 <power@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"enter the x:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"enter the y:\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @power(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"enter the x:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"enter the y:\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = call i32 @power(i32 %9, i32 %10)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int xstrcmp(const char *a, const char *b) {
  if (a == NULL || b == NULL)
    return a == b;
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<xstrcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <xstrcmp+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    114e <xstrcmp+0x3e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115e <xstrcmp+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrcmp>:
test   %rdi,%rdi
je     111f <xstrcmp+0xf>
test   %rsi,%rsi
je     111f <xstrcmp+0xf>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @xstrcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %8, %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = icmp eq i8* %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
br label %20
16: ; preds = %8
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @strcmp(i8* %17, i8* %18)
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @xstrcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = icmp eq i8* %0, %1
%8 = zext i1 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}