xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ClearAllCheats();
int /*<<< orphan*/ FreeCheatSearchMem();
int /*<<< orphan*/ FreeCheatSearchResults();
int /*<<< orphan*/ FreePPFCache();
int /*<<< orphan*/ psxShutdown();
void EmuShutdown() {
  ClearAllCheats();
  FreeCheatSearchResults();
  FreeCheatSearchMem();
  FreePPFCache();
  psxShutdown();
}


x86 assembly (clang, -O0):
<EmuShutdown>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ClearAllCheats@plt>
mov    $0x0,%al
call   1070 <FreeCheatSearchResults@plt>
mov    $0x0,%al
call   1050 <FreeCheatSearchMem@plt>
mov    $0x0,%al
call   1030 <FreePPFCache@plt>
mov    $0x0,%al
call   1060 <psxShutdown@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmuShutdown>:
push   %rax
xor    %eax,%eax
call   1040 <ClearAllCheats@plt>
xor    %eax,%eax
call   1070 <FreeCheatSearchResults@plt>
xor    %eax,%eax
call   1050 <FreeCheatSearchMem@plt>
xor    %eax,%eax
call   1030 <FreePPFCache@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <psxShutdown@plt>

LLVM IR (-O0):
define void @EmuShutdown() {
%1 = call i32 (...) @ClearAllCheats()
%2 = call i32 (...) @FreeCheatSearchResults()
%3 = call i32 (...) @FreeCheatSearchMem()
%4 = call i32 (...) @FreePPFCache()
%5 = call i32 (...) @psxShutdown()
ret void
}

