xunge/DecIR huggingface dataset:
int isJnumber(char chr) {
  return ((chr >= '0' && chr <= '9') || chr == '-' || chr == '.' ||
          chr == '+' || chr == 'e' || chr == 'E');
}


x86 assembly (clang, -O0):
<isJnumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <isJnumber+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    117e <isJnumber+0x7e>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     117e <isJnumber+0x7e>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     117e <isJnumber+0x7e>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     117e <isJnumber+0x7e>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x65,%ecx
mov    %al,-0x2(%rbp)
je     117e <isJnumber+0x7e>
movsbl -0x1(%rbp),%eax
cmp    $0x45,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isJnumber>:
lea    -0x30(%rdi),%ecx
mov    $0x1,%eax
cmp    $0xa,%cl
jb     1128 <isJnumber+0x28>
lea    -0x2b(%rdi),%ecx
cmp    $0x3a,%cl
ja     1129 <isJnumber+0x29>
movzbl %cl,%ecx
movabs $0x40000000000000d,%rdx
bt     %rcx,%rdx
jae    1129 <isJnumber+0x29>
ret
xor    %eax,%eax
cmp    $0x45,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isJnumber(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %30, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 46
br i1 %17, label %30, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 43
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 101
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 69
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6
%31 = phi i1 [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @isJnumber(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %8, label %4
4: ; preds = %1
switch i8 %0, label %5 [
i8 101, label %8
i8 46, label %8
i8 45, label %8
i8 43, label %8
]
5: ; preds = %4
%6 = icmp eq i8 %0, 69
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %4, %4, %4, %1, %5
%9 = phi i32 [ %7, %5 ], [ 1, %4 ], [ 1, %1 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ]
ret i32 %9
}
sumcurves(dx11, dy11, dx12, dy12, dx13, dy13, dx21, dy21, dx22, dy22, dx23,
          dy23) {}


x86 assembly (clang, -O0):
<sumcurves>:
push   %rbp
mov    %rsp,%rbp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sumcurves(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i32 %0, i32* %14
store i32 %1, i32* %15
store i32 %2, i32* %16
store i32 %3, i32* %17
store i32 %4, i32* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
%26 = load i32, i32* %13
ret i32 %26
}

LLVM IR (-O2):
define i32 @sumcurves(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
ret i32 undef
}
void foo_2_1_2_1_2_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_1_2_1_1_1_1() {
ret void
}
int main(void) {
  int ten = 10, twenty = 20;
  return (ten == ten) + (twenty == twenty) + (twenty == ten);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0xc(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
cmp    -0x8(%rbp),%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
%12 = add nsw i32 %7, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
%17 = add nsw i32 %12, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
void RTLockValidatorRecSharedRemoveOwner(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo580() {
ret void
}
void outportb(unsigned port, unsigned val) {
  asm volatile("outb %b0, %w1" : : "a"(val), "d"(port));
}


x86 assembly (clang, -O0):
<outportb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%edx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outportb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

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

LLVM IR (-O2):
define void @outportb(i32 %0, i32 %1) {
tail call void asm sideeffect "outb ${0:b}, ${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret void
}
void q_clear(unsigned char *table, int pos) {
  table[pos >> 3] &= ~(1 << (pos & 7));
}


x86 assembly (clang, -O0):
<q_clear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_clear>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
sar    $0x3,%esi
movslq %esi,%rcx
not    %al
and    %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @q_clear(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 = and i32 %5, 7
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = ashr i32 %10, 3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, %8
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
ret void
}

LLVM IR (-O2):
define void @q_clear(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = ashr i32 %1, 3
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = xor i8 %9, -1
%11 = and i8 %8, %10
store i8 %11, i8* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AtmegaCompareP__0__AtmegaCounter__overflow();
int /*<<< orphan*/ AtmegaCompareP__1__AtmegaCounter__overflow();
int /*<<< orphan*/ AtmegaCounterP__0__AtmegaCounter__overflow();
void HplAtmRfa1TimerMacP__Counter__overflow(void) {
  AtmegaCompareP__1__AtmegaCounter__overflow();
  AtmegaCompareP__0__AtmegaCounter__overflow();
  AtmegaCounterP__0__AtmegaCounter__overflow();
}


x86 assembly (clang, -O0):
<HplAtmRfa1TimerMacP__Counter__overflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <AtmegaCompareP__1__AtmegaCounter__overflow@plt>
mov    $0x0,%al
call   1050 <AtmegaCompareP__0__AtmegaCounter__overflow@plt>
mov    $0x0,%al
call   1040 <AtmegaCounterP__0__AtmegaCounter__overflow@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HplAtmRfa1TimerMacP__Counter__overflow>:
push   %rax
xor    %eax,%eax
call   1030 <AtmegaCompareP__1__AtmegaCounter__overflow@plt>
xor    %eax,%eax
call   1050 <AtmegaCompareP__0__AtmegaCounter__overflow@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <AtmegaCounterP__0__AtmegaCounter__overflow@plt>

LLVM IR (-O0):
define void @HplAtmRfa1TimerMacP__Counter__overflow() {
%1 = call i32 (...) @AtmegaCompareP__1__AtmegaCounter__overflow()
%2 = call i32 (...) @AtmegaCompareP__0__AtmegaCounter__overflow()
%3 = call i32 (...) @AtmegaCounterP__0__AtmegaCounter__overflow()
ret void
}

LLVM IR (-O2):
define void @HplAtmRfa1TimerMacP__Counter__overflow() {
%1 = tail call i32 (...) @AtmegaCompareP__1__AtmegaCounter__overflow()
%2 = tail call i32 (...) @AtmegaCompareP__0__AtmegaCounter__overflow()
%3 = tail call i32 (...) @AtmegaCounterP__0__AtmegaCounter__overflow()
ret void
}
/* Variables and functions */
int add_two(int);
int /*<<< orphan*/ fib(int);
int /*<<< orphan*/ mut_rec1(int);
int /*<<< orphan*/ printf(char *, int);
int subtract_two(int);
int main() {
  fib(10);
  printf("%d\n", add_two(1000));
  printf("%d\n", subtract_two(10));
  mut_rec1(10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1060 <fib@plt>
mov    $0x3e8,%edi
call   1050 <add_two@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <subtract_two@plt>
mov    %eax,%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1070 <mut_rec1@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1060 <fib@plt>
mov    $0x3e8,%edi
call   1050 <add_two@plt>
lea    0xe94(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1040 <subtract_two@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1070 <mut_rec1@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @fib(i32 10)
%2 = call i32 @add_two(i32 1000)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @subtract_two(i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @mut_rec1(i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 10)
%2 = tail call i32 @add_two(i32 1000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @subtract_two(i32 10)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @mut_rec1(i32 10)
ret i32 0
}
/* Variables and functions */
char *malloc(unsigned long);
int sfd_strlen(char const *);
char *sfd_strdup(const char *s) {
  int i, sl = sfd_strlen(s);
  char *s2 = malloc((unsigned long)(sl + 1));
  for (i = 0; i <= sl; i++)
    s2[i] = s[i];
  return s2;
}


x86 assembly (clang, -O0):
<sfd_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sfd_strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1181 <sfd_strdup+0x61>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1151 <sfd_strdup+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfd_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <sfd_strlen@plt>
mov    %eax,%ebx
lea    0x1(%rbx),%eax
movslq %eax,%rdi
call   1050 <malloc@plt>
mov    %rax,%r15
test   %ebx,%ebx
js     1162 <sfd_strdup+0x32>
mov    %ebx,%edx
add    $0x1,%rdx
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <memcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define noalias i8* @sfd_strdup(i8* %0) {
%2 = tail call i32 @sfd_strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp slt i32 %2, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = zext i32 %2 to i64
%9 = add nuw nsw i64 %8, 1
br label %10
10: ; preds = %7, %1
ret i8* %5
}
void gdk_x11_screen_get_screen_number() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_screen_get_screen_number() {
ret void
}
/* Variables and functions */
int mp3edit_indexfile_get_stats(void *);
int mpgedit_edit_index_get_stats(void *ifctx) {
  return mp3edit_indexfile_get_stats(ifctx);
}


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

x86 assembly (clang, -O2):
<mpgedit_edit_index_get_stats>:
jmp    1030 <mp3edit_indexfile_get_stats@plt>

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

LLVM IR (-O2):
define i32 @mpgedit_edit_index_get_stats(i8* %0) {
%2 = tail call i32 @mp3edit_indexfile_get_stats(i8* %0)
ret i32 %2
}
/* Variables and functions */
int baz();
int bar(void) { return baz(); }


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @baz()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @baz()
ret i32 %1
}
/* Variables and functions */
char *compress(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  if (argc == 1) {
    printf("Usage: %s STRING\n", argv[0]);
    return 1;
  }
  printf("%s\n", compress(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1182 <main+0x62>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <compress@plt>
mov    %rax,%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1030 <compress@plt>
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s STRING\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 1, i32* %3
br label %19
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i8* @compress(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %13, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s STRING\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %12
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i8* @compress(i8* %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %7, %4
%13 = phi i32 [ 1, %4 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
unsigned long special_field_exponent_bits(unsigned long);
signed long dfp128_exponent(unsigned long dword1) {
  unsigned long exponent_left;
  unsigned long exponent_right;
  unsigned long biased_exponent;
  signed long exponent;
  exponent_left = special_field_exponent_bits(dword1);
  exponent_right = (dword1 & 0x03ffc00000000000);
  biased_exponent = (exponent_left << 12) + (exponent_right >> 46);
  exponent = biased_exponent - 6176;
  return exponent;
}


x86 assembly (clang, -O0):
<dfp128_exponent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <special_field_exponent_bits@plt>
mov    %rax,-0x10(%rbp)
movabs $0x3ffc00000000000,%rax
c0 ff 03
and    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0xc,%rax
mov    -0x18(%rbp),%rcx
shr    $0x2e,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    $0x1820,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfp128_exponent>:
push   %rbx
mov    %rdi,%rbx
call   1030 <special_field_exponent_bits@plt>
shl    $0xc,%rax
shr    $0x2e,%rbx
and    $0xfff,%ebx
add    %rbx,%rax
add    $0xffffffffffffe7e0,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @dfp128_exponent(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = call i64 @special_field_exponent_bits(i64 %7)
store i64 %8, i64* %3
%9 = load i64, i64* %2
%10 = and i64 %9, 288160007407534080
store i64 %10, i64* %4
%11 = load i64, i64* %3
%12 = shl i64 %11, 12
%13 = load i64, i64* %4
%14 = lshr i64 %13, 46
%15 = add i64 %12, %14
store i64 %15, i64* %5
%16 = load i64, i64* %5
%17 = sub i64 %16, 6176
store i64 %17, i64* %6
%18 = load i64, i64* %6
ret i64 %18
}

LLVM IR (-O2):
define i64 @dfp128_exponent(i64 %0) {
%2 = tail call i64 @special_field_exponent_bits(i64 %0)
%3 = shl i64 %2, 12
%4 = lshr i64 %0, 46
%5 = and i64 %4, 4095
%6 = add nuw nsw i64 %5, -6176
%7 = add i64 %6, %3
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char const *, char const *);
void check_str(const char *s, const char *target) {
  if (strcmp(s, target) == 0)
    printf("==> success\n");
  else
    printf("==> failure\n");
}


x86 assembly (clang, -O0):
<check_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1158 <check_str+0x38>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <check_str+0x44>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_str>:
push   %rax
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xedc(%rip),%rax
lea    0xec9(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"==> success\0A\00"
@.str.1 = [13 x i8] c"==> failure\0A\00"
define void @check_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"==> failure\00"
@str.2 = [12 x i8] c"==> success\00"
define void @check_str(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ zword(int /*<<< orphan*/);
uint16_t read16(uint32_t address) { return zword(address); }


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

x86 assembly (clang, -O2):
<read16>:
jmp    1030 <zword@plt>

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

LLVM IR (-O2):
define i32 @read16(i32 %0) {
%2 = tail call i32 @zword(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ Ttl_TPM_PhysicalEnable();
uint32_t TtlSetEnable(void) {
  do {
  } while (0);
  return Ttl_TPM_PhysicalEnable();
}


x86 assembly (clang, -O0):
<TtlSetEnable>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <TtlSetEnable+0x9>
jmp    111e <TtlSetEnable+0xe>
mov    $0x0,%al
call   1030 <Ttl_TPM_PhysicalEnable@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @TtlSetEnable() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
%3 = call i32 (...) @Ttl_TPM_PhysicalEnable()
ret i32 %3
}

LLVM IR (-O2):
define i32 @TtlSetEnable() {
%1 = tail call i32 (...) @Ttl_TPM_PhysicalEnable()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ do_error(char const *);
void mp2_940_tester(int iTrue, const char *cpszMsg) {
  if (!iTrue) {
    do_error(cpszMsg);
    for (;;)
      ;
  }
}


x86 assembly (clang, -O0):
<mp2_940_tester>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1137 <mp2_940_tester+0x27>
mov    -0x10(%rbp),%rdi
call   1030 <do_error@plt>
jmp    1132 <mp2_940_tester+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2_940_tester>:
test   %edi,%edi
je     1115 <mp2_940_tester+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <do_error@plt>
add    $0x8,%rsp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
jmp    1130 <mp2_940_tester+0x20>

LLVM IR (-O0):
define void @mp2_940_tester(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 ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @do_error(i8* %8)
br label %10
10: ; preds = %10, %7
br label %10
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @mp2_940_tester(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @do_error(i8* %1)
br label %6
6: ; preds = %6, %4
br label %6
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int num1 = 5, num2 = 6, sum;
  sum = num1 + num2;
  printf("The sum of %d and %d is %d", num1, num2, sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"The sum of %d and %d is %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 5, i32 6, i32 11)
ret i32 0
}
int fesetround(int round) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @fesetround(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x79() {
  Assert_real((isprint(121)),
              "/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_isprint.c",
              610, ("isprint should be 1 for y"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x79>:
push   %rax
mov    $0x79,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x262,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for y\00"
define void @t_isprint_0x79() {
%1 = call i32 @isprint(i32 121)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for y\00"
define void @t_isprint_0x79() {
%1 = tail call i32 @isprint(i32 121)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double currentime() {
  double res = 0;
  struct timeval tv;
  if (!gettimeofday(&tv, 0))
    res = 1e-6 * tv.tv_usec, res += tv.tv_sec;
  return res;
}


x86 assembly (clang, -O0):
<currentime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%eax
jne    115a <currentime+0x4a>
cvtsi2sdl -0x18(%rbp),%xmm1
movsd  0xebf(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xorps  %xmm0,%xmm0
test   %eax,%eax
je     112c <currentime+0x1c>
add    $0x18,%rsp
ret
cvtsi2sdl 0x8(%rsp),%xmm1
mulsd  0xec6(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define double @currentime() {
%1 = alloca double
%2 = alloca %struct.timeval
store double 0.000000e+00, double* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = icmp ne i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double 0x3EB0C6F7A0B5ED8D, %8
store double %9, double* %1
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = load double, double* %1
%14 = fadd double %13, %12
store double %14, double* %1
br label %15
15: ; preds = %5, %0
%16 = load double, double* %1
ret double %16
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define double @currentime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 0x3EB0C6F7A0B5ED8D
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = fadd double %9, %12
br label %14
14: ; preds = %5, %0
%15 = phi double [ 0.000000e+00, %0 ], [ %13, %5 ]
ret double %15
}
void java_io_File_oneTimeInitialization__() {}


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

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

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

LLVM IR (-O2):
define void @java_io_File_oneTimeInitialization__() {
ret void
}
void f(int x) {
  if (x > 2) {
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    1116 <f+0x16>
jmp    1116 <f+0x16>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void test2(void *dead) {
  sleep(2000000);
  printf("test2\n");
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1e8480,%edi
call   1040 <sleep@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
mov    $0x1e8480,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test2\0A\00"
define void @test2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @sleep(i32 2000000)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"test2\00"
define void @test2(i8* nocapture readnone %0) {
%2 = tail call i32 @sleep(i32 2000000)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((visibility("hidden"))) int get_return_code(void) { return 0; }


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

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

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

LLVM IR (-O2):
define hidden i32 @get_return_code() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ os_info();
int /*<<< orphan*/ printf(char *, int, int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  os_info();
  printf(", "
         "GCC %d.%d.%d",
         9, 4, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <os_info@plt>
lea    0xebc(%rip),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <os_info@plt>
lea    0xed1(%rip),%rdi
mov    $0x9,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c", GCC %d.%d.%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @os_info()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 9, i32 4, i32 0)
ret i32 0
}
void f4_2(void) { extern char x10; }


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @init_blocksize() {
ret void
}
/* Variables and functions */
int part(int *, int, int);
void qsort(int array[], int start, int end) {
  int m;
  m = part(array, start, end);
  if (start < m - 1)
    qsort(array, start, m - 1);
  if (m < end)
    qsort(array, m, end);
}


x86 assembly (clang, -O0):
<qsort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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
call   1040 <part@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1167 <qsort+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <qsort@plt>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <qsort+0x62>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <qsort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r14
jmp    1147 <qsort+0x27>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ebp
cmp    %r15d,%ebx
jge    1169 <qsort+0x49>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
call   1040 <part@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
cmp    %ebp,%edx
jle    1140 <qsort+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <qsort@plt>
jmp    1140 <qsort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @qsort(i32* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %10, %3
%5 = phi i32 [ %1, %3 ], [ %6, %10 ]
%6 = tail call i32 @part(i32* %0, i32 %5, i32 %2)
%7 = add nsw i32 %6, -1
%8 = icmp sgt i32 %7, %5
br i1 %8, label %9, label %10
9: ; preds = %4
tail call void @qsort(i32* %0, i32 %5, i32 %7)
br label %10
10: ; preds = %9, %4
%11 = icmp slt i32 %6, %2
br i1 %11, label %4, label %12
12: ; preds = %10
ret void
}
char *strchr(const char *p, int ch) {
  char c;
  c = ch;
  for (;; ++p) {
    if (*p == c)
      return ((char *)p);
    if (*p == '\0')
      return (0);
  }
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x15(%rbp),%ecx
cmp    %ecx,%eax
jne    1131 <strchr+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1164 <strchr+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <strchr+0x4e>
movq   $0x0,-0x8(%rbp)
jmp    1164 <strchr+0x64>
jmp    1153 <strchr+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strchr+0x11>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %12, %8, %2
%18 = phi i8* [ %0, %2 ], [ null, %8 ], [ %13, %12 ]
ret i8* %18
}
/* Variables and functions */
int expect_pointer_sum(void *(*f)(void *, int)) {
  return f(NULL, 0xDEAD) == (void *)0xDEAD;
}


x86 assembly (clang, -O0):
<expect_pointer_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
mov    $0xdead,%esi
call   *-0x8(%rbp)
mov    $0xdead,%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_pointer_sum>:
push   %rax
mov    %rdi,%rax
xor    %edi,%edi
mov    $0xdead,%esi
call   *%rax
xor    %ecx,%ecx
cmp    $0xdead,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @expect_pointer_sum(i8* (i8*, i32)* %0) {
%2 = alloca i8* (i8*, i32)*
store i8* (i8*, i32)* %0, i8* (i8*, i32)** %2
%3 = load i8* (i8*, i32)*, i8* (i8*, i32)** %2
%4 = call i8* %3(i8* null, i32 57005)
%5 = icmp eq i8* %4, inttoptr (i64 57005 to i8*)
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @expect_pointer_sum(i8* (i8*, i32)* nocapture %0) {
%2 = tail call i8* %0(i8* null, i32 57005)
%3 = icmp eq i8* %2, inttoptr (i64 57005 to i8*)
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int ldub_p(const void *ptr) { return *(uint8_t *)ptr; }


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

x86 assembly (clang, -O2):
<ldub_p>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @ldub_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
double gvprfw(long index) {
  extern double *fwork;
  return *(fwork + index);
}


x86 assembly (clang, -O0):
<gvprfw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gvprfw>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%rax
movsd  (%rax,%rdi,8),%xmm0
ret

LLVM IR (-O0):
@fwork = external global double*
define double @gvprfw(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load double*, double** @fwork
%4 = load i64, i64* %2
%5 = getelementptr inbounds double, double* %3, i64 %4
%6 = load double, double* %5
ret double %6
}

LLVM IR (-O2):
@fwork = external global double*
define double @gvprfw(i64 %0) {
%2 = load double*, double** @fwork
%3 = getelementptr inbounds double, double* %2, i64 %0
%4 = load double, double* %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void throw(const char *message) {
  perror(message);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<throw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<throw>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @throw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @throw(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int errno;
void plexlog_posix_errno_set(int e) { errno = e; }


x86 assembly (clang, -O0):
<plexlog_posix_errno_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ecf(%rip),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<plexlog_posix_errno_set>:
mov    0x2ed9(%rip),%rax
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
@errno = global i32 0
define void @plexlog_posix_errno_set(i32 %0) {
store i32 %0, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
void yyerror(char *s) { error("Parser gives %s", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Parser gives %s\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Parser gives %s\00"
define void @yyerror(i8* %0) {
%2 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}