xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ a4;
};
typedef TYPE_1__ xfrm_address_t;

/* Variables and functions */
unsigned int ntohl(scalar_t__);
unsigned int __xfrm4_daddr_saddr_hash(xfrm_address_t *daddr,
                                      xfrm_address_t *saddr) {
  return ntohl(daddr->a4 + saddr->a4);
}


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

x86 assembly (clang, -O2):
<__xfrm4_daddr_saddr_hash>:
mov    (%rsi),%rax
add    (%rdi),%rax
mov    %rax,%rdi
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64 }
define i32 @__xfrm4_daddr_saddr_hash(%struct.TYPE_4__* nocapture %0, %struct.TYPE_4__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %6, %4
%8 = tail call i32 @ntohl(i64 %7)
ret i32 %8
}
unsigned int get_uint32be(unsigned char *p) {
  return ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}


x86 assembly (clang, -O0):
<get_uint32be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_uint32be(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
void XClearArea() {}


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

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

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

LLVM IR (-O2):
define void @XClearArea() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ qinit_heap();
void initialise_benchmark(void) { qinit_heap(); }


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

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

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

LLVM IR (-O2):
define void @initialise_benchmark() {
%1 = tail call i32 (...) @qinit_heap()
ret void
}
char *langDbgDevIdeGide() { return "GIDE"; }


x86 assembly (clang, -O0):
<langDbgDevIdeGide>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<langDbgDevIdeGide>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"GIDE\00"
define i8* @langDbgDevIdeGide() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"GIDE\00"
define i8* @langDbgDevIdeGide() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void resetArr(int length, char *source) {
  for (int i = 0; i < length; ++i) {
    source[i] = 0;
  }
}


x86 assembly (clang, -O0):
<resetArr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <resetArr+0x38>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <resetArr+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetArr>:
test   %edi,%edi
jle    1125 <resetArr+0x15>
push   %rax
mov    %edi,%edx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @resetArr(i32 %0, i8* nocapture writeonly %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %2
ret void
}
int test_imm_D3int8_reg(signed char val) {
  return ((val) & (0xD3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D3int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 211
%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_D3int8_reg(i8 signext %0) {
%2 = and i8 %0, -45
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double computePayment();
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  printf("Monthly payment: $%.2f\n", computePayment());
  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 <computePayment@plt>
lea    0xebc(%rip),%rdi
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 <computePayment@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Monthly payment: $%.2f\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 = call double (...) @computePayment()
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Monthly payment: $%.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double (...) @computePayment()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %3)
ret i32 0
}
int comp_float(double *ptr1, double *ptr2) {
  if (*ptr1 < *ptr2)
    return (-1);
  if (*ptr1 > *ptr2)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<comp_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <comp_float+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <comp_float+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <comp_float+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <comp_float+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_float>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_float(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
void restore_stdout(int saved_stdout) {
  if (saved_stdout) {
    dup2(saved_stdout, 1);
    close(saved_stdout);
  }
}


x86 assembly (clang, -O0):
<restore_stdout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <restore_stdout+0x2a>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_stdout>:
test   %edi,%edi
je     1139 <restore_stdout+0x19>
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1030 <dup2@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
ret

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

LLVM IR (-O2):
define void @restore_stdout(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @dup2(i32 %0, i32 1)
%5 = tail call i32 @close(i32 %0)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void vrc3setParamsF000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0((val & 7) << 14);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%edi
and    $0x7,%edi
shl    $0xe,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @vrc3setParamsF000(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = and i32 %6, 7
%8 = shl i32 %7, 14
%9 = call i32 @prg16setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @vrc3setParamsF000(i32 %0, i32 %1) {
%3 = shl i32 %1, 14
%4 = and i32 %3, 114688
%5 = tail call i32 @prg16setBank0(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ data_packing(int, int);
void brightness_7219(int brightnessLevel) {
  data_packing(0x0A, brightnessLevel);
}


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

x86 assembly (clang, -O2):
<brightness_7219>:
mov    %edi,%esi
mov    $0xa,%edi
jmp    1030 <data_packing@plt>

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

LLVM IR (-O2):
define void @brightness_7219(i32 %0) {
%2 = tail call i32 @data_packing(i32 10, i32 %0)
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memset(char *, char, int);
const char *genspaces(int i) {
  char *str = malloc((i + 1) * sizeof(char));
  memset(str, ' ', i);
  str[i] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<genspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    $0x20,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genspaces>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
lea    0x1(%r14),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x20,%esi
mov    %r14d,%edx
call   1030 <memset@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @genspaces(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = trunc i64 %7 to i32
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i32, i32* %2
%12 = call i32 @memset(i8* %10, i8 signext 32, i32 %11)
%13 = load i8*, i8** %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
define i8* @genspaces(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i8* @malloc(i32 %2)
%4 = tail call i32 @memset(i8* %3, i8 signext 32, i32 %0)
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
store i8 0, i8* %6
ret i8* %3
}
int main() {
  func1();
  func2();
  printf("debug: "
         "%s:%d: "
         "return to %p"
         "\n",
         __func__, 22, __builtin_return_address(0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <func1@plt>
mov    $0x0,%al
call   1050 <func2@plt>
mov    0x8(%rbp),%rcx
lea    0xea8(%rip),%rdi
lea    0xebd(%rip),%rsi
mov    $0x16,%edx
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
xor    %eax,%eax
call   1050 <func2@plt>
mov    0x8(%rsp),%rcx
lea    0xeb5(%rip),%rdi
lea    0xeca(%rip),%rsi
mov    $0x16,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"debug: %s:%d: return to %p\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @func1()
%3 = call i32 (...) @func2()
%4 = call i8* @llvm.returnaddress(i32 0)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 22, i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"debug: %s:%d: return to %p\0A\00"
@__func__.main = [5 x i8] c"main\00"
define i32 @main() {
%1 = tail call i32 (...) @func1()
%2 = tail call i32 (...) @func2()
%3 = tail call i8* @llvm.returnaddress(i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__func__.main, i64 0, i64 0), i32 22, i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void foo(void) { fprintf(stderr, "foo\n"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"foo\0A\00"
define void @foo() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"foo\0A\00"
define void @foo() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_append_mixed_cell(int n, int r, int k, int labels[],
                             double *normal) {
  int d[3], fail;
  d[0] = r;
  d[1] = n;
  d[2] = k;
  fail = _ada_use_c2phc4c(93, d, labels, normal, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_append_mixed_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x5d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_append_mixed_cell>:
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x5d,%edi
mov    %rcx,%rdx
mov    %r8,%rcx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @celcon_append_mixed_cell(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double*
%11 = alloca [3 x i32]
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store double* %4, double** %10
%13 = load i32, i32* %7
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
store i32 %15, i32* %16
%17 = load i32, i32* %8
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%20 = load i32*, i32** %9
%21 = load double*, double** %10
%22 = call i32 @_ada_use_c2phc4c(i32 93, i32* %19, i32* %20, double* %21, i32 0)
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
define i32 @celcon_append_mixed_cell(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %2, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 93, i32* %8, i32* %3, double* %4, i32 0)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ oops(char *);
void *realloc(void *, int);
void *myrealloc(void *oldp, size_t len) {
  void *p;
  if (len)
    p = realloc(oldp, len);
  else
    p = realloc(oldp, 1);
  if (p == NULL)
    oops("Out of memory.");
  return p;
}


x86 assembly (clang, -O0):
<myrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <myrealloc+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1165 <myrealloc+0x45>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117c <myrealloc+0x5c>
lea    0xe89(%rip),%rdi
call   1030 <oops@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrealloc>:
push   %rbx
test   %rsi,%rsi
mov    $0x1,%eax
cmove  %eax,%esi
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1145 <myrealloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <oops@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory.\00"
define i8* @myrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = call i8* @realloc(i8* %9, i32 %11)
store i8* %12, i8** %5
br label %16
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i8* @realloc(i8* %14, i32 1)
store i8* %15, i8** %5
br label %16
16: ; preds = %13, %8
%17 = load i8*, i8** %5
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @oops(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19, %16
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory.\00"
define i8* @myrealloc(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = trunc i64 %1 to i32
%5 = select i1 %3, i32 1, i32 %4
%6 = tail call i8* @realloc(i8* %0, i32 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @oops(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i8* %6
}
int atrshmlog_version() { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @atrshmlog_version() {
ret i32 1
}
void batohs(unsigned short *dest, unsigned char *src) {
  *dest = src[1] * 0x100 + src[0];
}


x86 assembly (clang, -O0):
<batohs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<batohs>:
movzwl (%rsi),%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @batohs(i16* %0, i8* %1) {
%3 = alloca i16*
%4 = alloca i8*
store i16* %0, i16** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = mul nsw i32 %8, 256
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = add nsw i32 %9, %13
%15 = trunc i32 %14 to i16
%16 = load i16*, i16** %3
store i16 %15, i16* %16
ret void
}

LLVM IR (-O2):
define void @batohs(i16* nocapture writeonly %0, i8* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = load i8, i8* %1
%8 = zext i8 %7 to i16
%9 = or i16 %6, %8
store i16 %9, i16* %0
ret void
}
long SBRK(incr)
long *incr;
{
  char *sbrk();
  return ((long)sbrk(*incr));
}


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

x86 assembly (clang, -O2):
<SBRK>:
mov    (%rdi),%rdi
xor    %eax,%eax
jmp    1030 <sbrk@plt>

LLVM IR (-O0):
define i64 @SBRK(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i8* (i64, ...) bitcast (i8* (...)* @sbrk to i8* (i64, ...)*)(i64 %4)
%6 = ptrtoint i8* %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @SBRK(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i8* (i64, ...) bitcast (i8* (...)* @sbrk to i8* (i64, ...)*)(i64 %2)
%4 = ptrtoint i8* %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(void) {
  sleep(180);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb4,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sleep(i32 180)
ret i32 0
}
int any(char c, char *str) {
  while (*str != '\0')
    if (*str++ == c)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<any>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <any+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <any+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1154 <any+0x54>
jmp    110e <any+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <any+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <any>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @any(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
struct lrt_trans {
  int dummy;
};

/* Variables and functions */
struct lrt_trans *lrt_trans_id2gt(int /*<<< orphan*/);
int /*<<< orphan*/ lrt_trans_lt2id(struct lrt_trans *);
struct lrt_trans *lrt_trans_lt2gt(struct lrt_trans *lt) {
  return lrt_trans_id2gt(lrt_trans_lt2id(lt));
}


x86 assembly (clang, -O0):
<lrt_trans_lt2gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <lrt_trans_lt2id@plt>
mov    %eax,%edi
call   1040 <lrt_trans_id2gt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrt_trans_lt2gt>:
push   %rax
call   1030 <lrt_trans_lt2id@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lrt_trans_id2gt@plt>

LLVM IR (-O0):
%struct.lrt_trans = type { i32 }
define %struct.lrt_trans* @lrt_trans_lt2gt(%struct.lrt_trans* %0) {
%2 = alloca %struct.lrt_trans*
store %struct.lrt_trans* %0, %struct.lrt_trans** %2
%3 = load %struct.lrt_trans*, %struct.lrt_trans** %2
%4 = call i32 @lrt_trans_lt2id(%struct.lrt_trans* %3)
%5 = call %struct.lrt_trans* @lrt_trans_id2gt(i32 %4)
ret %struct.lrt_trans* %5
}

LLVM IR (-O2):
%struct.lrt_trans = type { i32 }
define %struct.lrt_trans* @lrt_trans_lt2gt(%struct.lrt_trans* %0) {
%2 = tail call i32 @lrt_trans_lt2id(%struct.lrt_trans* %0)
%3 = tail call %struct.lrt_trans* @lrt_trans_id2gt(i32 %2)
ret %struct.lrt_trans* %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void breaker() { exit(0); }


x86 assembly (clang, -O0):
<breaker>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @breaker() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @breaker() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void pluscconlysa(unsigned short a, unsigned short b) {
  unsigned short sum = a + b;
  if (sum < a)
    abort();
}


x86 assembly (clang, -O0):
<pluscconlysa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    114b <pluscconlysa+0x3b>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pluscconlysa>:
add    %si,%di
jb     1116 <pluscconlysa+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @pluscconlysa(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %5
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = load i16, i16* %3
%15 = zext i16 %14 to i32
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @pluscconlysa(i16 zeroext %0, i16 zeroext %1) {
%3 = xor i16 %0, -1
%4 = icmp ult i16 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}
int testBit_fun_char(char x, unsigned i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_char>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @testBit_fun_char(i8 signext %0, i32 %1) {
%3 = sext i8 %0 to i32
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int f285(int *);
int f286(int *p) { return f285(p); }


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

x86 assembly (clang, -O2):
<f286>:
jmp    1030 <f285@plt>

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

LLVM IR (-O2):
define i32 @f286(i32* %0) {
%2 = tail call i32 @f285(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int cmp_less_int16(const void *p, const void *q) {
  const int16_t a = *(const int16_t *)p;
  const int16_t b = *(const int16_t *)q;
  if (a > b)
    return +1;
  if (b > a)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_less_int16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113c <cmp_less_int16+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    115d <cmp_less_int16+0x5d>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1156 <cmp_less_int16+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp_less_int16+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_less_int16>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
xor    %edx,%edx
cmp    %rax,%rcx
setg   %dl
neg    %edx
cmp    %rcx,%rax
mov    $0x1,%eax
cmovle %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_less_int16(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = icmp sgt i64 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_exist(char *file) {
  struct stat s;
  return stat(file, &s) ? 0 : 1;
}


x86 assembly (clang, -O0):
<file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exist(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void adis16203_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @adis16203_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ shellcode();
int main(int iArgCount, char **asArgs) {
  shellcode();
  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   1030 <shellcode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @shellcode()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @shellcode()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int private_AES_set_decrypt_key(unsigned char const *, int const,
                                int /*<<< orphan*/ *);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
                        AES_KEY *key) {
  return private_AES_set_decrypt_key(userKey, bits, key);
}


x86 assembly (clang, -O0):
<AES_set_decrypt_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <private_AES_set_decrypt_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AES_set_decrypt_key>:
jmp    1030 <private_AES_set_decrypt_key@plt>

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

LLVM IR (-O2):
define i32 @AES_set_decrypt_key(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @private_AES_set_decrypt_key(i8* %0, i32 %1, i32* %2)
ret i32 %4
}
void Sound_SoundList_f(void) {}


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

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

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

LLVM IR (-O2):
define void @Sound_SoundList_f() {
ret void
}
/* Variables and functions */
int peek32(int);
unsigned int xburst_cgm_lpcr_pd_scpu_is_down() {
  return (peek32((0xB0000000 + 0x4)) & (1 << 31));
}


x86 assembly (clang, -O0):
<xburst_cgm_lpcr_pd_scpu_is_down>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000004,%edi
call   1030 <peek32@plt>
and    $0x80000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_lpcr_pd_scpu_is_down>:
push   %rax
mov    $0xb0000004,%edi
call   1030 <peek32@plt>
and    $0x80000000,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xburst_cgm_lpcr_pd_scpu_is_down() {
%1 = call i32 @peek32(i32 -1342177276)
%2 = and i32 %1, -2147483648
ret i32 %2
}

LLVM IR (-O2):
define i32 @xburst_cgm_lpcr_pd_scpu_is_down() {
%1 = tail call i32 @peek32(i32 -1342177276)
%2 = and i32 %1, -2147483648
ret i32 %2
}
/* Variables and functions */
int pretty_print_colour_state();
bool pretty_print_color_state(void) { return pretty_print_colour_state(); }


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

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

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

LLVM IR (-O2):
define i32 @pretty_print_color_state() {
%1 = tail call i32 (...) @pretty_print_colour_state()
ret i32 %1
}
double dt2mjd(date, time)
double date;
double time;
{
  double dj;
  double tsec;
  tsec = dt2ts(date, time);
  if (date == 0.0)
    dj = tsec / 86400.0;
  else
    dj = ts2jd(tsec);
  return (dj - 2400000.5);
}


x86 assembly (clang, -O0):
<dt2mjd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mov    $0x2,%al
call   1030 <dt2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    117f <dt2mjd+0x5f>
jp     117f <dt2mjd+0x5f>
movsd  -0x20(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1194 <dt2mjd+0x74>
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%al
call   1040 <ts2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe67(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt2mjd>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%al
call   1030 <dt2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
xorpd  %xmm1,%xmm1
movsd  (%rsp),%xmm2
ucomisd %xmm1,%xmm2
jne    114f <dt2mjd+0x2f>
jp     114f <dt2mjd+0x2f>
divsd  0xeb3(%rip),%xmm0
jmp    115d <dt2mjd+0x3d>
mov    $0x1,%al
call   1040 <ts2jd@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xea3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dt2mjd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %7, double %8)
%10 = sitofp i32 %9 to double
store double %10, double* %6
%11 = load double, double* %3
%12 = fcmp oeq double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %6
%15 = fdiv double %14, 8.640000e+04
store double %15, double* %5
br label %20
16: ; preds = %2
%17 = load double, double* %6
%18 = call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %17)
%19 = sitofp i32 %18 to double
store double %19, double* %5
br label %20
20: ; preds = %16, %13
%21 = load double, double* %5
%22 = fsub double %21, 0x41424F8040000000
ret double %22
}

LLVM IR (-O2):
define double @dt2mjd(double %0, double %1) {
%3 = tail call i32 (double, double, ...) bitcast (i32 (...)* @dt2ts to i32 (double, double, ...)*)(double %0, double %1)
%4 = sitofp i32 %3 to double
%5 = fcmp oeq double %0, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = fdiv double %4, 8.640000e+04
br label %11
8: ; preds = %2
%9 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2jd to i32 (double, ...)*)(double %4)
%10 = sitofp i32 %9 to double
br label %11
11: ; preds = %8, %6
%12 = phi double [ %7, %6 ], [ %10, %8 ]
%13 = fadd double %12, 0xC1424F8040000000
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ Continuation_cache_invalidate();
int /*<<< orphan*/ NonceKey_cache_invalidate();
int /*<<< orphan*/ ParsedPMinisock_cache_invalidate();
void StateCache_invalidate(void) {
  ParsedPMinisock_cache_invalidate();
  Continuation_cache_invalidate();
  NonceKey_cache_invalidate();
}


x86 assembly (clang, -O0):
<StateCache_invalidate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ParsedPMinisock_cache_invalidate@plt>
mov    $0x0,%al
call   1050 <Continuation_cache_invalidate@plt>
mov    $0x0,%al
call   1040 <NonceKey_cache_invalidate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StateCache_invalidate>:
push   %rax
xor    %eax,%eax
call   1030 <ParsedPMinisock_cache_invalidate@plt>
xor    %eax,%eax
call   1050 <Continuation_cache_invalidate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NonceKey_cache_invalidate@plt>

LLVM IR (-O0):
define void @StateCache_invalidate() {
%1 = call i32 (...) @ParsedPMinisock_cache_invalidate()
%2 = call i32 (...) @Continuation_cache_invalidate()
%3 = call i32 (...) @NonceKey_cache_invalidate()
ret void
}

LLVM IR (-O2):
define void @StateCache_invalidate() {
%1 = tail call i32 (...) @ParsedPMinisock_cache_invalidate()
%2 = tail call i32 (...) @Continuation_cache_invalidate()
%3 = tail call i32 (...) @NonceKey_cache_invalidate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putendl(char *str) {
  ft_putstr(str);
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
push   %rax
call   1040 <ft_putstr@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_putendl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @ft_putstr(i8* %3)
%5 = call i32 @ft_putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @ft_putendl(i8* %0) {
%2 = tail call i32 @ft_putstr(i8* %0)
%3 = tail call i32 @ft_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ swap3(int *, int *, int);
int main() {
  int a = 3, b = 4;
  swap3(&a, &b, 1);
  printf("a is %d\n", a);
  printf("b is %d\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1040 <swap3@plt>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x3,0x4(%rsp)
movl   $0x4,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x1,%edx
call   1040 <swap3@plt>
mov    0x4(%rsp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    (%rsp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"a is %d\0A\00"
@.str.1 = [9 x i8] c"b is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 3, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 4, i32* %2
%5 = call i32 @swap3(i32* %1, i32* %2, i32 1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}