xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ hover_event_init();
int /*<<< orphan*/ hover_hardware_init(int, int, int);
int /*<<< orphan*/ hover_log_init(char *);
int /*<<< orphan*/ hover_websocket_run(char *, char *);
int main(int argc, char **argv) {
  hover_event_init();
  hover_log_init("/dev/stdout");
  hover_hardware_init(12, 13, 11);
  hover_websocket_run("0.0.0.0", "1337");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <hover_event_init@plt>
lea    0xea3(%rip),%rdi
call   1050 <hover_log_init@plt>
mov    $0xc,%edi
mov    $0xd,%esi
mov    $0xb,%edx
call   1040 <hover_hardware_init@plt>
lea    0xe8f(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1060 <hover_websocket_run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <hover_event_init@plt>
lea    0xeb1(%rip),%rdi
call   1050 <hover_log_init@plt>
mov    $0xc,%edi
mov    $0xd,%esi
mov    $0xb,%edx
call   1040 <hover_hardware_init@plt>
lea    0xe9d(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1060 <hover_websocket_run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/dev/stdout\00"
@.str.1 = [8 x i8] c"0.0.0.0\00"
@.str.2 = [5 x i8] c"1337\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @hover_event_init()
%6 = call i32 @hover_log_init(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @hover_hardware_init(i32 12, i32 13, i32 11)
%8 = call i32 @hover_websocket_run(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/stdout\00"
@.str.1 = [8 x i8] c"0.0.0.0\00"
@.str.2 = [5 x i8] c"1337\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @hover_event_init()
%4 = tail call i32 @hover_log_init(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @hover_hardware_init(i32 12, i32 13, i32 11)
%6 = tail call i32 @hover_websocket_run(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
useit1(val) {
  static int usedval;
  usedval = val;
}


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

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

LLVM IR (-O0):
@useit1.usedval = internal global i32 0
define i32 @useit1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
store i32 %4, i32* @useit1.usedval
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @useit1(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void call_reg64(unsigned int reg64) {
  put8(0xFF);
  put8(0xD0 + reg64);
}


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

x86 assembly (clang, -O2):
<call_reg64>:
push   %rbx
mov    %edi,%ebx
mov    $0xff,%edi
call   1030 <put8@plt>
add    $0xd0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @call_reg64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 255)
%4 = load i32, i32* %2
%5 = add i32 208, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @call_reg64(i32 %0) {
%2 = tail call i32 @put8(i32 255)
%3 = add i32 %0, 208
%4 = tail call i32 @put8(i32 %3)
ret void
}
int quantum_gate_counter(int inc) {
  static int counter = 0;
  if (inc > 0)
    counter += inc;
  else if (inc < 0)
    counter = 0;
  return counter;
}


x86 assembly (clang, -O0):
<quantum_gate_counter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1125 <quantum_gate_counter+0x25>
mov    -0x4(%rbp),%eax
add    0x2f0a(%rip),%eax
mov    %eax,0x2f04(%rip)
jmp    113e <quantum_gate_counter+0x3e>
cmpl   $0x0,-0x4(%rbp)
jge    1139 <quantum_gate_counter+0x39>
movl   $0x0,0x2eeb(%rip)
jmp    113e <quantum_gate_counter+0x3e>
mov    0x2ee0(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantum_gate_counter>:
test   %edi,%edi
jle    1113 <quantum_gate_counter+0x13>
mov    %edi,%eax
add    0x2f18(%rip),%eax
mov    %eax,0x2f12(%rip)
ret
js     111c <quantum_gate_counter+0x1c>
mov    0x2f09(%rip),%eax
ret
movl   $0x0,0x2efe(%rip)
xor    %eax,%eax
ret

LLVM IR (-O0):
@quantum_gate_counter.counter = internal global i32 0
define i32 @quantum_gate_counter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* @quantum_gate_counter.counter
%8 = add nsw i32 %7, %6
store i32 %8, i32* @quantum_gate_counter.counter
br label %14
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 0, i32* @quantum_gate_counter.counter
br label %13
13: ; preds = %12, %9
br label %14
14: ; preds = %13, %5
%15 = load i32, i32* @quantum_gate_counter.counter
ret i32 %15
}

LLVM IR (-O2):
@quantum_gate_counter.counter = internal unnamed_addr global i32 0
define i32 @quantum_gate_counter(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @quantum_gate_counter.counter
%5 = add nsw i32 %4, %0
store i32 %5, i32* @quantum_gate_counter.counter
br label %11
6: ; preds = %1
%7 = icmp slt i32 %0, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = load i32, i32* @quantum_gate_counter.counter
br label %11
10: ; preds = %6
store i32 0, i32* @quantum_gate_counter.counter
br label %11
11: ; preds = %8, %10, %3
%12 = phi i32 [ %9, %8 ], [ 0, %10 ], [ %5, %3 ]
ret i32 %12
}
void ft_free2d(ptr2d, size, xstar, ystar) char **ptr2d;
int size;
int xstar;
int ystar;
{
  free(&ptr2d[ystar][xstar * size]);
  free(&ptr2d[ystar]);
}


x86 assembly (clang, -O0):
<ft_free2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
add    %rax,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free2d>:
push   %rbx
movslq %ecx,%rcx
lea    (%rdi,%rcx,8),%rbx
imul   %edx,%esi
movslq %esi,%rax
add    (%rdi,%rcx,8),%rax
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ft_free2d(i8** %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8**, i8*** %5
%10 = load i32, i32* %8
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8*, i8** %9, i64 %11
%13 = load i8*, i8** %12
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = mul nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %13, i64 %17
%19 = load i8**, i8*** %5
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = bitcast i8** %22 to i8*
ret void
}

LLVM IR (-O2):
define void @ft_free2d(i8** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
%8 = mul nsw i32 %2, %1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
tail call void @free(i8* %10)
%11 = bitcast i8** %6 to i8*
tail call void @free(i8* %11)
ret void
}
int test_imm_0Dint32_mem(int *val) {
  return ((*val) & (0x0D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Dint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 13
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ segparaHoras(int);
int main() {
  int segundos;
  printf("\nQuantos segundos?: ");
  scanf("%d", &segundos);
  segparaHoras(segundos);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <segparaHoras@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <segparaHoras@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0AQuantos segundos?: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @segparaHoras(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0AQuantos segundos?: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @segparaHoras(i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ is_transmit_empty();
int /*<<< orphan*/ outb(int, int /*<<< orphan*/, char);
void write_serial(char a) {
  while (is_transmit_empty() == 0)
    ;
  outb((0xa0000000 + 0x14000000 + 0x03f8), 0, a);
}


x86 assembly (clang, -O0):
<write_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <is_transmit_empty@plt>
cmp    $0x0,%rax
jne    1144 <write_serial+0x24>
jmp    112e <write_serial+0xe>
mov    $0xb40003f8,%edi
xor    %esi,%esi
movsbl -0x1(%rbp),%edx
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <is_transmit_empty@plt>
test   %rax,%rax
je     1130 <write_serial+0x10>
movsbl %bl,%edx
mov    $0xb40003f8,%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @write_serial(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @is_transmit_empty()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outb(i32 -1275067400, i32 0, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @write_serial(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @is_transmit_empty()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outb(i32 -1275067400, i32 0, i8 signext %0)
ret void
}
/* Type definitions */
typedef int dev_t;

/* Variables and functions */
unsigned int major(dev_t dev) {
  return ((dev >> 8) & 0xfff) | ((unsigned int)(dev >> 32) & ~0xfff);
}


x86 assembly (clang, -O0):
<major>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xfff,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
and    $0xfffff000,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @major(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 4095
%6 = load i32, i32* %2
%7 = ashr i32 %6, 32
%8 = and i32 %7, -4096
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @major(i32 %0) {
ret i32 poison
}
void hurz(murks) {
  if (murks = 4) {
    schrott();
  } else {
    flursen();
  }
  if (murks = 4) {
    bar();
  }
  if (murks = 4) {
    schrott();
  }
  return;
}


x86 assembly (clang, -O0):
<hurz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1151 <hurz+0x21>
jmp    115d <hurz+0x2d>
mov    $0x0,%al
call   1030 <schrott@plt>
jmp    1164 <hurz+0x34>
mov    $0x0,%al
call   1050 <flursen@plt>
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    117a <hurz+0x4a>
jmp    1181 <hurz+0x51>
mov    $0x0,%al
call   1040 <bar@plt>
movl   $0x4,-0x4(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1197 <hurz+0x67>
jmp    119e <hurz+0x6e>
mov    $0x0,%al
call   1030 <schrott@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hurz>:
push   %rax
xor    %eax,%eax
call   1030 <schrott@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <schrott@plt>

LLVM IR (-O0):
define void @hurz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %2
br i1 true, label %3, label %5
3: ; preds = %1
%4 = call i32 (...) @schrott()
br label %7
5: ; preds = %1
%6 = call i32 (...) @flursen()
br label %7
7: ; preds = %5, %3
store i32 4, i32* %2
br i1 true, label %8, label %10
8: ; preds = %7
%9 = call i32 (...) @bar()
br label %10
10: ; preds = %8, %7
store i32 4, i32* %2
br i1 true, label %11, label %13
11: ; preds = %10
%12 = call i32 (...) @schrott()
br label %13
13: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @hurz(i32 %0) {
%2 = tail call i32 (...) @schrott()
%3 = tail call i32 (...) @bar()
%4 = tail call i32 (...) @schrott()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int);
void decsca(int pn1) { do_csi("%d\"q", pn1); }


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

x86 assembly (clang, -O2):
<decsca>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%d\22q\00"
define void @decsca(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d\22q\00"
define void @decsca(i32 %0) {
%2 = tail call i32 @do_csi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void f_void() {}


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

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

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

LLVM IR (-O2):
define void @f_void() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_conflict(char *kind, int *conflict) {
  if (!*conflict) {
    printf("  CONFLICT (before precedence and associativity)\n");
    *conflict = 1;
  }
  printf("\t%s conflict ", kind);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_conflict>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1145 <print_conflict+0x35>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rsi
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_conflict>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpl   $0x0,(%rsi)
jne    1151 <print_conflict+0x21>
mov    %rsi,%rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,(%rbx)
lea    0xea8(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [50 x i8] c" CONFLICT (before precedence and associativity)\0A\00"
@.str.1 = [14 x i8] c"\09%s conflict \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_conflict(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%10 = load i32*, i32** %4
store i32 1, i32* %10
br label %11
11: ; preds = %8, %2
%12 = load i8*, i8** %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"\09%s conflict \00"
@str = [49 x i8] c" CONFLICT (before precedence and associativity)\00"
define void @print_conflict(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
store i32 1, i32* %1
br label %7
7: ; preds = %5, %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x4f() {
  Assert_real((isalnum(79)),
              "/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_isalnum.c",
              400, ("isalnum should be 1 for O"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x4f>:
push   %rax
mov    $0x4f,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x190,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for O\00"
define void @t_isalnum_0x4f() {
%1 = call i32 @isalnum(i32 79)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for O\00"
define void @t_isalnum_0x4f() {
%1 = tail call i32 @isalnum(i32 79)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ifc_reset_connections(const char *ifname) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ifc_reset_connections(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void justquit(int signum) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @justquit(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_11uint8_mem(unsigned char *val) {
  return ((*val) & (-0x11 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_11uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -17
%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_11uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -17
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void dump_IO_Response(char *buffer, int length, int offset) {}


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

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

LLVM IR (-O0):
define void @dump_IO_Response(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
ret void
}

LLVM IR (-O2):
define void @dump_IO_Response(i8* nocapture %0, i32 %1, i32 %2) {
ret void
}
int isSorted(int arr[], int length) {
  int i;
  for (i = 0; i < length - 1; i++) {
    if (arr[i] > arr[i + 1])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isSorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1163 <isSorted+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1150 <isSorted+0x50>
movl   $0x0,-0x4(%rbp)
jmp    116a <isSorted+0x6a>
jmp    1155 <isSorted+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isSorted+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSorted>:
add    $0xffffffff,%esi
xor    %eax,%eax
test   %esi,%esi
cmovle %eax,%esi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
je     1128 <isSorted+0x28>
mov    (%rdi,%rax,4),%ecx
lea    0x1(%rax),%rdx
cmp    0x4(%rdi,%rax,4),%ecx
mov    %rdx,%rax
jle    1110 <isSorted+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isSorted(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = call i32 @llvm.smax.i32(i32 %3, i32 0)
%5 = zext i32 %4 to i64
br label %6
6: ; preds = %9, %2
%7 = phi i64 [ %12, %9 ], [ 0, %2 ]
%8 = icmp eq i64 %7, %5
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = getelementptr inbounds i32, i32* %0, i64 %7
%11 = load i32, i32* %10
%12 = add nuw nsw i64 %7, 1
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp sgt i32 %11, %14
br i1 %15, label %16, label %6
16: ; preds = %6, %9
%17 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ UARTBaseValid(unsigned long);
void UARTDisable(unsigned long ulBase) {
  DEBUG_ASSERT(UARTBaseValid(ulBase));
  while ((*((volatile unsigned long *)(ulBase + 0x00000018))) & 0x00000008) {
  }
  (*((volatile unsigned long *)(ulBase + 0x0000002C))) &= ~(0x00000010);
  (*((volatile unsigned long *)(ulBase + 0x00000030))) &=
      ~(0x00000001 | 0x00000100 | 0x00000200);
}


x86 assembly (clang, -O0):
<UARTDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x8,%rax
cmp    $0x0,%rax
je     1157 <UARTDisable+0x37>
jmp    113c <UARTDisable+0x1c>
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%rcx
and    $0xffffffffffffffef,%rcx
mov    %rcx,0x2c(%rax)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xfffffffffffffcfe,%rcx
mov    %rcx,0x30(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <UARTBaseValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
testq  $0x8,0x18(%rbx)
jne    1130 <UARTDisable+0x10>
andq   $0xffffffffffffffef,0x2c(%rbx)
andq   $0xfffffffffffffcfe,0x30(%rbx)
ff
pop    %rbx
ret

LLVM IR (-O0):
define void @UARTDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @UARTBaseValid(i64 %3)
%5 = call i32 @DEBUG_ASSERT(i32 %4)
br label %6
6: ; preds = %13, %1
%7 = load i64, i64* %2
%8 = add i64 %7, 24
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 8
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
br label %6
14: ; preds = %6
%15 = load i64, i64* %2
%16 = add i64 %15, 44
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = and i64 %18, -17
store volatile i64 %19, i64* %17
%20 = load i64, i64* %2
%21 = add i64 %20, 48
%22 = inttoptr i64 %21 to i64*
%23 = load volatile i64, i64* %22
%24 = and i64 %23, -770
store volatile i64 %24, i64* %22
ret void
}

LLVM IR (-O2):
define void @UARTDisable(i64 %0) {
%2 = tail call i32 @UARTBaseValid(i64 %0)
%3 = tail call i32 @DEBUG_ASSERT(i32 %2)
%4 = add i64 %0, 24
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %1
%7 = load volatile i64, i64* %5
%8 = and i64 %7, 8
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = add i64 %0, 44
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, -17
store volatile i64 %14, i64* %12
%15 = add i64 %0, 48
%16 = inttoptr i64 %15 to i64*
%17 = load volatile i64, i64* %16
%18 = and i64 %17, -770
store volatile i64 %18, i64* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  printf("%d \n %d \n", a * a, a * a * a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d \0A %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
size_t small_secondary_hash(size_t pos) { return 1; }


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

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

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

LLVM IR (-O2):
define i64 @small_secondary_hash(i64 %0) {
ret i64 1
}
/* Variables and functions */
int reg_read32(int);
int /*<<< orphan*/ reg_write8(int, char);
void uart_putc(char c) {
  while (reg_read32(0x16000018) & (1 << 5))
    ;
  reg_write8(0x16000000, c);
}


x86 assembly (clang, -O0):
<uart_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x16000018,%edi
call   1030 <reg_read32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     1149 <uart_putc+0x29>
jmp    112e <uart_putc+0xe>
mov    $0x16000000,%edi
movsbl -0x1(%rbp),%esi
call   1040 <reg_write8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_putc>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x16000018,%edi
call   1030 <reg_read32@plt>
test   $0x20,%al
jne    1130 <uart_putc+0x10>
movsbl %bl,%esi
mov    $0x16000000,%edi
pop    %rbx
jmp    1040 <reg_write8@plt>

LLVM IR (-O0):
define void @uart_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 @reg_read32(i32 369098776)
%5 = and i32 %4, 32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
%10 = call i32 @reg_write8(i32 369098752, i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @uart_putc(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @reg_read32(i32 369098776)
%4 = and i32 %3, 32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @reg_write8(i32 369098752, i8 signext %0)
ret void
}
const char *_basename(const char *path) {
  int i = 0;
  int last_slash = 0;
  while (path[i]) {
    if (path[i] == '/')
      last_slash = i;
    i++;
  }
  return &path[last_slash + 1];
}


x86 assembly (clang, -O0):
<_basename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1151 <_basename+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1143 <_basename+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <_basename+0x16>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_basename>:
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1116 <_basename+0x16>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x2f,%dl
je     1110 <_basename+0x10>
test   %dl,%dl
jne    1112 <_basename+0x12>
movslq %ecx,%rax
add    %rdi,%rax
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @_basename(i8* %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 47, label %7
]
7: ; preds = %2
%8 = trunc i64 %3 to i32
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = add nsw i32 %4, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
ret i8* %15
}
void opt_update(unsigned int timestamp) {}


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

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

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

LLVM IR (-O2):
define void @opt_update(i32 %0) {
ret void
}
void sdl_audiosys_init(int def_buflen) {}


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

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

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

LLVM IR (-O2):
define void @sdl_audiosys_init(i32 %0) {
ret void
}
/* Variables and functions */
int js0n(unsigned char *, int, unsigned short *, int);
int strlen(char const *);
char *j0g(const char *json, unsigned short *index, int ilen) {
  int ret, len;
  if (!json)
    return NULL;
  len = strlen(json);
  ret = js0n((unsigned char *)json, len, index, ilen);
  if (ret)
    *index = 0;
  return (char *)json;
}


x86 assembly (clang, -O0):
<j0g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <j0g+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1188 <j0g+0x68>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <js0n@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1180 <j0g+0x60>
mov    -0x18(%rbp),%rax
movw   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j0g>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1152 <j0g+0x32>
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
mov    %ebp,%ecx
call   1040 <js0n@plt>
test   %eax,%eax
je     1152 <j0g+0x32>
movw   $0x0,(%r14)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @j0g(i8* %0, i16* %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @js0n(i8* %0, i32 %6, i16* %1, i32 %2)
%8 = icmp eq i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %5
store i16 0, i16* %1
br label %10
10: ; preds = %5, %9, %3
ret i8* %0
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  int m, n;
  scanf("%d %d", &m, &n);
  printf("%d\n", gcd(m, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1050 <gcd@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t soft_timer_ticks_to_ms(int32_t ticks) {
  return (((int64_t)ticks) * 1000) / 32768;
}


x86 assembly (clang, -O0):
<soft_timer_ticks_to_ms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%eax
mov    $0x8000,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_timer_ticks_to_ms>:
imul   $0x3e8,%edi,%ecx
lea    0x7fff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @soft_timer_ticks_to_ms(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = sdiv i32 %4, 32768
ret i32 %5
}

LLVM IR (-O2):
define i32 @soft_timer_ticks_to_ms(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = sdiv i32 %2, 32768
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
int /*<<< orphan*/ ft_putdigit_fd(long long, int);
void ft_putnbr_fd(int n, int fd) {
  long long ncp;
  ncp = (long long)n;
  if (ncp < 0) {
    ft_putchar_fd('-', fd);
    ncp = -ncp;
  }
  ft_putdigit_fd(ncp, fd);
}


x86 assembly (clang, -O0):
<ft_putnbr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1158 <ft_putnbr_fd+0x38>
mov    -0x8(%rbp),%esi
mov    $0x2d,%edi
call   1040 <ft_putchar_fd@plt>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <ft_putdigit_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
movslq %edi,%rbx
test   %ebx,%ebx
jns    113b <ft_putnbr_fd+0x1b>
mov    $0x2d,%edi
mov    %ebp,%esi
call   1040 <ft_putchar_fd@plt>
neg    %rbx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <ft_putdigit_fd@plt>

LLVM IR (-O0):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 @ft_putchar_fd(i8 signext 45, i32 %11)
%13 = load i64, i64* %5
%14 = sub nsw i64 0, %13
store i64 %14, i64* %5
br label %15
15: ; preds = %10, %2
%16 = load i64, i64* %5
%17 = load i32, i32* %4
%18 = call i32 @ft_putdigit_fd(i64 %16, i32 %17)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr_fd(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = icmp slt i32 %0, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @ft_putchar_fd(i8 signext 45, i32 %1)
%7 = sub nsw i64 0, %3
br label %8
8: ; preds = %5, %2
%9 = phi i64 [ %7, %5 ], [ %3, %2 ]
%10 = tail call i32 @ft_putdigit_fd(i64 %9, i32 %1)
ret void
}
/* Variables and functions */
int pipe(int *);
int create_pipe(int handles[2]) { return pipe(handles); }


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

x86 assembly (clang, -O2):
<create_pipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @create_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(void *);
void *print(void *arg) {
  int *n = (int *)arg;
  printf("Thread = %d\n", *n);
  int i, j;
  for (i = 0; i < 50000; i++)
    j += i;
  pthread_exit((void *)2);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xc350,-0x1c(%rbp)
jge    1171 <print+0x51>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <print+0x2d>
mov    $0x2,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Thread = %d\0A\00"
define noalias i8* @print(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i8* inttoptr (i64 2 to i8*))
ret i8* undef
}
void XkbSetDetectableAutoRepeat() {}


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

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

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

LLVM IR (-O2):
define void @XkbSetDetectableAutoRepeat() {
ret void
}