LLVM IR (-O2):
define void @EmuShutdown() {
%1 = tail call i32 (...) @ClearAllCheats()
%2 = tail call i32 (...) @FreeCheatSearchResults()
%3 = tail call i32 (...) @FreeCheatSearchMem()
%4 = tail call i32 (...) @FreePPFCache()
%5 = tail call i32 (...) @psxShutdown()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ assume(int);
int rand();
void *thread(void *arg) {
  int x;
  int i;
  x = rand();
  assume(x > 0);
  i = 0;
  while (i < x) {
    i++;
  }
  assert(i == x);
  return NULL;
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assume@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1178 <thread+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <thread+0x2e>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rbx
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ebx
xor    %edi,%edi
test   %eax,%eax
setg   %dil
call   1040 <assume@plt>
not    %ebx
shr    $0x1f,%ebx
mov    %ebx,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 (...) @rand()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assume(i32 %8)
store i32 0, i32* %4
br label %10
10: ; preds = %14, %1
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %10
17: ; preds = %10
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = icmp eq i32 %18, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
%3 = icmp sgt i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assume(i32 %4)
%6 = xor i32 %2, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @assert(i32 %7)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_printBlockSection(int /*<<< orphan*/, int);
void DEBUG_printStart() { DEBUG_printBlockSection(0, 50); }


x86 assembly (clang, -O0):
<DEBUG_printStart>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x32,%esi
call   1030 <DEBUG_printBlockSection@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEBUG_printStart>:
xor    %edi,%edi
mov    $0x32,%esi
jmp    1030 <DEBUG_printBlockSection@plt>

LLVM IR (-O0):
define void @DEBUG_printStart() {
%1 = call i32 @DEBUG_printBlockSection(i32 0, i32 50)
ret void
}

LLVM IR (-O2):
define void @DEBUG_printStart() {
%1 = tail call i32 @DEBUG_printBlockSection(i32 0, i32 50)
ret void
}
void __attribute__((cold)) f4(int x) {
  register float f asm("%xmm3") = x;
  asm volatile("" ::"x"(f));
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm3
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
cvtsi2ss %edi,%xmm3
ret
cs nopw 0x0(%rax,%rax,1)
nop

LLVM IR (-O0):
define void @f4(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = load float, float* %3
ret void
}

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = sitofp i32 %0 to float
tail call void asm sideeffect "", "{xmm3},~{dirflag},~{fpsr},~{flags}"(float %2)
ret void
}
void glutInit(int *argc, char *argv[]) {}


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

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

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

LLVM IR (-O2):
define void @glutInit(i32* nocapture %0, i8** nocapture %1) {
ret void
}
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
int pool_new_strn(struct pool *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int pool_new_str(struct pool *p, const char *str) {
  return pool_new_strn(p, str, strlen(str));
}


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

x86 assembly (clang, -O2):
<pool_new_str>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <pool_new_strn@plt>

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

LLVM IR (-O2):
%struct.pool = type { i32 }
define i32 @pool_new_str(%struct.pool* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @pool_new_strn(%struct.pool* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
char *strcat(char *, char const *);
size_t xstr_len(char const *);
char *xstr_ncat(char *destination, const char *source,
                size_t destination_size) {
  size_t dst_len = xstr_len(destination);
  size_t src_len = xstr_len(source);
  if (dst_len + src_len >= destination_size) {
    return 0;
  }
  return strcat(destination, source);
}


x86 assembly (clang, -O0):
<xstr_ncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <xstr_len@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <xstr_len@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     116d <xstr_ncat+0x4d>
movq   $0x0,-0x8(%rbp)
jmp    117e <xstr_ncat+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcat@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstr_ncat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <xstr_len@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1030 <xstr_len@plt>
add    %r12,%rax
cmp    %r15,%rax
jae    1156 <xstr_ncat+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
jmp    1158 <xstr_ncat+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @xstr_ncat(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @xstr_len(i8* %0)
%5 = tail call i64 @xstr_len(i8* %1)
%6 = add i64 %5, %4
%7 = icmp ult i64 %6, %2
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i8* @strcat(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %10
10: ; preds = %3, %8
%11 = phi i8* [ %0, %8 ], [ null, %3 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int usage(char *prog) {
  fprintf(stderr, "usage: %s <basename>\n", prog);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s <basename>\0A\00"
define i32 @usage(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 ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"usage: %s <basename>\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void strv_print(char **l) {
  char **s;
  if (!l)
    return;
  for ((s) = (l); (s) && *(s); (s)++) {
    puts(*s);
  }
}


x86 assembly (clang, -O0):
<strv_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <strv_print+0x1c>
jmp    117f <strv_print+0x6f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1152 <strv_print+0x42>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1162 <strv_print+0x52>
jmp    117f <strv_print+0x6f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <strv_print+0x24>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_print>:
push   %rbx
test   %rdi,%rdi
je     1141 <strv_print+0x31>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <strv_print+0x31>
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <strv_print+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @strv_print(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = icmp ne i8** %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %25
7: ; preds = %1
%8 = load i8**, i8*** %2
store i8** %8, i8*** %3
br label %9
9: ; preds = %22, %7
%10 = load i8**, i8*** %3
%11 = icmp ne i8** %10, null
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = icmp ne i8* %14, null
br label %16
16: ; preds = %12, %9
%17 = phi i1 [ false, %9 ], [ %15, %12 ]
br i1 %17, label %18, label %25
18: ; preds = %16
%19 = load i8**, i8*** %3
%20 = load i8*, i8** %19
%21 = call i32 @puts(i8* %20)
br label %22
22: ; preds = %18
%23 = load i8**, i8*** %3
%24 = getelementptr inbounds i8*, i8** %23, i32 1
store i8** %24, i8*** %3
br label %9
25: ; preds = %6, %16
ret void
}

LLVM IR (-O2):
define void @strv_print(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %11, %6 ], [ %4, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = tail call i32 @puts(i8* %7)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printusage(void) {
  fprintf(stderr, "usage: tar [-ckxntv] [-f archive] [file]...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"usage: tar [-ckxntv] [-f archive] [file]...\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"usage: tar [-ckxntv] [-f archive] [file]...\0A\00"
define void @printusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
long double fabsd(long double x) { return (x < 0 ? -x : x); }


x86 assembly (clang, -O0):
<fabsd>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldz
fucomip %st(1),%st
fstp   %st(0)
jbe    112b <fabsd+0x2b>
jmp    111e <fabsd+0x1e>
fldt   -0x10(%rbp)
fchs
fstpt  -0x1c(%rbp)
jmp    1131 <fabsd+0x31>
fldt   -0x10(%rbp)
fstpt  -0x1c(%rbp)
fldt   -0x1c(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsd>:
fldt   0x8(%rsp)
fldz
fucomip %st(1),%st
fld    %st(0)
fchs
fxch   %st(1)
fcmovnbe %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fabsd(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp olt x86_fp80 %3, 0xK00000000000000000000
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load x86_fp80, x86_fp80* %2
%7 = fneg x86_fp80 %6
br label %10
8: ; preds = %1
%9 = load x86_fp80, x86_fp80* %2
br label %10
10: ; preds = %8, %5
%11 = phi x86_fp80 [ %7, %5 ], [ %9, %8 ]
ret x86_fp80 %11
}

LLVM IR (-O2):
define x86_fp80 @fabsd(x86_fp80 %0) {
%2 = fcmp olt x86_fp80 %0, 0xK00000000000000000000
%3 = fneg x86_fp80 %0
%4 = select i1 %2, x86_fp80 %3, x86_fp80 %0
ret x86_fp80 %4
}
/* Variables and functions */
int dyno_get_mass();
int /*<<< orphan*/ dyno_set_mass(int /*<<< orphan*/);
int /*<<< orphan*/ htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int cmd_dyno_mass(int argc, char **argv) {
  if (argc > 1)
    dyno_set_mass(htoi(argv[1]));
  else
    printf("mass: %d kg\n", dyno_get_mass());
  return (0);
}


x86 assembly (clang, -O0):
<cmd_dyno_mass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1172 <cmd_dyno_mass+0x32>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <htoi@plt>
mov    %eax,%edi
call   1050 <dyno_set_mass@plt>
jmp    1187 <cmd_dyno_mass+0x47>
mov    $0x0,%al
call   1030 <dyno_get_mass@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_dyno_mass>:
push   %rax
cmp    $0x2,%edi
jl     1158 <cmd_dyno_mass+0x18>
mov    0x8(%rsi),%rdi
call   1060 <htoi@plt>
mov    %eax,%edi
call   1050 <dyno_set_mass@plt>
jmp    116d <cmd_dyno_mass+0x2d>
xor    %eax,%eax
call   1030 <dyno_get_mass@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"mass: %d kg\0A\00"
define i32 @cmd_dyno_mass(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @htoi(i8* %10)
%12 = call i32 @dyno_set_mass(i32 %11)
br label %16
13: ; preds = %2
%14 = call i32 (...) @dyno_get_mass()
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"mass: %d kg\0A\00"
define i32 @cmd_dyno_mass(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @htoi(i8* %6)
%8 = tail call i32 @dyno_set_mass(i32 %7)
br label %12
9: ; preds = %2
%10 = tail call i32 (...) @dyno_get_mass()
%11 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *strutil_trim(char *);
int main(void) {
  char *str = "  Hello, World!    ";
  char *trimmed = strutil_trim(str);
  printf("Original:  \"%s\"\n", str);
  printf("Trimmed:   \"%s\"\n", trimmed);
  free(trimmed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strutil_trim@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
mov    %r14,%rdi
call   1050 <strutil_trim@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c" Hello, World! \00"
@.str.1 = [17 x i8] c"Original: \22%s\22\0A\00"
@.str.2 = [17 x i8] c"Trimmed: \22%s\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strutil_trim(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c" Hello, World! \00"
@.str.1 = [17 x i8] c"Original: \22%s\22\0A\00"
@.str.2 = [17 x i8] c"Trimmed: \22%s\22\0A\00"
define i32 @main() {
%1 = tail call i8* @strutil_trim(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%4 = tail call i32 @free(i8* %1)
ret i32 0
}
h(x) __typeof(f()) x;
{ return x; }


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

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

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

LLVM IR (-O2):
define i32 @h(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void *realloc(void *, long);
void *midi_mem_resize(void *ptr, long nbytes, const char *file, int line) {
  assert(ptr);
  assert(nbytes > 0);
  ptr = realloc(ptr, nbytes);
  assert(ptr != NULL);
  return ptr;
}


x86 assembly (clang, -O0):
<midi_mem_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midi_mem_resize>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setg   %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @midi_mem_resize(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i64, i64* %6
%13 = icmp sgt i64 %12, 0
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i8* @realloc(i8* %16, i64 %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %5
%20 = icmp ne i8* %19, null
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i8*, i8** %5
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @midi_mem_resize(i8* %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = ptrtoint i8* %0 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = icmp sgt i64 %1, 0
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i8* @realloc(i8* %0, i64 %1)
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ l6480_send_cmd(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void l6480_cmd_softhiz(void) {
  l6480_send_cmd(0xA0, 1, 0, 0);
  return;
}


x86 assembly (clang, -O0):
<l6480_cmd_softhiz>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa0,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <l6480_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l6480_cmd_softhiz>:
mov    $0xa0,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <l6480_send_cmd@plt>

LLVM IR (-O0):
define void @l6480_cmd_softhiz() {
%1 = call i32 @l6480_send_cmd(i32 160, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @l6480_cmd_softhiz() {
%1 = tail call i32 @l6480_send_cmd(i32 160, i32 1, i32 0, i32 0)
ret void
}
char *corta_string(char *apuntador) {
  char *error = "";
  apuntador = apuntador + 1;
  if (*apuntador != 0)
    return apuntador;
  else {
    error = "error, el string solo tiene un caracter";
    return error;
  }
}


x86 assembly (clang, -O0):
<corta_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
lea    0xf18(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <corta_string+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <corta_string+0x4f>
lea    0xebd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corta_string>:
cmpb   $0x0,0x1(%rdi)
lea    0x1(%rdi),%rcx
lea    0xef1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [40 x i8] c"error, el string solo tiene un caracter\00"
define i8* @corta_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i8*, i8** %3
store i8* %12, i8** %2
br label %15
13: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8** %4
%14 = load i8*, i8** %4
store i8* %14, i8** %2
br label %15
15: ; preds = %13, %11
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"error, el string solo tiene un caracter\00"
define i8* @corta_string(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %2
ret i8* %5
}
int isprime(int n) {
  int i;
  int prime = 1;
  for (i = 2; i < n; i++) {
    if (n % i == 0) {
      prime = 0;
      i = n;
    }
  }
  return prime;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <isprime+0x51>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    113e <isprime+0x3e>
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <isprime+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <isprime+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
mov    $0x1,%edx
cmp    $0x3,%edi
jl     113c <isprime+0x3c>
mov    $0x2,%esi
mov    $0x1,%ecx
jmp    112b <isprime+0x2b>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edx,%ecx
mov    %eax,%esi
cmp    %edi,%eax
jge    113c <isprime+0x3c>
mov    %edi,%eax
cltd
idiv   %esi
mov    %edi,%eax
test   %edx,%edx
je     1120 <isprime+0x20>
mov    %esi,%eax
mov    %ecx,%edx
jmp    1120 <isprime+0x20>
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 1, %1 ]
%5 = phi i32 [ %10, %3 ], [ 2, %1 ]
%6 = srem i32 %0, %5
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 %0, i32 %5
%9 = select i1 %7, i32 0, i32 %4
%10 = add nsw i32 %8, 1
%11 = icmp slt i32 %10, %0
br i1 %11, label %3, label %12
12: ; preds = %3, %1
%13 = phi i32 [ 1, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Type definitions */
struct blob_attr {
  int dummy;
};
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ blob_get_u8(struct blob_attr const *);
int8_t blob_get_int8(const struct blob_attr *attr) { return blob_get_u8(attr); }


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

x86 assembly (clang, -O2):
<blob_get_int8>:
jmp    1030 <blob_get_u8@plt>

LLVM IR (-O0):
%struct.blob_attr = type { i32 }
define i32 @blob_get_int8(%struct.blob_attr* %0) {
%2 = alloca %struct.blob_attr*
store %struct.blob_attr* %0, %struct.blob_attr** %2
%3 = load %struct.blob_attr*, %struct.blob_attr** %2
%4 = call i32 @blob_get_u8(%struct.blob_attr* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
define i32 @blob_get_int8(%struct.blob_attr* %0) {
%2 = tail call i32 @blob_get_u8(%struct.blob_attr* %0)
ret i32 %2
}
/* Type definitions */
struct tiff {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ tiffWriteField(int /*<<< orphan*/ *, struct tiff *,
                                  unsigned short, int, int, unsigned long *);
void tiffWriteRationalField(FILE *fp, struct tiff *t, unsigned short tag,
                            unsigned long numerator,
                            unsigned long denominator) {
  unsigned long x[2];
  x[0] = numerator;
  x[1] = denominator;
  tiffWriteField(fp, t, tag, 5, 1, x);
}


x86 assembly (clang, -O0):
<tiffWriteRationalField>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x12(%rbp),%ax
lea    -0x40(%rbp),%r9
mov    $0x5,%ecx
mov    $0x1,%r8d
movzwl %ax,%edx
call   1030 <tiffWriteField@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tiffWriteRationalField>:
sub    $0x18,%rsp
mov    %rcx,(%rsp)
mov    %r8,0x8(%rsp)
mov    %rsp,%r9
mov    $0x5,%ecx
mov    $0x1,%r8d
call   1030 <tiffWriteField@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tiff = type { i32 }
define void @tiffWriteRationalField(i32* %0, %struct.tiff* %1, i16 zeroext %2, i64 %3, i64 %4) {
%6 = alloca i32*
%7 = alloca %struct.tiff*
%8 = alloca i16
%9 = alloca i64
%10 = alloca i64
%11 = alloca [2 x i64]
store i32* %0, i32** %6
store %struct.tiff* %1, %struct.tiff** %7
store i16 %2, i16* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = load i64, i64* %9
%13 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
store i64 %12, i64* %13
%14 = load i64, i64* %10
%15 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 1
store i64 %14, i64* %15
%16 = load i32*, i32** %6
%17 = load %struct.tiff*, %struct.tiff** %7
%18 = load i16, i16* %8
%19 = getelementptr inbounds [2 x i64], [2 x i64]* %11, i64 0, i64 0
%20 = call i32 @tiffWriteField(i32* %16, %struct.tiff* %17, i16 zeroext %18, i32 5, i32 1, i64* %19)
ret void
}

LLVM IR (-O2):
%struct.tiff = type { i32 }
define void @tiffWriteRationalField(i32* %0, %struct.tiff* %1, i16 zeroext %2, i64 %3, i64 %4) {
%6 = alloca [2 x i64]
%7 = bitcast [2 x i64]* %6 to i8*
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
store i64 %3, i64* %8
%9 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 1
store i64 %4, i64* %9
%10 = call i32 @tiffWriteField(i32* %0, %struct.tiff* %1, i16 zeroext %2, i32 5, i32 1, i64* %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void start_a4(void) { printf("start_a4\n"); }


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"start_a4\00"
define void @start_a4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
void __exit_idle(void) {}


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

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

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

LLVM IR (-O2):
define void @__exit_idle() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int _atob(int /*<<< orphan*/ *, char *, int);
char *_getbase(char *, int *);
int llatob(uint64_t *vp, char *p, int base) {
  if (base == 0)
    p = _getbase(p, &base);
  return _atob(vp, p, base);
}


x86 assembly (clang, -O0):
<llatob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114e <llatob+0x2e>
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <_getbase@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <_atob@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llatob>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %edx,0xc(%rsp)
test   %edx,%edx
jne    1147 <llatob+0x27>
lea    0xc(%rsp),%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1040 <_getbase@plt>
mov    %rax,%rsi
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
call   1030 <_atob@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @llatob(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = call i8* @_getbase(i8* %10, i32* %6)
store i8* %11, i8** %5
br label %12
12: ; preds = %9, %3
%13 = load i32*, i32** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @_atob(i32* %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @llatob(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i8* @_getbase(i8* %1, i32* %4)
%8 = load i32, i32* %4
br label %9
9: ; preds = %6, %3
%10 = phi i32 [ %8, %6 ], [ %2, %3 ]
%11 = phi i8* [ %7, %6 ], [ %1, %3 ]
%12 = call i32 @_atob(i32* %0, i8* %11, i32 %10)
ret i32 %12
}
void wait_sec() {
  int i;
  for (i = 0; i < 10; i++)
    asm volatile("nop");
}


x86 assembly (clang, -O0):
<wait_sec>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1124 <wait_sec+0x24>
nop
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <wait_sec+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @wait_sec() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmstring_cleanup_all();
int /*<<< orphan*/ cmstring_print_all();
int /*<<< orphan*/ test_base64();
int /*<<< orphan*/ test_xor();
int main() {
  test_base64();
  test_xor();
  cmstring_print_all();
  cmstring_cleanup_all();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_base64@plt>
mov    $0x0,%al
call   1030 <test_xor@plt>
mov    $0x0,%al
call   1060 <cmstring_print_all@plt>
mov    $0x0,%al
call   1050 <cmstring_cleanup_all@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_base64@plt>
xor    %eax,%eax
call   1030 <test_xor@plt>
xor    %eax,%eax
call   1060 <cmstring_print_all@plt>
xor    %eax,%eax
call   1050 <cmstring_cleanup_all@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_base64()
%3 = call i32 (...) @test_xor()
%4 = call i32 (...) @cmstring_print_all()
%5 = call i32 (...) @cmstring_cleanup_all()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_base64()
%2 = tail call i32 (...) @test_xor()
%3 = tail call i32 (...) @cmstring_print_all()
%4 = tail call i32 (...) @cmstring_cleanup_all()
ret i32 0
}
bdosrd(kind, buff, len) register char *buff;
{
  register int count;
  for (count = 0; count < len; ++count) {
    if ((*buff++ = bdos(kind)) == 0x1a)
      break;
  }
  return count;
}


x86 assembly (clang, -O0):
<bdosrd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1174 <bdosrd+0x64>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <bdos@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x1a,%eax
jne    1161 <bdosrd+0x51>
jmp    1174 <bdosrd+0x64>
jmp    1166 <bdosrd+0x56>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1129 <bdosrd+0x19>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdosrd>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    114c <bdosrd+0x3c>
mov    %rsi,%r15
mov    %edi,%ebp
mov    %edx,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <bdos@plt>
mov    %al,(%r15,%rbx,1)
cmp    $0x1a,%al
je     1151 <bdosrd+0x41>
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1130 <bdosrd+0x20>
jmp    1154 <bdosrd+0x44>
xor    %r14d,%r14d
jmp    1154 <bdosrd+0x44>
mov    %ebx,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bdosrd(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %16
5: ; preds = %3, %12
%6 = phi i32 [ %14, %12 ], [ 0, %3 ]
%7 = phi i8* [ %13, %12 ], [ %1, %3 ]
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @bdos to i32 (i32, ...)*)(i32 %0)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %7
%10 = and i32 %8, 255
%11 = icmp eq i32 %10, 26
br i1 %11, label %16, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = add nuw nsw i32 %6, 1
%15 = icmp eq i32 %14, %2
br i1 %15, label %16, label %5
16: ; preds = %12, %5, %3
%17 = phi i32 [ 0, %3 ], [ %6, %5 ], [ %2, %12 ]
ret i32 %17
}
int k_atomexch(int volatile *value, int exch) {
  return (int)__sync_lock_test_and_set(value, exch);
}


x86 assembly (clang, -O0):
<k_atomexch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%eax
xchg   %eax,(%rcx)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @k_atomexch(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = atomicrmw xchg i32* %5, i32 %6 seq_cst
ret i32 %7
}

LLVM IR (-O2):
define i32 @k_atomexch(i32* nocapture %0, i32 %1) {
%3 = atomicrmw xchg i32* %0, i32 %1 seq_cst
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void fprint_mov_to_direct(FILE *stream, uint8_t direct) {
  fprintf(stream,
          "MOV   "
          "0x%02X"
          ", A                   ",
          direct);
}


x86 assembly (clang, -O0):
<fprint_mov_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_to_direct>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"MOV 0x%02X, A \00"
define void @fprint_mov_to_direct(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"MOV 0x%02X, A \00"
define void @fprint_mov_to_direct(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char *str1, char *str2) {
  char str[20];
  strcpy(str, str1);
  strcpy(str1, str2);
  strcpy(str2, str);
}


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

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [20 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *stringFieldInSubmissionSet(struct sqlConnection *, int, char *);
char *visiGeneContributors(struct sqlConnection *conn, int id) {
  return stringFieldInSubmissionSet(conn, id, "contributors");
}


x86 assembly (clang, -O0):
<visiGeneContributors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <stringFieldInSubmissionSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneContributors>:
lea    0xee9(%rip),%rdx
jmp    1030 <stringFieldInSubmissionSet@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"contributors\00"
define i8* @visiGeneContributors(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"contributors\00"
define i8* @visiGeneContributors(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @stringFieldInSubmissionSet(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
void simple_leak() {
  int *p;
  p = (int *)malloc(sizeof(int));
}


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

x86 assembly (clang, -O2):
<simple_leak>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @simple_leak() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
ret void
}

LLVM IR (-O2):
define void @simple_leak() {
%1 = tail call i64 @malloc(i32 4)
ret void
}