xunge/DecIR huggingface dataset:
/* Type definitions */
struct libvirtentry {
  int dummy;
};

/* Variables and functions */
size_t count(struct libvirtentry **entries) {
  size_t r = 0;
  while (*entries != NULL)
    r++, entries++;
  return r;
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     113b <count+0x3b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <count+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
cmpq   $0x0,(%rdi)
je     1120 <count+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpq   $0x0,0x8(%rdi,%rcx,8)
mov    %rax,%rcx
jne    1110 <count+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.libvirtentry = type { i32 }
define i64 @count(%struct.libvirtentry** %0) {
%2 = alloca %struct.libvirtentry**
%3 = alloca i64
store %struct.libvirtentry** %0, %struct.libvirtentry*** %2
store i64 0, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load %struct.libvirtentry**, %struct.libvirtentry*** %2
%6 = load %struct.libvirtentry*, %struct.libvirtentry** %5
%7 = icmp ne %struct.libvirtentry* %6, null
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = load i64, i64* %3
%10 = add i64 %9, 1
store i64 %10, i64* %3
%11 = load %struct.libvirtentry**, %struct.libvirtentry*** %2
%12 = getelementptr inbounds %struct.libvirtentry*, %struct.libvirtentry** %11, i32 1
store %struct.libvirtentry** %12, %struct.libvirtentry*** %2
br label %4
13: ; preds = %4
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
%struct.libvirtentry = type { i32 }
define i64 @count(%struct.libvirtentry** nocapture %0) {
%2 = load %struct.libvirtentry*, %struct.libvirtentry** %0
%3 = icmp eq %struct.libvirtentry* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi %struct.libvirtentry** [ %8, %4 ], [ %0, %1 ]
%7 = add i64 %5, 1
%8 = getelementptr inbounds %struct.libvirtentry*, %struct.libvirtentry** %6, i64 1
%9 = load %struct.libvirtentry*, %struct.libvirtentry** %8
%10 = icmp eq %struct.libvirtentry* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %7, %4 ]
ret i64 %12
}
int fnLinSearch(int a[], int n, int key) {
  if (a[n - 1] == key)
    return n - 1;
  else if (n == 0)
    return -1;
  else
    return fnLinSearch(a, n - 1, key);
}


x86 assembly (clang, -O0):
<fnLinSearch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1149 <fnLinSearch+0x39>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <fnLinSearch+0x64>
cmpl   $0x0,-0x14(%rbp)
jne    115f <fnLinSearch+0x4f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <fnLinSearch+0x64>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%edx
call   1030 <fnLinSearch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnLinSearch>:
movslq %esi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rax,%rsi
sub    $0x1,%rax
setb   %cl
cmp    %edx,-0x4(%rdi,%rsi,4)
je     1124 <fnLinSearch+0x24>
test   %cl,%cl
je     1110 <fnLinSearch+0x10>
ret

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

LLVM IR (-O2):
define i32 @fnLinSearch(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %4, %3 ], [ %7, %5 ]
%7 = add nsw i64 %6, -1
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, %2
%11 = icmp eq i64 %6, 0
%12 = select i1 %10, i1 true, i1 %11
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = trunc i64 %7 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void Sleep(unsigned int value) { usleep(value * 1000); }


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

x86 assembly (clang, -O2):
<Sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @Sleep(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
int ack(int m, int n) {
  int z;
  if (m == 0)
    z = n + 1;
  else if (n == 0)
    z = ack(m - 1, 1);
  else
    z = ack(m - 1, ack(m, n - 1));
  return z;
}


x86 assembly (clang, -O0):
<ack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <ack+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1181 <ack+0x71>
cmpl   $0x0,-0x8(%rbp)
jne    1158 <ack+0x48>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <ack@plt>
mov    %eax,-0xc(%rbp)
jmp    117c <ack+0x6c>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <ack@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <ack@plt>
mov    %eax,-0xc(%rbp)
jmp    1181 <ack+0x71>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ack>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <ack+0x2f>
mov    %edi,%ebx
jmp    112a <ack+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <ack+0x2f>
test   %eax,%eax
je     1120 <ack+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <ack@plt>
add    $0xffffffff,%ebx
jne    112a <ack+0x1a>
add    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ack(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @ack(i32 %9, i32 %16)
br label %11
}
int gcd(int a, int b) {
  while (b)
    b ^= a ^= b ^= a %= b;
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1139 <gcd+0x39>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
xor    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = srem i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = xor i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = xor i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = xor i32 %16, %15
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [-p] directory ...\n", getprogname());
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s [-p] directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"usage: %s [-p] directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Delay_Ms(int);
void dynamic_delay_ms(unsigned int delay) {
  for (; delay > 0; delay -= 1)
    Delay_Ms(1);
}


x86 assembly (clang, -O0):
<dynamic_delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jbe    113d <dynamic_delay_ms+0x2d>
mov    $0x1,%edi
call   1030 <Delay_Ms@plt>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <dynamic_delay_ms+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamic_delay_ms>:
push   %rbx
test   %edi,%edi
je     112f <dynamic_delay_ms+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <Delay_Ms@plt>
add    $0xffffffff,%ebx
jne    1120 <dynamic_delay_ms+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @dynamic_delay_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @Delay_Ms(i32 1)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = sub i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @dynamic_delay_ms(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @Delay_Ms(i32 1)
%6 = add i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
void i2d_RSAPrivateKey(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_RSAPrivateKey() {
ret void
}
void read_in(struct stats_pwr_in *st_pwr_in, int nbr) {}


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

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

LLVM IR (-O0):
%struct.stats_pwr_in = type opaque
define void @read_in(%struct.stats_pwr_in* %0, i32 %1) {
%3 = alloca %struct.stats_pwr_in*
%4 = alloca i32
store %struct.stats_pwr_in* %0, %struct.stats_pwr_in** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.stats_pwr_in = type opaque
define void @read_in(%struct.stats_pwr_in* nocapture %0, i32 %1) {
ret void
}
int evaluate_nand_node(int input1, int input2) {
  int result;
  if ((input1 == 1) && (input2 == 1)) {
    result = -1;
  } else if ((input1 == -1) || (input2 == -1)) {
    result = 1;
  } else {
    result = 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<evaluate_nand_node>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    112a <evaluate_nand_node+0x2a>
cmpl   $0x1,-0x8(%rbp)
jne    112a <evaluate_nand_node+0x2a>
movl   $0xffffffff,-0xc(%rbp)
jmp    1156 <evaluate_nand_node+0x56>
cmpl   $0xffffffff,-0x4(%rbp)
je     113e <evaluate_nand_node+0x3e>
cmpl   $0xffffffff,-0x8(%rbp)
jne    114a <evaluate_nand_node+0x4a>
movl   $0x1,-0xc(%rbp)
jmp    1151 <evaluate_nand_node+0x51>
movl   $0x0,-0xc(%rbp)
jmp    1156 <evaluate_nand_node+0x56>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluate_nand_node>:
mov    %edi,%eax
xor    $0x1,%eax
mov    %esi,%ecx
xor    $0x1,%ecx
cmp    $0xffffffff,%edi
sete   %dil
cmp    $0xffffffff,%esi
sete   %dl
or     %dil,%dl
movzbl %dl,%edx
or     %eax,%ecx
mov    $0xffffffff,%eax
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @evaluate_nand_node(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp eq i32 %1, 1
%5 = and i1 %3, %4
%6 = icmp eq i32 %0, -1
%7 = icmp eq i32 %1, -1
%8 = or i1 %6, %7
%9 = zext i1 %8 to i32
%10 = select i1 %5, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyb(unsigned char key, int x, int y) {
  if (key == 27) {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<keyb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x1b,%eax
jne    1138 <keyb+0x28>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyb>:
cmp    $0x1b,%dil
je     1117 <keyb+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyb(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 27
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @keyb(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int __builtin_wasm_trunc_saturate_u_i32_f32(float);
int trunc_saturate_u_i32_f32(float f) {
  return __builtin_wasm_trunc_saturate_u_i32_f32(f);
}


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

x86 assembly (clang, -O2):
<trunc_saturate_u_i32_f32>:
jmp    1030 <__builtin_wasm_trunc_saturate_u_i32_f32@plt>

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

LLVM IR (-O2):
define i32 @trunc_saturate_u_i32_f32(float %0) {
%2 = tail call i32 @__builtin_wasm_trunc_saturate_u_i32_f32(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ redraw();
void edit_redraw(void) { redraw(); }


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

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

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

LLVM IR (-O2):
define void @edit_redraw() {
%1 = tail call i32 (...) @redraw()
ret void
}
void gtk_text_iter_starts_line() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_starts_line() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) {
  putc('1', stderr);
  putc('2', stderr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    $0x31,%edi
call   1030 <putc@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    $0x32,%edi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x31,%edi
call   1030 <putc@plt>
mov    (%rbx),%esi
mov    $0x32,%edi
call   1030 <putc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @putc(i8 signext 49, i32 %2)
%4 = load i32, i32* @stderr
%5 = call i32 @putc(i8 signext 50, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @putc(i8 signext 49, i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @putc(i8 signext 50, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ load_file(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    usage(argv[0]);
    exit(1);
  }
  load_file(stdin);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    115f <main+0x2f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <usage@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <load_file@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    1148 <main+0x18>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <load_file@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    (%rsi),%rdi
call   1030 <usage@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @usage(i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32, i32* @stdin
%15 = call i32 @load_file(i32 %14)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = load i32, i32* @stdin
%10 = tail call i32 @load_file(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ output_char(char);
void output_str(char *s) {
output_str_j1:
  if (*s != 0) {
    output_char(*s);
    s = s + 1;
    goto output_str_j1;
  }
  return;
}


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

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

LLVM IR (-O0):
define void @output_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %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 %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @output_char(i8 signext %10)
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @output_str(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 i32 @output_char(i8 signext %5)
%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 /*<<< orphan*/ eputxs(char const *, int, int, int);
void eputs(const char *string, int x, int y) { eputxs(string, x, y, 0xF000); }


x86 assembly (clang, -O0):
<eputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xf000,%ecx
call   1030 <eputxs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eputs>:
mov    $0xf000,%ecx
jmp    1030 <eputxs@plt>

LLVM IR (-O0):
define void @eputs(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @eputxs(i8* %7, i32 %8, i32 %9, i32 61440)
ret void
}

LLVM IR (-O2):
define void @eputs(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @eputxs(i8* %0, i32 %1, i32 %2, i32 61440)
ret void
}
/* Variables and functions */
size_t max(size_t x, size_t y) {
  if (x > y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp ugt i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %4
store i64 %10, i64* %3
br label %13
11: ; preds = %2
%12 = load i64, i64* %5
store i64 %12, i64* %3
br label %13
13: ; preds = %11, %9
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR1;
int /*<<< orphan*/ error(char *, int);
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void child(pid_t pid) {
  while (1) {
    sleep(2);
    kill(pid, SIGUSR1);
  }
  error("child process failed to terminate correctly", 242);
}


x86 assembly (clang, -O0):
<child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
jmp    112b <child+0xb>

x86 assembly (clang, -O2):
<child>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebb(%rip),%r14
nopl   (%rax)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    (%r14),%esi
mov    %ebx,%edi
call   1030 <kill@plt>
jmp    1130 <child+0x10>

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @sleep(i32 2)
%5 = load i32, i32* %2
%6 = load i32, i32* @SIGUSR1
%7 = call i32 @kill(i32 %5, i32 %6)
br label %3
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @child(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @sleep(i32 2)
%4 = load i32, i32* @SIGUSR1
%5 = tail call i32 @kill(i32 %0, i32 %4)
br label %2
}
unsigned int dnsget16(unsigned char *p) {
  unsigned int rc = (p[0] & 0377) << 8;
  rc |= (p[1] & 0377);
  return rc;
}


x86 assembly (clang, -O0):
<dnsget16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xff,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnsget16>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @dnsget16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 255
%9 = shl i32 %8, 8
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 255
%15 = load i32, i32* %3
%16 = or i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @dnsget16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local2;
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] - 146565199UL) + 0xfd76d96b99e243c4UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x1,-0x28(%rbp)
jae    1165 <RandomFunc+0x65>
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1154 <RandomFunc+0x54>
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1138 <RandomFunc+0x38>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
jmp    1125 <RandomFunc+0x25>
mov    -0x18(%rbp),%rcx
sub    $0x8bc684f,%rcx
movabs $0xfd76d96b99e243c4,%rax
d9 76 fd
add    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movabs $0xfd76d96b908be6ba,%rax
d9 76 fd
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
%7 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i64 0
%10 = load i64, i64* %9
%11 = add i64 %10, -10089659
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
store i64 0, i64* %7
br label %13
13: ; preds = %23, %2
%14 = load i64, i64* %7
%15 = icmp ult i64 %14, 1
br i1 %15, label %16, label %26
16: ; preds = %13
store i64 0, i64* %6
br label %17
17: ; preds = %20, %16
%18 = load i64, i64* %6
%19 = icmp ult i64 %18, 1
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i64, i64* %6
%22 = add i64 %21, 2
store i64 %22, i64* %6
br label %17
23: ; preds = %17
%24 = load i64, i64* %7
%25 = add i64 %24, 2
store i64 %25, i64* %7
br label %13
26: ; preds = %13
%27 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%28 = load i64, i64* %27
%29 = sub i64 %28, 146565199
%30 = add i64 %29, -182719678695455804
%31 = load i64*, i64** %4
%32 = getelementptr inbounds i64, i64* %31, i64 0
store i64 %30, i64* %32
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, -182719678852110662
store i64 %4, i64* %1
ret void
}
/* Type definitions */
struct sslCheckOptions {
  int dummy;
};
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int ssl_print_tmp_key(struct sslCheckOptions *options, SSL *s) { return 0; }


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

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

LLVM IR (-O0):
%struct.sslCheckOptions = type { i32 }
define i32 @ssl_print_tmp_key(%struct.sslCheckOptions* %0, i32* %1) {
%3 = alloca %struct.sslCheckOptions*
%4 = alloca i32*
store %struct.sslCheckOptions* %0, %struct.sslCheckOptions** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
%struct.sslCheckOptions = type { i32 }
define i32 @ssl_print_tmp_key(%struct.sslCheckOptions* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_35(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_35() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ flipld(int);
void flipld_test(void **state) {
  assert_int_equal(flipld(0x0101010101010101ul), 0xFF00000000000000ul);
  assert_int_equal(flipld(0x0202020202020202ul), 0x00FF000000000000ul);
}


x86 assembly (clang, -O0):
<flipld_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1010101,%edi
call   1030 <flipld@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <assert_int_equal@plt>
mov    $0x2020202,%edi
call   1030 <flipld@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flipld_test>:
push   %rax
mov    $0x1010101,%edi
call   1030 <flipld@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <assert_int_equal@plt>
mov    $0x2020202,%edi
call   1030 <flipld@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @flipld_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @flipld(i32 16843009)
%4 = call i32 @assert_int_equal(i32 %3, i32 0)
%5 = call i32 @flipld(i32 33686018)
%6 = call i32 @assert_int_equal(i32 %5, i32 0)
ret void
}

LLVM IR (-O2):
define void @flipld_test(i8** nocapture readnone %0) {
%2 = tail call i32 @flipld(i32 16843009)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 0)
%4 = tail call i32 @flipld(i32 33686018)
%5 = tail call i32 @assert_int_equal(i32 %4, i32 0)
ret void
}
int test_lib() { return 2; }


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

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

LLVM IR (-O0):
define i32 @test_lib() {
ret i32 2
}

LLVM IR (-O2):
define i32 @test_lib() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x7c() {
  Assert_real((isxdigit(124) == 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_isxdigit.c",
              625, ("isxdigit should be 0 for |"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x7c>:
push   %rax
mov    $0x7c,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x271,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for |\00"
define void @t_isxdigit_0x7c() {
%1 = call i64 @isxdigit(i32 124)
%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 625, i8* getelementptr inbounds ([27 x i8], [27 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for |\00"
define void @t_isxdigit_0x7c() {
%1 = tail call i64 @isxdigit(i32 124)
%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 625, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
extern int func8(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @func8() {
ret i32 8
}

LLVM IR (-O2):
define i32 @func8() {
ret i32 8
}
int __attribute__((warn_unused_result)) __fifo_int_must_check_helper(int val) {
  return val;
}


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

x86 assembly (clang, -O2):
<__fifo_int_must_check_helper>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @__fifo_int_must_check_helper(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ ends_with(char const *, char *);
int is_image(const char *file) {
  return (ends_with(file, ".jpg") || ends_with(file, ".jpeg"));
}


x86 assembly (clang, -O0):
<is_image>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <ends_with@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1158 <is_image+0x48>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
call   1030 <ends_with@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_image>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <ends_with@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     112f <is_image+0x1f>
pop    %rbx
ret
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <ends_with@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c".jpg\00"
@.str.1 = [6 x i8] c".jpeg\00"
define i32 @is_image(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @ends_with(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @ends_with(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c".jpg\00"
@.str.1 = [6 x i8] c".jpeg\00"
define i32 @is_image(i8* %0) {
%2 = tail call i64 @ends_with(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @ends_with(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct port {
  int dummy;
};
struct lagopus_packet {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lagopus_match_and_action(struct lagopus_packet *);
int /*<<< orphan*/ lagopus_set_in_port(struct lagopus_packet *, struct port *);
void lagopus_receive_packet(struct port *port, struct lagopus_packet *pkt) {
  lagopus_set_in_port(pkt, port);
  lagopus_match_and_action(pkt);
}


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

x86 assembly (clang, -O2):
<lagopus_receive_packet>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rbx,%rdi
call   1040 <lagopus_set_in_port@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <lagopus_match_and_action@plt>

LLVM IR (-O0):
%struct.port = type { i32 }
%struct.lagopus_packet = type { i32 }
define void @lagopus_receive_packet(%struct.port* %0, %struct.lagopus_packet* %1) {
%3 = alloca %struct.port*
%4 = alloca %struct.lagopus_packet*
store %struct.port* %0, %struct.port** %3
store %struct.lagopus_packet* %1, %struct.lagopus_packet** %4
%5 = load %struct.lagopus_packet*, %struct.lagopus_packet** %4
%6 = load %struct.port*, %struct.port** %3
%7 = call i32 @lagopus_set_in_port(%struct.lagopus_packet* %5, %struct.port* %6)
%8 = load %struct.lagopus_packet*, %struct.lagopus_packet** %4
%9 = call i32 @lagopus_match_and_action(%struct.lagopus_packet* %8)
ret void
}

LLVM IR (-O2):
%struct.port = type { i32 }
%struct.lagopus_packet = type { i32 }
define void @lagopus_receive_packet(%struct.port* %0, %struct.lagopus_packet* %1) {
%3 = tail call i32 @lagopus_set_in_port(%struct.lagopus_packet* %1, %struct.port* %0)
%4 = tail call i32 @lagopus_match_and_action(%struct.lagopus_packet* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_create(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                   void *(*)(void *), void *);
int my_pthread_create(pthread_t *thread, const pthread_attr_t *__attr,
                      void *(*start_routine)(void *), void *arg) {
  pthread_attr_t *realattr = NULL;
  if (__attr != NULL)
    realattr = (pthread_attr_t *)*(int *)__attr;
  return pthread_create(thread, realattr, start_routine, arg);
}


x86 assembly (clang, -O0):
<my_pthread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <my_pthread_create+0x36>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <pthread_create@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pthread_create>:
test   %rsi,%rsi
je     111d <my_pthread_create+0xd>
movslq (%rsi),%rsi
jmp    1030 <pthread_create@plt>
xor    %esi,%esi
jmp    1030 <pthread_create@plt>

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

LLVM IR (-O2):
define i32 @my_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = icmp eq i32* %1, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %6, %4
%11 = phi i32* [ %9, %6 ], [ null, %4 ]
%12 = tail call i32 @pthread_create(i32* %0, i32* %11, i8* (i8*)* %2, i8* %3)
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(char);
int main() {
  int a[100] = {0};
  int i = 0;
  putchar('\n');
  for (i = 0; i < 100; i++)
    printf(" %d ", a[i]);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
movl   $0x0,-0x1a4(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    11ae <main+0x7e>
movslq -0x1a4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1173 <main+0x43>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %rsp,%rdi
xor    %ebx,%ebx
mov    $0x190,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea4(%rip),%r14
nopl   0x0(%rax)
mov    (%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c" %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x i32]* %2 to i8*
store i32 0, i32* %3
%5 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %6
18: ; preds = %6
%19 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c" %d \00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = tail call i32 @putchar(i8 signext 10)
br label %4
4: ; preds = %0, %4
%5 = phi i64 [ 0, %0 ], [ %9, %4 ]
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 100
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handle_sigint(int param) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @handle_sigint(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}