xunge/DecIR huggingface dataset:
void testClosureILLrV(void (*closure)(int, long long), int a1, long long a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureILLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureILLrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureILLrV(void (i32, i64)* %0, i32 %1, i64 %2) {
%4 = alloca void (i32, i64)*
%5 = alloca i32
%6 = alloca i64
store void (i32, i64)* %0, void (i32, i64)** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load void (i32, i64)*, void (i32, i64)** %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @testClosureILLrV(void (i32, i64)* nocapture %0, i32 %1, i64 %2) {
tail call void %0(i32 %1, i64 %2)
ret void
}
void _8086_if_restore() {}


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

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

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

LLVM IR (-O2):
define void @_8086_if_restore() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flick_reg(char *, int, int, int /*<<< orphan*/, int);
void i_rxx_reg(void) { flick_reg("rc", 1, 1, 0, 1); }


x86 assembly (clang, -O0):
<i_rxx_reg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%r8d
xor    %ecx,%ecx
mov    %r8d,%esi
mov    %r8d,%edx
call   1030 <flick_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_rxx_reg>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <flick_reg@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rc\00"
define void @i_rxx_reg() {
%1 = call i32 @flick_reg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"rc\00"
define void @i_rxx_reg() {
%1 = tail call i32 @flick_reg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i32 1, i32 0, i32 1)
ret void
}
int test_imm_7Cuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x7C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Cuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 124
%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_7Cuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 8126464
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ increment();
int main(void) {
  increment();
  increment();
  increment();
  increment();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <increment@plt>
mov    $0x0,%al
call   1030 <increment@plt>
mov    $0x0,%al
call   1030 <increment@plt>
mov    $0x0,%al
call   1030 <increment@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <increment@plt>
xor    %eax,%eax
call   1030 <increment@plt>
xor    %eax,%eax
call   1030 <increment@plt>
xor    %eax,%eax
call   1030 <increment@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @increment()
%3 = call i32 (...) @increment()
%4 = call i32 (...) @increment()
%5 = call i32 (...) @increment()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @increment()
%2 = tail call i32 (...) @increment()
%3 = tail call i32 (...) @increment()
%4 = tail call i32 (...) @increment()
ret i32 0
}
/* Type definitions */
struct katcl_line {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_katcl(struct katcl_line *, int);
void destroy_rpc_katcl(struct katcl_line *l) { destroy_katcl(l, 1); }


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

x86 assembly (clang, -O2):
<destroy_rpc_katcl>:
mov    $0x1,%esi
jmp    1030 <destroy_katcl@plt>

LLVM IR (-O0):
%struct.katcl_line = type { i32 }
define void @destroy_rpc_katcl(%struct.katcl_line* %0) {
%2 = alloca %struct.katcl_line*
store %struct.katcl_line* %0, %struct.katcl_line** %2
%3 = load %struct.katcl_line*, %struct.katcl_line** %2
%4 = call i32 @destroy_katcl(%struct.katcl_line* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.katcl_line = type { i32 }
define void @destroy_rpc_katcl(%struct.katcl_line* %0) {
%2 = tail call i32 @destroy_katcl(%struct.katcl_line* %0, i32 1)
ret void
}
int PrimeCheck(int number) {
  int i = 1;
  while (i <= number) {
    if (number % i == 0) {
      if (!((i == 1) || (i == number))) {
        return 0;
      }
    }
    i++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<PrimeCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115f <PrimeCheck+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1151 <PrimeCheck+0x51>
cmpl   $0x1,-0xc(%rbp)
je     114c <PrimeCheck+0x4c>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114c <PrimeCheck+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1166 <PrimeCheck+0x66>
jmp    1151 <PrimeCheck+0x51>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <PrimeCheck+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrimeCheck>:
test   %edi,%edi
jle    1139 <PrimeCheck+0x39>
mov    %edi,%ecx
neg    %ecx
mov    $0x1,%esi
jmp    1122 <PrimeCheck+0x22>
nop
lea    (%rcx,%rsi,1),%eax
add    $0x1,%eax
mov    %esi,%edx
add    $0x1,%edx
mov    %edx,%esi
cmp    $0x1,%eax
je     1139 <PrimeCheck+0x39>
mov    %edi,%eax
cltd
idiv   %esi
mov    %ecx,%eax
add    %esi,%eax
je     1110 <PrimeCheck+0x10>
cmp    $0x1,%esi
je     1110 <PrimeCheck+0x10>
test   %edx,%edx
jne    1110 <PrimeCheck+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @PrimeCheck(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %6
3: ; preds = %6
%4 = add nuw i32 %7, 1
%5 = icmp eq i32 %7, %0
br i1 %5, label %14, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 1, %1 ]
%8 = srem i32 %0, %7
%9 = icmp ne i32 %8, 0
%10 = icmp eq i32 %7, 1
%11 = or i1 %10, %9
%12 = icmp eq i32 %7, %0
%13 = or i1 %12, %11
br i1 %13, label %3, label %14
14: ; preds = %6, %3, %1
%15 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %6 ]
ret i32 %15
}
const char *gpsrx_string(unsigned short gpsrx) {
  switch (gpsrx) {
  case 0:
    return "Not receiving/no fix";
    break;
  case 192:
    return "Receiving/fix";
    break;
  default:
    return "Invalid";
  }
}


x86 assembly (clang, -O0):
<gpsrx_string>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1132 <gpsrx_string+0x32>
jmp    111f <gpsrx_string+0x1f>
mov    -0x10(%rbp),%eax
sub    $0xc0,%eax
je     1142 <gpsrx_string+0x42>
jmp    1152 <gpsrx_string+0x52>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <gpsrx_string+0x5d>
lea    0xecc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <gpsrx_string+0x5d>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpsrx_string>:
cmp    $0xc0,%edi
lea    0xf08(%rip),%rax
lea    0xf0f(%rip),%rcx
cmove  %rax,%rcx
test   %edi,%edi
lea    0xedf(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Not receiving/no fix\00"
@.str.1 = [14 x i8] c"Receiving/fix\00"
@.str.2 = [8 x i8] c"Invalid\00"
define i8* @gpsrx_string(i16 zeroext %0) {
%2 = alloca i8*
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
switch i32 %5, label %8 [
i32 0, label %6
i32 192, label %7
]
6: ; preds = %1
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [21 x i8] c"Not receiving/no fix\00"
@.str.1 = [14 x i8] c"Receiving/fix\00"
@.str.2 = [8 x i8] c"Invalid\00"
define i8* @gpsrx_string(i16 zeroext %0) {
%2 = icmp eq i16 %0, 192
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i16 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void cxl_cx4_teardown_msi_irqs(struct pci_dev *pdev) {}


x86 assembly (clang, -O0):
<cxl_cx4_teardown_msi_irqs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @cxl_cx4_teardown_msi_irqs(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @cxl_cx4_teardown_msi_irqs(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ sleep(int);
void sleepRandom() {
  int seconds = rand() % 10 + 1;
  sleep(seconds);
}


x86 assembly (clang, -O0):
<sleepRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleepRandom>:
push   %rax
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x1,%edi
pop    %rax
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @sleepRandom() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 10
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @sleep(i32 %5)
ret void
}

LLVM IR (-O2):
define void @sleepRandom() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
%3 = add nsw i32 %2, 1
%4 = tail call i32 @sleep(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void foo(void) { puts("hi in foo"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"hi in foo\00"
define void @foo() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"hi in foo\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getdata(int /*<<< orphan*/, unsigned long long, char *, int);
scalar_t__ strcmp(char *, char *);
int safecheck(pid_t pid, unsigned long long int bersaglio) {
  char normale[] = {0xe8, 0xb7, 0xfa, 0xff, 0xff, '\0'};
  char leggi[6];
  getdata(pid, bersaglio, leggi, 5);
  if (strcmp(normale, leggi) != 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<safecheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x5,%ecx
call   1040 <getdata@plt>
lea    -0x16(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     117b <safecheck+0x5b>
movl   $0x0,-0x4(%rbp)
jmp    1182 <safecheck+0x62>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safecheck>:
push   %rbx
sub    $0x10,%rsp
movw   $0xff,0x8(%rsp)
movl   $0xfffab7e8,0x4(%rsp)
ff
lea    0xa(%rsp),%rbx
mov    %rbx,%rdx
mov    $0x5,%ecx
call   1040 <getdata@plt>
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.safecheck.normale = [6 x i8] c"\E8\B7\FA\FF\FF\00"
define i32 @safecheck(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca [6 x i8]
%7 = alloca [6 x i8]
store i32 %0, i32* %4
store i64 %1, i64* %5
%8 = bitcast [6 x i8]* %6 to i8*
%9 = load i32, i32* %4
%10 = load i64, i64* %5
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 0
%12 = call i32 @getdata(i32 %9, i64 %10, i8* %11, i32 5)
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %6, i64 0, i64 0
%14 = getelementptr inbounds [6 x i8], [6 x i8]* %7, i64 0, i64 0
%15 = call i64 @strcmp(i8* %13, i8* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %19
18: ; preds = %2
store i32 1, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@__const.safecheck.normale = [6 x i8] c"\E8\B7\FA\FF\FF\00"
define i32 @safecheck(i32 %0, i64 %1) {
%3 = alloca [6 x i8]
%4 = alloca [6 x i8]
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%7 = call i32 @getdata(i32 %0, i64 %1, i8* %6, i32 5)
%8 = call i64 @strcmp(i8* %5, i8* %6)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
int resolve(int symbol) {
  if ((symbol > '0' - 1) && (symbol < '9' + 1))
    return symbol - '0';
  if ((symbol > 'A' - 1) && (symbol < 'F' + 1))
    return symbol - 'A' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<resolve>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2f,-0x8(%rbp)
jle    1129 <resolve+0x29>
cmpl   $0x3a,-0x8(%rbp)
jge    1129 <resolve+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <resolve+0x55>
cmpl   $0x40,-0x8(%rbp)
jle    114e <resolve+0x4e>
cmpl   $0x47,-0x8(%rbp)
jge    114e <resolve+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <resolve+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolve>:
lea    -0x41(%rdi),%eax
lea    -0x37(%rdi),%ecx
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
lea    -0x30(%rdi),%ecx
cmp    $0xa,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @resolve(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 47
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 58
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %23
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 64
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 71
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 65
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %23
22: ; preds = %15, %12
store i32 -1, i32* %2
br label %23
23: ; preds = %22, %18, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @resolve(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = add i32 %0, -65
%5 = icmp ult i32 %4, 6
%6 = add nsw i32 %0, -55
%7 = select i1 %5, i32 %6, i32 -1
%8 = select i1 %3, i32 %2, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ initializeMesh();
void benchmarkSetupOnce() { initializeMesh(); }


x86 assembly (clang, -O0):
<benchmarkSetupOnce>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <initializeMesh@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @benchmarkSetupOnce() {
%1 = call i32 (...) @initializeMesh()
ret void
}

LLVM IR (-O2):
define void @benchmarkSetupOnce() {
%1 = tail call i32 (...) @initializeMesh()
ret void
}
int check_special(char *command) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_special(i8* nocapture readnone %0) {
ret i32 0
}
int ocfs2_clear_bit(int nr, void *addr) {
  int mask, retval;
  unsigned char *ADDR = (unsigned char *)addr;
  ADDR += nr >> 3;
  mask = 1 << (nr & 0x07);
  retval = (mask & *ADDR) != 0;
  *ADDR &= ~mask;
  return retval;
}


x86 assembly (clang, -O0):
<ocfs2_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x3,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
xor    $0xffffffff,%edx
mov    -0x20(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocfs2_clear_bit>:
mov    %edi,%ecx
mov    %edi,%eax
sar    $0x3,%eax
movslq %eax,%r8
and    $0x7,%cl
mov    $0x1,%edi
shl    %cl,%edi
movzbl (%rsi,%r8,1),%edx
mov    %edx,%eax
shr    %cl,%eax
not    %dil
and    %dl,%dil
and    $0x1,%eax
mov    %dil,(%rsi,%r8,1)
ret

LLVM IR (-O0):
define i32 @ocfs2_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i32, i32* %3
%10 = ashr i32 %9, 3
%11 = load i8*, i8** %7
%12 = sext i32 %10 to i64
%13 = getelementptr inbounds i8, i8* %11, i64 %12
store i8* %13, i8** %7
%14 = load i32, i32* %3
%15 = and i32 %14, 7
%16 = shl i32 1, %15
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = load i8*, i8** %7
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %17, %20
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i32
store i32 %23, i32* %6
%24 = load i32, i32* %5
%25 = xor i32 %24, -1
%26 = load i8*, i8** %7
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %28, %25
%30 = trunc i32 %29 to i8
store i8 %30, i8* %26
%31 = load i32, i32* %6
ret i32 %31
}

LLVM IR (-O2):
define i32 @ocfs2_clear_bit(i32 %0, i8* nocapture %1) {
%3 = ashr i32 %0, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = and i32 %0, 7
%7 = shl nuw nsw i32 1, %6
%8 = load i8, i8* %5
%9 = zext i8 %8 to i32
%10 = lshr i32 %9, %6
%11 = and i32 %10, 1
%12 = trunc i32 %7 to i8
%13 = xor i8 %12, -1
%14 = and i8 %8, %13
store i8 %14, i8* %5
ret i32 %11
}
int test_imm_39uint16_mem(unsigned short *val) {
  return ((*val) & (0x39 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_39uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x39,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_39uint16_mem>:
testb  $0x39,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_39uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 57
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int sprintf(char *, char *, int, char);
int main(int argc, char *args[]) {
  char buff[64];
  if (sprintf(buff, "%d%c", 32, 'A') != -1)
    printf("%s", buff);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x20,%edx
mov    $0x41,%ecx
call   1050 <sprintf@plt>
cmp    $0xffffffff,%eax
je     1179 <main+0x49>
lea    -0x50(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0xec5(%rip),%rsi
mov    %rsp,%rdi
mov    $0x20,%edx
mov    $0x41,%ecx
call   1050 <sprintf@plt>
cmp    $0xffffffff,%eax
je     1161 <main+0x31>
lea    0xeac(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 32, i8 signext 65)
%9 = icmp ne i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %2
%14 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%c\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 32, i8 signext 65)
%6 = icmp eq i32 %5, -1
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
br label %9
9: ; preds = %7, %2
%10 = call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x54() {
  Assert_real((isalpha(84)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              425, ("isalpha should be 1 for T"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x54>:
push   %rbp
mov    %rsp,%rbp
mov    $0x54,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1a9,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x54>:
push   %rax
mov    $0x54,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1a9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for T\00"
define void @t_isalpha_0x54() {
%1 = call i32 @isalpha(i32 84)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for T\00"
define void @t_isalpha_0x54() {
%1 = tail call i32 @isalpha(i32 84)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 425, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void local_print_greetings(void) { printf("Hello from UNPATCHED\n"); }


x86 assembly (clang, -O0):
<local_print_greetings>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from UNPATCHED\0A\00"
define void @local_print_greetings() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello from UNPATCHED\00"
define void @local_print_greetings() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int fremovexattr(int __fd, const char *__name) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<fremovexattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fremovexattr>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @fremovexattr(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @fremovexattr(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int hdate_days_from_3744(int);
int hdate_get_size_of_hebrew_year(int hebrew_year) {
  return hdate_days_from_3744(hebrew_year + 1) -
         hdate_days_from_3744(hebrew_year);
}


x86 assembly (clang, -O0):
<hdate_get_size_of_hebrew_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <hdate_days_from_3744@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <hdate_days_from_3744@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdate_get_size_of_hebrew_year>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1030 <hdate_days_from_3744@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <hdate_days_from_3744@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hdate_get_size_of_hebrew_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @hdate_days_from_3744(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @hdate_days_from_3744(i32 %6)
%8 = sub nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hdate_get_size_of_hebrew_year(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @hdate_days_from_3744(i32 %2)
%4 = tail call i32 @hdate_days_from_3744(i32 %0)
%5 = sub nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void control_c(int sig) {
  printf("Please wait for firmware update to finish before exiting\n");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"Please wait for firmware update to finish before exiting\0A\00"
define void @control_c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c"Please wait for firmware update to finish before exiting\00"
define void @control_c(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *itoc(int i) {
  char *buffer;
  buffer = malloc(10);
  if (buffer)
    snprintf(buffer, 9, " [%d%]", i);
  else
    printf("Not enough ram..\n");
  return buffer;
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1171 <itoc+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x9,%esi
lea    0xe99(%rip),%rdx
call   1040 <snprintf@plt>
jmp    117d <itoc+0x4d>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115f <itoc+0x2f>
lea    0xeb2(%rip),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %ebp,%ecx
call   1040 <snprintf@plt>
jmp    116b <itoc+0x3b>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" [%d%]\00"
@.str.1 = [18 x i8] c"Not enough ram..\0A\00"
define i8* @itoc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 10)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i32, i32* %2
%10 = call i32 @snprintf(i8* %8, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %13
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [7 x i8] c" [%d%]\00"
@str = [17 x i8] c"Not enough ram..\00"
define i8* @itoc(i32 %0) {
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @snprintf(i8* %2, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ hexlify(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
void ex_cstr(void) {
  const char str[] = "hi!";
  hexlify("C string", str, 1 + strlen(str));
}


x86 assembly (clang, -O0):
<ex_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    0xeb0(%rip),%rdi
call   1040 <hexlify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_cstr>:
push   %rbx
sub    $0x10,%rsp
movl   $0x216968,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1040 <hexlify@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.ex_cstr.str = [4 x i8] c"hi!\00"
@.str = [9 x i8] c"C string\00"
define void @ex_cstr() {
%1 = alloca [4 x i8]
%2 = bitcast [4 x i8]* %1 to i8*
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 1, %5
%7 = call i32 @hexlify(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"C string\00"
define void @ex_cstr() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2189672, i32* %1
%3 = call i64 @strlen(i8* %2)
%4 = add nsw i64 %3, 1
%5 = call i32 @hexlify(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2, i64 %4)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int compare(const void *a, const void *b) {
  const char *ca = *(const char **)a, *cb = *(const char **)b;
  return strcmp(ca, cb);
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
int ixlchr(long *chrvar) { return ((int)chrvar); }


x86 assembly (clang, -O0):
<ixlchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ixlchr(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = ptrtoint i64* %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @ixlchr(i64* %0) {
%2 = ptrtoint i64* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ lcdhal_write(int, int);
void _helper_pixel16(uint16_t color) {
  lcdhal_write(1, color >> 8);
  lcdhal_write(1, color & 0xFF);
}


x86 assembly (clang, -O0):
<_helper_pixel16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
sar    $0x8,%esi
mov    $0x1,%edi
call   1030 <lcdhal_write@plt>
mov    -0x4(%rbp),%esi
and    $0xff,%esi
mov    $0x1,%edi
call   1030 <lcdhal_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_helper_pixel16>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%esi
sar    $0x8,%esi
mov    $0x1,%edi
call   1030 <lcdhal_write@plt>
movzbl %bl,%esi
mov    $0x1,%edi
pop    %rbx
jmp    1030 <lcdhal_write@plt>

LLVM IR (-O0):
define void @_helper_pixel16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 @lcdhal_write(i32 1, i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @lcdhal_write(i32 1, i32 %7)
ret void
}

LLVM IR (-O2):
define void @_helper_pixel16(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @lcdhal_write(i32 1, i32 %2)
%4 = and i32 %0, 255
%5 = tail call i32 @lcdhal_write(i32 1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fatal_error(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
scalar_t__ unlink(char *);
void erase_test(int test) {
  char filename[256];
  sprintf(filename, "test-expandargv-%d.lst", test);
  if (unlink(filename) != 0)
    fatal_error(193, "Failed to erase test file.", errno);
}


x86 assembly (clang, -O0):
<erase_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb1(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     1184 <erase_test+0x54>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
mov    $0xc1,%edi
lea    0xe98(%rip),%rsi
call   1040 <fatal_error@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_test>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%edx
lea    0xebf(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
test   %rax,%rax
je     117b <erase_test+0x4b>
mov    0x2e80(%rip),%rax
mov    (%rax),%edx
lea    0xeae(%rip),%rsi
mov    $0xc1,%edi
add    $0x100,%rsp
pop    %rbx
jmp    1040 <fatal_error@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"test-expandargv-%d.lst\00"
@.str.1 = [27 x i8] c"Failed to erase test file.\00"
@errno = global i32 0
define void @erase_test(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i64 @unlink(i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* @errno
%12 = call i32 @fatal_error(i32 193, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"test-expandargv-%d.lst\00"
@.str.1 = [27 x i8] c"Failed to erase test file.\00"
@errno = global i32 0
define void @erase_test(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i64 @unlink(i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @errno
%9 = tail call i32 @fatal_error(i32 193, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %7, %1
ret void
}
int ev_is_default_loop(void) { return 1; }


x86 assembly (clang, -O0):
<ev_is_default_loop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_is_default_loop>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ev_is_default_loop() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ev_is_default_loop() {
ret i32 1
}
/* Type definitions */
struct udev_queue {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *open_queue_file(struct udev_queue *, unsigned long long *);
__attribute__((visibility("default"))) int
udev_queue_get_udev_is_active(struct udev_queue *udev_queue) {
  unsigned long long int seqnum_start;
  FILE *queue_file;
  queue_file = open_queue_file(udev_queue, &seqnum_start);
  if (queue_file == NULL)
    return 0;
  fclose(queue_file);
  return 1;
}


x86 assembly (clang, -O0):
<udev_queue_get_udev_is_active>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <open_queue_file@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <udev_queue_get_udev_is_active+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1164 <udev_queue_get_udev_is_active+0x44>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_queue_get_udev_is_active>:
push   %rax
mov    %rsp,%rsi
call   1040 <open_queue_file@plt>
test   %rax,%rax
je     113d <udev_queue_get_udev_is_active+0x1d>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.udev_queue = type { i32 }
define i32 @udev_queue_get_udev_is_active(%struct.udev_queue* %0) {
%2 = alloca i32
%3 = alloca %struct.udev_queue*
%4 = alloca i64
%5 = alloca i32*
store %struct.udev_queue* %0, %struct.udev_queue** %3
%6 = load %struct.udev_queue*, %struct.udev_queue** %3
%7 = call i32* @open_queue_file(%struct.udev_queue* %6, i64* %4)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %14
11: ; preds = %1
%12 = load i32*, i32** %5
%13 = call i32 @fclose(i32* %12)
store i32 1, i32* %2
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.udev_queue = type { i32 }
define i32 @udev_queue_get_udev_is_active(%struct.udev_queue* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32* @open_queue_file(%struct.udev_queue* %0, i64* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @fclose(i32* %4)
br label %8
8: ; preds = %1, %6
%9 = phi i32 [ 1, %6 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe1() {
  Assert_real((isbdigit(225) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1130, ("isbdigit should be 0 for 0xe1"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0xe1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe1,%edi
call   1040 <isbdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x46a,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0xe1>:
push   %rax
mov    $0xe1,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x46a,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe1\00"
define void @t_isbdigit_0xe1() {
%1 = call i64 @isbdigit(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe1\00"
define void @t_isbdigit_0xe1() {
%1 = tail call i64 @isbdigit(i32 225)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1130, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int nid;
};
typedef TYPE_1__ ASN1_STRING_TABLE;

/* Variables and functions */
int sk_table_cmp(const ASN1_STRING_TABLE *const *a,
                 const ASN1_STRING_TABLE *const *b) {
  return (*a)->nid - (*b)->nid;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @sk_table_cmp(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca %struct.TYPE_4__**
%4 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %3
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %4
%5 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %3
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %5
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%10 = load %struct.TYPE_4__*, %struct.TYPE_4__** %9
%11 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = sub nsw i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @sk_table_cmp(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%7 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}