xunge/DecIR huggingface dataset:
int compareFunction(void *first, void *second) {
  if (*(int *)first > *(int *)second || *(int *)first == *(int *)second) {
    return *(int *)first;
  } else {
    int tempVal = 0;
    tempVal = *(int *)first;
    *(int *)first = *(int *)second;
    *(int *)second = tempVal;
    return *(int *)first;
  }
}


x86 assembly (clang, -O0):
<compareFunction>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jg     1130 <compareFunction+0x30>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    113e <compareFunction+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116c <compareFunction+0x6c>
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareFunction>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
cmp    %ecx,%eax
jge    110e <compareFunction+0xe>
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @compareFunction(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = icmp sgt i32 %9, %12
br i1 %13, label %22, label %14
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %26
22: ; preds = %14, %2
%23 = load i8*, i8** %4
%24 = bitcast i8* %23 to i32*
%25 = load i32, i32* %24
store i32 %25, i32* %3
br label %41
26: ; preds = %14
store i32 0, i32* %6
%27 = load i8*, i8** %4
%28 = bitcast i8* %27 to i32*
%29 = load i32, i32* %28
store i32 %29, i32* %6
%30 = load i8*, i8** %5
%31 = bitcast i8* %30 to i32*
%32 = load i32, i32* %31
%33 = load i8*, i8** %4
%34 = bitcast i8* %33 to i32*
store i32 %32, i32* %34
%35 = load i32, i32* %6
%36 = load i8*, i8** %5
%37 = bitcast i8* %36 to i32*
store i32 %35, i32* %37
%38 = load i8*, i8** %4
%39 = bitcast i8* %38 to i32*
%40 = load i32, i32* %39
store i32 %40, i32* %3
br label %41
41: ; preds = %26, %22
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
define i32 @compareFunction(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %2
store i32 %6, i32* %3
store i32 %4, i32* %5
%9 = load i32, i32* %3
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %4, %2 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: cli host:port 0|1|q node\n");
  fprintf(stderr, "       cli host:port l\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: cli host:port 0|1|q node\0A\00"
@.str.1 = [24 x i8] c" cli host:port l\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: cli host:port 0|1|q node\0A\00"
@.str.1 = [24 x i8] c" cli host:port l\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *PHYSFS_getWriteDir();
int /*<<< orphan*/ printf(char *, char *);
int cmd_getwritedir(char *args) {
  printf("Write dir is [%s].\n", PHYSFS_getWriteDir());
  return (1);
}


x86 assembly (clang, -O0):
<cmd_getwritedir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <PHYSFS_getWriteDir@plt>
mov    %rax,%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getwritedir>:
push   %rax
xor    %eax,%eax
call   1040 <PHYSFS_getWriteDir@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Write dir is [%s].\0A\00"
define i32 @cmd_getwritedir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i8* (...) @PHYSFS_getWriteDir()
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [20 x i8] c"Write dir is [%s].\0A\00"
define i32 @cmd_getwritedir(i8* nocapture readnone %0) {
%2 = tail call i8* (...) @PHYSFS_getWriteDir()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int clear_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(154, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<clear_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x9a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_homotopy>:
mov    $0x9a,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @clear_homotopy() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 154, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @clear_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 154, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ start_routine(int /*<<< orphan*/);
int main(void) {
  start_routine(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @start_routine(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void ASRT_PrintBadTest(const char *testName, const char *fileName, int fileLine,
                       int exitCode) {
  printf("\n(b) %s %s:%d", testName, fileName, fileLine);
  printf("\n  Test returned %d, did you forget to use ASRT_FAIL ?", exitCode);
}


x86 assembly (clang, -O0):
<ASRT_PrintBadTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASRT_PrintBadTest>:
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0A(b) %s %s:%d\00"
@.str.1 = [55 x i8] c"\0A Test returned %d, did you forget to use ASRT_FAIL ?\00"
define void @ASRT_PrintBadTest(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i32 %11)
%13 = load i32, i32* %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0A(b) %s %s:%d\00"
@.str.1 = [55 x i8] c"\0A Test returned %d, did you forget to use ASRT_FAIL ?\00"
define void @ASRT_PrintBadTest(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ realloc(long *, unsigned int);
long *xrealloc(long *ptr, int size) {
  long *result = (long *)realloc(ptr, ((unsigned)size));
  if (result == ((long *)NULL)) {
    fatal("virtual memory exhausted");
  }
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <xrealloc+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xrealloc(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i64*
store i64* %0, i64** %3
store i32 %1, i32* %4
%6 = load i64*, i64** %3
%7 = load i32, i32* %4
%8 = call i64 @realloc(i64* %6, i32 %7)
%9 = inttoptr i64 %8 to i64*
store i64* %9, i64** %5
%10 = load i64*, i64** %5
%11 = icmp eq i64* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i64*, i64** %5
ret i64* %15
}

LLVM IR (-O2):
@.str = [25 x i8] c"virtual memory exhausted\00"
define i64* @xrealloc(i64* %0, i32 %1) {
%3 = tail call i64 @realloc(i64* %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
%8 = inttoptr i64 %3 to i64*
ret i64* %8
}
/* Variables and functions */
int /*<<< orphan*/ ChargeDelay_SaveConfig();
int /*<<< orphan*/ ChargeDelay_Stop();
void ChargeDelay_Sleep(void) {
  ChargeDelay_Stop();
  ChargeDelay_SaveConfig();
}


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

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

LLVM IR (-O0):
define void @ChargeDelay_Sleep() {
%1 = call i32 (...) @ChargeDelay_Stop()
%2 = call i32 (...) @ChargeDelay_SaveConfig()
ret void
}

LLVM IR (-O2):
define void @ChargeDelay_Sleep() {
%1 = tail call i32 (...) @ChargeDelay_Stop()
%2 = tail call i32 (...) @ChargeDelay_SaveConfig()
ret void
}
/* Variables and functions */
int DBL_MAX_EXP;
int maxexponentdbl_(double x) { return DBL_MAX_EXP; }


x86 assembly (clang, -O0):
<maxexponentdbl_>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxexponentdbl_>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@DBL_MAX_EXP = global i32 0
define i32 @maxexponentdbl_(double %0) {
%2 = load i32, i32* @DBL_MAX_EXP
ret i32 %2
}
int test_imm_9Buint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x9B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_9Buint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 155
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __ftrylockfile(FILE *stream) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__ftrylockfile(i32* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ isprint(int);
int iscntrl(int c) { return (!isprint(c)); }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isprint(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = tail call i32 @isprint(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void destr(void *unused) { puts("Key value destroyed"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Key value destroyed\00"
define void @destr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Key value destroyed\00"
define void @destr(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *get_str_from_srv();
int /*<<< orphan*/ wait_for_data();
char *get_data_str() {
  wait_for_data();
  return get_str_from_srv();
}


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

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

LLVM IR (-O0):
define i8* @get_data_str() {
%1 = call i32 (...) @wait_for_data()
%2 = call i8* (...) @get_str_from_srv()
ret i8* %2
}

LLVM IR (-O2):
define i8* @get_data_str() {
%1 = tail call i32 (...) @wait_for_data()
%2 = tail call i8* (...) @get_str_from_srv()
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
size_t stb_filelen(FILE *f) {
  size_t len;
  long pos;
  pos = ftell(f);
  fseek(f, 0, SEEK_END);
  len = (size_t)ftell(f);
  fseek(f, pos, SEEK_SET);
  return len;
}


x86 assembly (clang, -O0):
<stb_filelen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_filelen>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @stb_filelen(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %4
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %3
%12 = load i32*, i32** %2
%13 = load i64, i64* %4
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @stb_filelen(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
int ska_base64_encode_len(int len) { return ((len + 2) / 3 * 4) + 1; }


x86 assembly (clang, -O0):
<ska_base64_encode_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ska_base64_encode_len>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    0x1(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @ska_base64_encode_len(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 4
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ska_base64_encode_len(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = or i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dvector(double *v, int nl) { free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = bitcast double* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = bitcast double* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
extern void bcopy(char *a, char *b, int c) { memmove(b, a, c); }


x86 assembly (clang, -O0):
<bcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memmove(i8* %1, i8* %0, i32 %2)
ret void
}
unsigned int f52(unsigned int x, int y __attribute__((unused))) {
  return (x << 1) ^ (x >> (8 * 4 - 1));
}


x86 assembly (clang, -O0):
<f52>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1f,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f52(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 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = lshr i32 %7, 31
%9 = xor i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f52(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_symbols(int *n) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(293, n, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_symbols>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x125,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_symbols>:
mov    %rdi,%rsi
mov    $0x125,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_symbols(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 293, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_symbols(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 293, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetErrorHandler() {
  printf("XSetErrorHandler called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XSetErrorHandler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"XSetErrorHandler called\0A\00"
define i32 @XSetErrorHandler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [24 x i8] c"XSetErrorHandler called\00"
define i32 @XSetErrorHandler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *lp_get_var(int, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
int strlen(char const *);
char *lp_internal_sconfig(int chn, const char *name) {
  char *nm, *r;
  nm = (char *)malloc((strlen(name) + 2) * sizeof(char));
  sprintf(nm, "_%s", name);
  r = lp_get_var(chn, nm);
  free(nm);
  return r;
}


x86 assembly (clang, -O0):
<lp_internal_sconfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe75(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <lp_get_var@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lp_internal_sconfig>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
call   1050 <strlen@plt>
lea    0x2(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
lea    0xe8c(%rip),%rsi
mov    %rax,%rdi
mov    %rbx,%rdx
call   1070 <sprintf@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
call   1030 <lp_get_var@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"_%s\00"
define i8* @lp_internal_sconfig(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %8, 2
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%18 = load i32, i32* %3
%19 = load i8*, i8** %5
%20 = call i8* @lp_get_var(i32 %18, i8* %19)
store i8* %20, i8** %6
%21 = load i8*, i8** %5
%22 = call i32 @free(i8* %21)
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
@.str = [4 x i8] c"_%s\00"
define i8* @lp_internal_sconfig(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = tail call i8* @lp_get_var(i32 %0, i8* %6)
%9 = tail call i32 @free(i8* %6)
ret i8* %8
}
/* Type definitions */
struct rblists {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rb_closelist(struct rblists *);
void rbcloselist(struct rblists *rblistp) {
  if (rblistp == NULL) {
    return;
  }
  rb_closelist(rblistp);
}


x86 assembly (clang, -O0):
<rbcloselist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <rbcloselist+0x1c>
jmp    1135 <rbcloselist+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <rb_closelist@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rbcloselist>:
test   %rdi,%rdi
je     111a <rbcloselist+0xa>
jmp    1030 <rb_closelist@plt>
ret

LLVM IR (-O0):
%struct.rblists = type { i32 }
define void @rbcloselist(%struct.rblists* %0) {
%2 = alloca %struct.rblists*
store %struct.rblists* %0, %struct.rblists** %2
%3 = load %struct.rblists*, %struct.rblists** %2
%4 = icmp eq %struct.rblists* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.rblists*, %struct.rblists** %2
%8 = call i32 @rb_closelist(%struct.rblists* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.rblists = type { i32 }
define void @rbcloselist(%struct.rblists* %0) {
%2 = icmp eq %struct.rblists* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @rb_closelist(%struct.rblists* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_alphaTables();
void premultiply_init() { init_alphaTables(); }


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

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

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

LLVM IR (-O2):
define void @premultiply_init() {
%1 = tail call i32 (...) @init_alphaTables()
ret void
}
int __VERIFIER_nondet_int(void) {
  int i;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_int() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_alrm_h_cpuhogger(int sno) {
  printf("cpuhogger exiting\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_alrm_h_cpuhogger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_alrm_h_cpuhogger>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"cpuhogger exiting\0A\00"
define void @sig_alrm_h_cpuhogger(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"cpuhogger exiting\00"
define void @sig_alrm_h_cpuhogger(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
unsigned char VIM_USER_StopTimer();
unsigned char Avi_StopTimer(void) {
  unsigned char result = 0;
  result = VIM_USER_StopTimer();
  return result;
}


x86 assembly (clang, -O0):
<Avi_StopTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <VIM_USER_StopTimer@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @Avi_StopTimer() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call zeroext i8 (...) @VIM_USER_StopTimer()
store i8 %2, i8* %1
%3 = load i8, i8* %1
ret i8 %3
}

LLVM IR (-O2):
define zeroext i8 @Avi_StopTimer() {
%1 = tail call zeroext i8 (...) @VIM_USER_StopTimer()
ret i8 %1
}
/* Variables and functions */
int log(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x, y;
  scanf("%d", &x);
  printf("y=%d", y = log(3 * x - 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
imul   $0x3,-0x8(%rbp),%edi
sub    $0x6,%edi
call   1050 <log@plt>
mov    %eax,%esi
mov    %esi,-0xc(%rbp)
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
lea    (%rax,%rax,2),%edi
add    $0xfffffffa,%edi
call   1050 <log@plt>
lea    0xea8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"y=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, 3
%6 = add nsw i32 %5, -6
%7 = call i32 @log(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
float sqrt(float);
float DistanceBetween(int X1, int Y1, int X2, int Y2) {
  return sqrt((float)((X2 - X1) * (X2 - X1)) + ((Y2 - Y1) * (Y2 - Y1)));
}


x86 assembly (clang, -O0):
<DistanceBetween>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
imul   %ecx,%eax
cvtsi2ss %eax,%xmm1
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DistanceBetween>:
sub    %edi,%edx
imul   %edx,%edx
cvtsi2ss %edx,%xmm1
sub    %esi,%ecx
imul   %ecx,%ecx
cvtsi2ss %ecx,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1133 <DistanceBetween+0x23>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @DistanceBetween(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = sitofp i32 %15 to float
%17 = load i32, i32* %8
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
%23 = mul nsw i32 %19, %22
%24 = sitofp i32 %23 to float
%25 = fadd float %16, %24
%26 = call float @sqrt(float %25)
ret float %26
}

LLVM IR (-O2):
define float @DistanceBetween(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %0
%6 = mul nsw i32 %5, %5
%7 = sitofp i32 %6 to float
%8 = sub nsw i32 %3, %1
%9 = mul nsw i32 %8, %8
%10 = sitofp i32 %9 to float
%11 = fadd float %7, %10
%12 = tail call float @sqrt(float %11)
ret float %12
}
const char *decDoubleVersion(void) { return "decNumber 3.68"; }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"decNumber 3.68\00"
define i8* @decDoubleVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
char *getlogin() { return 0; }


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

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

LLVM IR (-O0):
define i8* @getlogin() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @getlogin() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x79() {
  Assert_real((iscntrl(121) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              610, ("iscntrl should be 0 for y"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x79>:
push   %rax
mov    $0x79,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for y\00"
define void @t_iscntrl_0x79() {
%1 = call i64 @iscntrl(i32 121)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for y\00"
define void @t_iscntrl_0x79() {
%1 = tail call i64 @iscntrl(i32 121)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, 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
}
void RTSgBufCmpEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSgBufCmpEx() {
ret void
}
int gcd(int a, int b) {
  int t;
  if (a < b) {
    t = a;
    a = b;
    b = t;
  }
  do {
    t = a % b;
    if (t == 0)
      break;
    a = b;
    b = t;
  } while (1);
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1146 <gcd+0x46>
jmp    1161 <gcd+0x61>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    112d <gcd+0x2d>
jmp    1161 <gcd+0x61>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
%5 = select i1 %3, i32 %0, i32 %1
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %8, %6 ]
%8 = phi i32 [ %5, %2 ], [ %9, %6 ]
%9 = srem i32 %7, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %8
}
int g(int month) { return month <= 2 ? month + 13 : month + 1; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     111f <g+0x1f>
mov    -0x4(%rbp),%eax
add    $0xd,%eax
mov    %eax,-0x8(%rbp)
jmp    1128 <g+0x28>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x1(%rdi),%ecx
lea    0xd(%rdi),%eax
cmp    $0x3,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 2
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 13
br label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp slt i32 %0, 3
%3 = select i1 %2, i32 13, i32 1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __srandom(unsigned int);
void srandom(unsigned seed) {
  {};
  __srandom(seed);
  {};
}


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

x86 assembly (clang, -O2):
<srandom>:
jmp    1030 <__srandom@plt>

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

LLVM IR (-O2):
define void @srandom(i32 %0) {
%2 = tail call i32 @__srandom(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void write_arr(int *a) { printf("%p", (void *)a); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define void @write_arr(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_TEST;
scalar_t__ lockf(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sys_error(char *, int);
void read_lock(int fd) {
  if (lockf(fd, F_TEST, 0) < 0)
    sys_error("lockf (LOCK) failed", 264);
}


x86 assembly (clang, -O0):
<read_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
cmp    $0x0,%rax
jge    1159 <read_lock+0x39>
lea    0xeb1(%rip),%rdi
mov    $0x108,%esi
call   1040 <sys_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_lock>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <lockf@plt>
test   %rax,%rax
js     1138 <read_lock+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
mov    $0x108,%esi
pop    %rax
jmp    1040 <sys_error@plt>

LLVM IR (-O0):
@F_TEST = global i32 0
@.str = [20 x i8] c"lockf (LOCK) failed\00"
define void @read_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_TEST
%5 = call i64 @lockf(i32 %3, i32 %4, i32 0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @sys_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 264)
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@F_TEST = global i32 0
@.str = [20 x i8] c"lockf (LOCK) failed\00"
define void @read_lock(i32 %0) {
%2 = load i32, i32* @F_TEST
%3 = tail call i64 @lockf(i32 %0, i32 %2, i32 0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @sys_error(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 264)
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int list_comparator_uint8_t(const void *a, const void *b) {
  return (*(uint8_t *)a < *(uint8_t *)b) - (*(uint8_t *)a > *(uint8_t *)b);
}


x86 assembly (clang, -O0):
<list_comparator_uint8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x10(%rbp),%rdx
cmp    (%rdx),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_comparator_uint8_t>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setl   %al
setg   %dl
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @list_comparator_uint8_t(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 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp slt i64 %7, %10
%12 = zext i1 %11 to i32
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
%16 = load i8*, i8** %4
%17 = bitcast i8* %16 to i64*
%18 = load i64, i64* %17
%19 = icmp sgt i64 %15, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @list_comparator_uint8_t(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 slt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}