xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void tcp_waiting_handle() {
  printf("tcp waitting handle\n");
  sleep(1);
}


x86 assembly (clang, -O0):
<tcp_waiting_handle>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"tcp waitting handle\0A\00"
define void @tcp_waiting_handle() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"tcp waitting handle\00"
define void @tcp_waiting_handle() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ interface();
int benchmark(void) {
  interface();
  FH_DU();
  return 0;
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1040 <FH_DU@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %rax
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1040 <FH_DU@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @benchmark() {
%1 = call i32 (...) @interface()
%2 = call i32 (...) @FH_DU()
ret i32 0
}

LLVM IR (-O2):
define i32 @benchmark() {
%1 = tail call i32 (...) @interface()
%2 = tail call i32 (...) @FH_DU()
ret i32 0
}
void fn1(int p1) {}


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

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

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

LLVM IR (-O2):
define void @fn1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("glean, by Scott Vokes\n"
       "usage: gln [-h] [-vgnNsDH] [-d db_path] QUERY\n"
       "where QUERY can include AND, OR, or NOT\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [109 x i8] c"glean, by Scott Vokes\0Ausage: gln [-h] [-vgnNsDH] [-d db_path] QUERY\0Awhere QUERY can include AND, OR, or NOT\0A\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [109 x i8] c"glean, by Scott Vokes\0Ausage: gln [-h] [-vgnNsDH] [-d db_path] QUERY\0Awhere QUERY can include AND, OR, or NOT\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("Enter a number\n");
  scanf("%d", &x);
  printf("Number = %d\n", x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a number\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Number = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"Number = %d\0A\00"
@str = [15 x i8] c"Enter a number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, unsigned long);
unsigned char mem_copy_from_offset(void *src, unsigned long src_offset,
                                   char *bytes, unsigned long len) {
  memcpy((void *)bytes, (void *)(((char *)src) + src_offset), len);
  return (1);
}


x86 assembly (clang, -O0):
<mem_copy_from_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_copy_from_offset>:
push   %rax
add    %rdi,%rsi
mov    %rdx,%rdi
mov    %rcx,%rdx
call   1030 <memcpy@plt>
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @mem_copy_from_offset(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = getelementptr inbounds i8, i8* %10, i64 %11
%13 = load i64, i64* %8
%14 = call i32 @memcpy(i8* %9, i8* %12, i64 %13)
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @mem_copy_from_offset(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 %1
%6 = tail call i32 @memcpy(i8* %2, i8* %5, i64 %3)
ret i8 1
}
void delayms(unsigned int ms) {
  unsigned int x, y;
  for (y = ms; y > 0; y--) {
    for (x = 227; x > 0; x--)
      ;
  }
}


x86 assembly (clang, -O0):
<delayms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    114e <delayms+0x4e>
movl   $0xe3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    113b <delayms+0x3b>
jmp    112d <delayms+0x2d>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    111e <delayms+0x1e>
jmp    1140 <delayms+0x40>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110d <delayms+0xd>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delayms(i32 %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void QEIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000028))) = ui32IntFlags;
}


x86 assembly (clang, -O0):
<QEIIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x28(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIIntClear>:
mov    %rsi,0x28(%rdi)
ret

LLVM IR (-O0):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %6, 40
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 40
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
struct S1 {
  int i;
  int j;
} * f1() {
  ;
}


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

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

LLVM IR (-O0):
%struct.S1 = type { i32, i32 }
define %struct.S1* @f1() {
%1 = alloca %struct.S1*
%2 = load %struct.S1*, %struct.S1** %1
ret %struct.S1* %2
}

LLVM IR (-O2):
%struct.S1 = type { i32, i32 }
define noalias %struct.S1* @f1() {
ret %struct.S1* undef
}
/* Variables and functions */
char *strstr(char const *, char const *);
long indexOf(const char *str, const char *substr) {
  char *dest = strstr(str, substr);
  long pos;
  if (dest) {
    pos = dest - str;
  } else
    return (-1);
  if (pos >= 0)
    return (pos);
  else
    return (-1);
}


x86 assembly (clang, -O0):
<indexOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1150 <indexOf+0x40>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    115d <indexOf+0x4d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    117d <indexOf+0x6d>
cmpq   $0x0,-0x28(%rbp)
jl     1175 <indexOf+0x65>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117d <indexOf+0x6d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexOf>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
mov    $0xffffffffffffffff,%rdx
cmovns %rcx,%rdx
cmp    $0x1,%rax
sbb    %rax,%rax
or     %rdx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @indexOf(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = icmp sgt i64 %7, -1
%9 = select i1 %8, i64 %7, i64 -1
%10 = select i1 %4, i64 -1, i64 %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void LibTomFree(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<LibTomFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @LibTomFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ble_default(const void *v) {}


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

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

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

LLVM IR (-O2):
define void @ble_default(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct cmd {
  int dummy;
};

/* Variables and functions */
struct cmd *parsepipe(char **, char *);
struct cmd *parseline(char **ps, char *es) {
  struct cmd *cmd;
  cmd = parsepipe(ps, es);
  return cmd;
}


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

x86 assembly (clang, -O2):
<parseline>:
jmp    1030 <parsepipe@plt>

LLVM IR (-O0):
%struct.cmd = type { i32 }
define %struct.cmd* @parseline(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca %struct.cmd*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %4
%8 = call %struct.cmd* @parsepipe(i8** %6, i8* %7)
store %struct.cmd* %8, %struct.cmd** %5
%9 = load %struct.cmd*, %struct.cmd** %5
ret %struct.cmd* %9
}

LLVM IR (-O2):
%struct.cmd = type { i32 }
define %struct.cmd* @parseline(i8** %0, i8* %1) {
%3 = tail call %struct.cmd* @parsepipe(i8** %0, i8* %1)
ret %struct.cmd* %3
}
/* Variables and functions */
int f450(int *);
int f451(int *p) { return f450(p); }


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

x86 assembly (clang, -O2):
<f451>:
jmp    1030 <f450@plt>

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

LLVM IR (-O2):
define i32 @f451(i32* %0) {
%2 = tail call i32 @f450(i32* %0)
ret i32 %2
}
int test_imm_31uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x31 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_31uint64_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, 49
%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_31uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 49
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double atan(double);
double acot(double x) { return atan(1.0 / x); }


x86 assembly (clang, -O0):
<acot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1030 <atan@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acot>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @acot(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = call double @atan(double %4)
ret double %5
}

LLVM IR (-O2):
define double @acot(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = tail call double @atan(double %2)
ret double %3
}
void foo038(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo038(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addToTree(char *);
int /*<<< orphan*/ dequeueList();
int /*<<< orphan*/ peekList();
int /*<<< orphan*/ reportError(char);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int colon() {
  if (strcmp(peekList(), ":") != 0) {
    reportError(':');
    return 0;
  }
  dequeueList();
  addToTree(":");
  return 1;
}


x86 assembly (clang, -O0):
<colon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <peekList@plt>
mov    %eax,%edi
lea    0xe98(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     118d <colon+0x3d>
mov    $0x3a,%edi
call   1030 <reportError@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a7 <colon+0x57>
mov    $0x0,%al
call   1070 <dequeueList@plt>
lea    0xe65(%rip),%rdi
call   1050 <addToTree@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<colon>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1060 <peekList@plt>
lea    0xe9f(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1179 <colon+0x29>
mov    $0x3a,%edi
call   1030 <reportError@plt>
jmp    1191 <colon+0x41>
xor    %eax,%eax
call   1070 <dequeueList@plt>
lea    0xe79(%rip),%rdi
call   1050 <addToTree@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
define i32 @colon() {
%1 = alloca i32
%2 = call i32 (...) @peekList()
%3 = call i64 @strcmp(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @reportError(i8 signext 58)
store i32 0, i32* %1
br label %10
7: ; preds = %0
%8 = call i32 (...) @dequeueList()
%9 = call i32 @addToTree(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
define i32 @colon() {
%1 = tail call i32 (...) @peekList()
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @reportError(i8 signext 58)
br label %9
6: ; preds = %0
%7 = tail call i32 (...) @dequeueList()
%8 = tail call i32 @addToTree(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %10
}
void illegal_except() {}


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

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

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

LLVM IR (-O2):
define void @illegal_except() {
ret void
}
/* Variables and functions */
bool test_dummy() { return true; }


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

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

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

LLVM IR (-O2):
define i32 @test_dummy() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *string = "Hey man, what's up?";
  printf("%s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefc(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hey man, what's up?\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hey man, what's up?\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ketama_md5_digest(char *, unsigned char *);
unsigned int ketama_hashi(char *key) {
  unsigned char digest[16];
  ketama_md5_digest(key, digest);
  return (unsigned int)((digest[3] << 24) | (digest[2] << 16) |
                        (digest[1] << 8) | digest[0]);
}


x86 assembly (clang, -O0):
<ketama_hashi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <ketama_md5_digest@plt>
movzbl -0x1d(%rbp),%eax
shl    $0x18,%eax
movzbl -0x1e(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
movzbl -0x1f(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl -0x20(%rbp),%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ketama_hashi>:
sub    $0x18,%rsp
mov    %rsp,%rsi
call   1030 <ketama_md5_digest@plt>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @ketama_hashi(i8* %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @ketama_md5_digest(i8* %0, i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw i32 %7, 24
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = or i32 %13, %17
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("desert.in", "r", stdin);
  freopen("desert.out", "w+", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xecc(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
lea    0xed3(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"desert.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [11 x i8] c"desert.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"desert.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [11 x i8] c"desert.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ throw_message(char *, char const *, char const *);
void throw_error(char const *control_string, char const *parameter_string) {
  throw_message("ERROR: ", control_string, parameter_string);
  exit(1);
}


x86 assembly (clang, -O0):
<throw_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <throw_message@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<throw_error>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <throw_message@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR: \00"
define void @throw_error(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @throw_message(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR: \00"
define void @throw_error(i8* %0, i8* %1) {
%3 = tail call i32 @throw_message(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
char getDigit(char ch) {
  char num;
  if (ch <= '9' && ch >= '0')
    return ch - '0';
  num = ch - 'A';
  if (num > 15)
    num--;
  return num / 3 + 2;
}


x86 assembly (clang, -O0):
<getDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <getDigit+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <getDigit+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1164 <getDigit+0x64>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
cmp    $0xf,%eax
jle    1152 <getDigit+0x52>
mov    -0x3(%rbp),%al
add    $0xff,%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x2,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
jb     112f <getDigit+0x2f>
lea    -0x41(%rdi),%eax
add    $0xbe,%dil
cmp    $0x10,%al
movzbl %dil,%ecx
movzbl %al,%eax
cmovge %ecx,%eax
movsbl %al,%eax
imul   $0x56,%eax,%eax
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
shr    $0x8,%eax
add    %cl,%al
add    $0x2,%al
ret

LLVM IR (-O0):
define signext i8 @getDigit(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sle i32 %6, 57
br i1 %7, label %8, label %17
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 48
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %14, 48
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %34
17: ; preds = %8, %1
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = sub nsw i32 %19, 65
%21 = trunc i32 %20 to i8
store i8 %21, i8* %4
%22 = load i8, i8* %4
%23 = sext i8 %22 to i32
%24 = icmp sgt i32 %23, 15
br i1 %24, label %25, label %28
25: ; preds = %17
%26 = load i8, i8* %4
%27 = add i8 %26, -1
store i8 %27, i8* %4
br label %28
28: ; preds = %25, %17
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = sdiv i32 %30, 3
%32 = add nsw i32 %31, 2
%33 = trunc i32 %32 to i8
store i8 %33, i8* %2
br label %34
34: ; preds = %28, %12
%35 = load i8, i8* %2
ret i8 %35
}

LLVM IR (-O2):
define signext i8 @getDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i8 %0, -65
%6 = icmp sgt i8 %5, 15
%7 = add i8 %0, -66
%8 = select i1 %6, i8 %7, i8 %5
%9 = sdiv i8 %8, 3
%10 = add nsw i8 %9, 2
br label %11
11: ; preds = %1, %4
%12 = phi i8 [ %10, %4 ], [ %2, %1 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int write(int, char *, int);
int make_block_bitmap(int fd, char *block_bitmap) {
  int ret_byte;
  ret_byte = write(fd, block_bitmap, 4096);
  printf("Block Bitmap End == %ld\n", lseek(fd, 0, SEEK_CUR));
  return 0;
}


x86 assembly (clang, -O0):
<make_block_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1000,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e8b(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <lseek@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_block_bitmap>:
push   %rbx
mov    %edi,%ebx
mov    $0x1000,%edx
call   1030 <write@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
xor    %esi,%esi
call   1050 <lseek@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Block Bitmap End == %ld\0A\00"
@SEEK_CUR = global i32 0
define i32 @make_block_bitmap(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @write(i32 %6, i8* %7, i32 4096)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* @SEEK_CUR
%11 = call i32 @lseek(i32 %9, i32 0, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Block Bitmap End == %ld\0A\00"
@SEEK_CUR = global i32 0
define i32 @make_block_bitmap(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 4096)
%4 = load i32, i32* @SEEK_CUR
%5 = tail call i32 @lseek(i32 %0, i32 0, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((unused)) void tsx_stats() {
  fprintf(stderr, "No tsx stats recorded\n");
}


x86 assembly (clang, -O0):
<tsx_stats>:
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):
<tsx_stats>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"No tsx stats recorded\0A\00"
define void @tsx_stats() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_2(int, char *, unsigned long);
void extern_func1_1(int a, char *b, unsigned long c) {
  extern_func1_2(a, b, c);
}


x86 assembly (clang, -O0):
<extern_func1_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <extern_func1_2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_func1_1>:
jmp    1030 <extern_func1_2@plt>

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

LLVM IR (-O2):
define void @extern_func1_1(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_2(i32 %0, i8* %1, i64 %2)
ret void
}
int setupper(ch, val)
char *ch;
char *val;
{ return (*val & 255); }


x86 assembly (clang, -O0):
<setupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupper>:
movzbl (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @setupper(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 255
ret i32 %8
}

LLVM IR (-O2):
define i32 @setupper(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}
cbuf36(f, n) int f, n;
{ cbuf(f, n, 36); }


x86 assembly (clang, -O0):
<cbuf36>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x24,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf36>:
mov    $0x24,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf36(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 36)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf36(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 36)
ret i32 undef
}
int GetUserAuth(const char *Username, const char *Password) { return -1; }


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

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

LLVM IR (-O0):
define i32 @GetUserAuth(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @GetUserAuth(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
scalar_t__ strlen(char const *);
char *iupStrDup(const char *str) {
  if (str) {
    int size = (int)strlen(str) + 1;
    char *newstr = malloc(size);
    if (newstr)
      memcpy(newstr, str, size);
    return newstr;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<iupStrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118a <iupStrDup+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117d <iupStrDup+0x4d>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1192 <iupStrDup+0x62>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrDup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1166 <iupStrDup+0x36>
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%rbx
add    $0x1,%ebx
mov    %ebx,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1166 <iupStrDup+0x36>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
jmp    1169 <iupStrDup+0x39>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @iupStrDup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = trunc i64 %4 to i32
%6 = add nsw i32 %5, 1
%7 = tail call i8* @malloc(i32 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %6)
br label %11
11: ; preds = %1, %3, %9
%12 = phi i8* [ %7, %9 ], [ null, %3 ], [ null, %1 ]
ret i8* %12
}
/* Variables and functions */
scalar_t__ sin(double);
float sinf(float x) { return ((float)sin((double)x)); }


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

x86 assembly (clang, -O2):
<sinf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sin(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sin(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x9a() {
  Assert_real((isodigit(154) == 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_isodigit.c",
              775, ("isodigit should be 0 for 0x9a"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x9a>:
push   %rax
mov    $0x9a,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x307,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9a\00"
define void @t_isodigit_0x9a() {
%1 = call i64 @isodigit(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9a\00"
define void @t_isodigit_0x9a() {
%1 = tail call i64 @isodigit(i32 154)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 775, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ff_videodsp_init_arm() {}


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

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

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

LLVM IR (-O2):
define void @ff_videodsp_init_arm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LogDateTime();
int /*<<< orphan*/ printf(char *, char *, int, char *);
void LogMessageText(int status, char *message, int address, char *data) {
  LogDateTime();
  if (!status)
    printf("%s on %#02x to %s: error.\n", message, address, data);
  else
    printf("%s on %#02x to %s: done.\n", message, address, data);
}


x86 assembly (clang, -O0):
<LogMessageText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <LogDateTime@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1163 <LogMessageText+0x43>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <LogMessageText+0x5a>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LogMessageText>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <LogDateTime@plt>
test   %ebp,%ebp
lea    0xebe(%rip),%rax
lea    0xed2(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s on %x to %s: error.\0A\00"
@.str.1 = [26 x i8] c"%s on %x to %s: done.\0A\00"
define void @LogMessageText(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = call i32 (...) @LogDateTime()
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = load i8*, i8** %8
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i8* %15)
br label %22
17: ; preds = %4
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = load i8*, i8** %8
%21 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %19, i8* %20)
br label %22
22: ; preds = %17, %12
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s on %x to %s: error.\0A\00"
@.str.1 = [26 x i8] c"%s on %x to %s: done.\0A\00"
define void @LogMessageText(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 (...) @LogDateTime()
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* %7, i8* %1, i32 %2, i8* %3)
ret void
}
void replace_substring(char *s, char *t, char *w) { ; }


x86 assembly (clang, -O0):
<replace_substring>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @replace_substring(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @replace_substring(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void early_kprint(const char *str) { fprintf(stderr, "%s", str); }


x86 assembly (clang, -O0):
<early_kprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<early_kprint>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @early_kprint(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pbc_die(char *);
void *realloc(void *, size_t);
void *default_pbc_realloc(void *ptr, size_t size) {
  void *res = realloc(ptr, size);
  if (!res)
    pbc_die("realloc() error");
  return res;
}


x86 assembly (clang, -O0):
<default_pbc_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <default_pbc_realloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <pbc_die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"realloc() error\00"
define i8* @default_pbc_realloc(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 i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @pbc_die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [16 x i8] c"realloc() error\00"
define noalias i8* @default_pbc_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @pbc_die(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}