xunge/DecIR huggingface dataset:
/* Type definitions */
struct scsi_cmnd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ata_scsi_badcmd(struct scsi_cmnd *,
                                   void (*)(struct scsi_cmnd *), int, int);
void ata_bad_cdb(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) {
  ata_scsi_badcmd(cmd, done, 0x24, 0x00);
}


x86 assembly (clang, -O0):
<ata_bad_cdb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x24,%edx
xor    %ecx,%ecx
call   1030 <ata_scsi_badcmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ata_bad_cdb>:
mov    $0x24,%edx
xor    %ecx,%ecx
jmp    1030 <ata_scsi_badcmd@plt>

LLVM IR (-O0):
%struct.scsi_cmnd = type { i32 }
define void @ata_bad_cdb(%struct.scsi_cmnd* %0, void (%struct.scsi_cmnd*)* %1) {
%3 = alloca %struct.scsi_cmnd*
%4 = alloca void (%struct.scsi_cmnd*)*
store %struct.scsi_cmnd* %0, %struct.scsi_cmnd** %3
store void (%struct.scsi_cmnd*)* %1, void (%struct.scsi_cmnd*)** %4
%5 = load %struct.scsi_cmnd*, %struct.scsi_cmnd** %3
%6 = load void (%struct.scsi_cmnd*)*, void (%struct.scsi_cmnd*)** %4
%7 = call i32 @ata_scsi_badcmd(%struct.scsi_cmnd* %5, void (%struct.scsi_cmnd*)* %6, i32 36, i32 0)
ret void
}

LLVM IR (-O2):
%struct.scsi_cmnd = type { i32 }
define void @ata_bad_cdb(%struct.scsi_cmnd* %0, void (%struct.scsi_cmnd*)* %1) {
%3 = tail call i32 @ata_scsi_badcmd(%struct.scsi_cmnd* %0, void (%struct.scsi_cmnd*)* %1, i32 36, i32 0)
ret void
}
unsigned int la_version(unsigned int version) { return version; }


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

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

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

LLVM IR (-O2):
define i32 @la_version(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
int /*<<< orphan*/ write_nl();
void latex_description(void) {
  write_break();
  write_line("\\begin{description}");
  write_nl();
}


x86 assembly (clang, -O0):
<latex_description>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <write_break@plt>
lea    0xebe(%rip),%rdi
call   1050 <write_line@plt>
mov    $0x0,%al
call   1030 <write_nl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<latex_description>:
push   %rax
xor    %eax,%eax
call   1040 <write_break@plt>
lea    0xec1(%rip),%rdi
call   1050 <write_line@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <write_nl@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\\begin{description}\00"
define void @latex_description() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @write_nl()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\\begin{description}\00"
define void @latex_description() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @write_nl()
ret void
}
/* Variables and functions */
int most_significant_bit_pos_ulong(unsigned long);
int balanced_btree_max_height(size_t num_nodes) {
  if (num_nodes == 0)
    return -1;
  return most_significant_bit_pos_ulong((unsigned long)num_nodes);
}


x86 assembly (clang, -O0):
<balanced_btree_max_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <balanced_btree_max_height+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <balanced_btree_max_height+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <most_significant_bit_pos_ulong@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<balanced_btree_max_height>:
test   %rdi,%rdi
je     111a <balanced_btree_max_height+0xa>
jmp    1030 <most_significant_bit_pos_ulong@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @balanced_btree_max_height(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %3
%9 = call i32 @most_significant_bit_pos_ulong(i64 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @balanced_btree_max_height(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @most_significant_bit_pos_ulong(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
int strhash(string)
register const char *string;
{
  register int c;
  register int val = 0;
  while ((c = *string++) != '\0') {
    val = val * 997 + c;
  }
  return val + (val >> 5);
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113f <strhash+0x3f>
imul   $0x3e5,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <strhash+0xf>
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    $0x5,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%al
test   %al,%al
je     1128 <strhash+0x28>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
imul   $0x3e5,%ecx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strhash+0x10>
jmp    112a <strhash+0x2a>
xor    %ecx,%ecx
mov    %ecx,%eax
sar    $0x5,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul nsw i32 %6, 997
%11 = add nsw i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
%16 = ashr i32 %15, 5
%17 = add nsw i32 %16, %15
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_87() {
  Assert_real((isqrt(87) == 9),
              "/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/stdlib/isqrt.c",
              440, ("Integer square root of 87 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_87>:
push   %rbp
mov    %rsp,%rbp
mov    $0x57,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1b8,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_87>:
push   %rax
mov    $0x57,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1b8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 87 should be 9\00"
define void @t_sqrt_87() {
%1 = call i32 @isqrt(i32 87)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 440, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 87 should be 9\00"
define void @t_sqrt_87() {
%1 = tail call i32 @isqrt(i32 87)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 440, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int max_int(const int a, const int b) {
  if (b < a) {
    return a;
  }
  return b;
}


x86 assembly (clang, -O0):
<max_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <max_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max_int+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_int>:
mov    %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max_int(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* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void reb_integrator_leapfrog_synchronize(struct reb_simulation *r) {}


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

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

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

LLVM IR (-O2):
%struct.reb_simulation = type opaque
define void @reb_integrator_leapfrog_synchronize(%struct.reb_simulation* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_mutex_destroy(int /*<<< orphan*/ *);
void mutex_destroy(pthread_mutex_t *mutex) {
  int err = pthread_mutex_destroy(mutex);
  if (err != 0) {
    perror("pthread_mutex_destroy");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<mutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116c <mutex_destroy+0x3c>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutex_destroy>:
push   %rax
call   1030 <pthread_mutex_destroy@plt>
test   %eax,%eax
jne    113c <mutex_destroy+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"pthread_mutex_destroy\00"
@EXIT_FAILURE = global i32 0
define void @mutex_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_mutex_destroy(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"pthread_mutex_destroy\00"
@EXIT_FAILURE = global i32 0
define void @mutex_destroy(i32* %0) {
%2 = tail call i32 @pthread_mutex_destroy(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint;
typedef scalar_t__ time_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
scalar_t__ time(int /*<<< orphan*/ *);
void getNowStr(char *timeStr) {
  time_t myTime;
  myTime = time(NULL);
  snprintf(timeStr, 15, "%011d", (uint)myTime);
}


x86 assembly (clang, -O0):
<getNowStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0xf,%esi
lea    0xeb1(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNowStr>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
lea    0xece(%rip),%rdx
mov    %rbx,%rdi
mov    $0xf,%esi
mov    %eax,%ecx
pop    %rbx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%011d\00"
define void @getNowStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = call i64 @time(i32* null)
store i64 %4, i64* %3
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = call i32 @snprintf(i8* %5, i32 15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%011d\00"
define void @getNowStr(i8* %0) {
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = tail call i32 @snprintf(i8* %0, i32 15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int ssize_t;
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset) {
  printf(">>> pwrite, fd - %d, offset - %d\n", fd, offset);
  return -1;
}


x86 assembly (clang, -O0):
<pwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwrite>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c">>> pwrite, fd - %d, offset - %d\0A\00"
define i32 @pwrite(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 -1
}

LLVM IR (-O2):
@.str = [34 x i8] c">>> pwrite, fd - %d, offset - %d\0A\00"
define i32 @pwrite(i32 %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int getushort(FILE *ttf) {
  int ch1 = getc(ttf);
  int ch2 = getc(ttf);
  if (ch2 == EOF)
    return (EOF);
  return ((ch1 << 8) | ch2);
}


x86 assembly (clang, -O0):
<getushort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%eax
jne    1157 <getushort+0x47>
mov    0x2e9b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <getushort+0x53>
mov    -0x14(%rbp),%eax
shl    $0x8,%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getushort>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <getc@plt>
mov    0x2ebc(%rip),%rcx
mov    (%rcx),%ecx
shl    $0x8,%ebp
or     %eax,%ebp
cmp    %ecx,%eax
cmove  %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @getushort(i32* nocapture %0) {
%2 = tail call i32 @getc(i32* %0)
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = shl i32 %2, 8
%7 = or i32 %6, %3
%8 = select i1 %5, i32 %4, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void my_err(const char *err_string, int line) {
  fprintf(stderr, "line:%d", line);
  perror(err_string);
  exit(1);
}


x86 assembly (clang, -O0):
<my_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xeae(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<my_err>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"line:%d\00"
define void @my_err(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"line:%d\00"
define void @my_err(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%5 = tail call i32 @perror(i8* %0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
int *getString(int *entry) { return (int *)*(entry + 1); }


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

x86 assembly (clang, -O2):
<getString>:
movslq 0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @getString(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
ret i32* %7
}

LLVM IR (-O2):
define i32* @getString(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
void fun_sse(float *a, float *b, int n) {}


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

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

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

LLVM IR (-O2):
define void @fun_sse(float* nocapture %0, float* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MP_motor(int, int /*<<< orphan*/);
void MP_motors_off(void) {
  MP_motor(0, 0);
  MP_motor(1, 0);
  MP_motor(2, 0);
  MP_motor(3, 0);
}


x86 assembly (clang, -O0):
<MP_motors_off>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <MP_motor@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MP_motors_off>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <MP_motor@plt>
mov    $0x3,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <MP_motor@plt>

LLVM IR (-O0):
define void @MP_motors_off() {
%1 = call i32 @MP_motor(i32 0, i32 0)
%2 = call i32 @MP_motor(i32 1, i32 0)
%3 = call i32 @MP_motor(i32 2, i32 0)
%4 = call i32 @MP_motor(i32 3, i32 0)
ret void
}

LLVM IR (-O2):
define void @MP_motors_off() {
%1 = tail call i32 @MP_motor(i32 0, i32 0)
%2 = tail call i32 @MP_motor(i32 1, i32 0)
%3 = tail call i32 @MP_motor(i32 2, i32 0)
%4 = tail call i32 @MP_motor(i32 3, i32 0)
ret void
}
unsigned long virt_to_phys(volatile void *address) {
  return (((unsigned long)(address)) & 0x1fffffff);
}


x86 assembly (clang, -O0):
<virt_to_phys>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1fffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<virt_to_phys>:
mov    %rdi,%rax
and    $0x1fffffff,%eax
ret

LLVM IR (-O0):
define i64 @virt_to_phys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 536870911
ret i64 %5
}

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = and i64 %2, 536870911
ret i64 %3
}
/* Variables and functions */
double cdfglo_(double *, double *);
double ccdfglo(double *x, double *para) { return cdfglo_(x, para); }


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

x86 assembly (clang, -O2):
<ccdfglo>:
jmp    1030 <cdfglo_@plt>

LLVM IR (-O0):
define double @ccdfglo(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @cdfglo_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @ccdfglo(double* %0, double* %1) {
%3 = tail call double @cdfglo_(double* %0, double* %1)
ret double %3
}
double callback3_double_double_double(double (*f)(double)) { return f(3.0); }


x86 assembly (clang, -O0):
<callback3_double_double_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  0xeec(%rip),%xmm0
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback3_double_double_double>:
movsd  0xef8(%rip),%xmm0
jmp    *%rdi

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

LLVM IR (-O2):
define double @callback3_double_double_double(double (double)* nocapture %0) {
%2 = tail call double %0(double 3.000000e+00)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
long main() { f(1); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = call i32 @f(i32 1)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i32 @f(i32 1)
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char const *);
void echecm(const char *echec_msg) {
  printf("\n%s: %s\n", "[\033[31mECHEC\033[0m]", echec_msg);
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"\0A%s: %s\0A\00"
@.str.1 = [17 x i8] c"[\1B[31mECHEC\1B[0m]\00"
define void @echecm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\0A%s: %s\0A\00"
@.str.1 = [17 x i8] c"[\1B[31mECHEC\1B[0m]\00"
define void @echecm(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int isspace(int c) { return ((c == ' ') || (c == '\n') || (c == '\t')); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <isspace+0x2f>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <isspace+0x2f>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
cmp    $0xa,%edi
je     110f <isspace+0xf>
cmp    $0x20,%edi
jne    1110 <isspace+0x10>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 10, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int execv(char const *, char *const *);
int outside_execv(const char *path, char *const argv[]) {
  return execv(path, argv);
}


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

x86 assembly (clang, -O2):
<outside_execv>:
jmp    1030 <execv@plt>

LLVM IR (-O0):
define i32 @outside_execv(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 @execv(i8* %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @outside_execv(i8* %0, i8** %1) {
%3 = tail call i32 @execv(i8* %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void umockalloc_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<umockalloc_free>:
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):
<umockalloc_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @umockalloc_free(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 @umockalloc_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ R_SyncRenderThread();
int /*<<< orphan*/ Sys_LowPhysicalMemory();
void RE_EndRegistration(void) {
  R_SyncRenderThread();
  if (!Sys_LowPhysicalMemory()) {
  }
}


x86 assembly (clang, -O0):
<RE_EndRegistration>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <R_SyncRenderThread@plt>
mov    $0x0,%al
call   1030 <Sys_LowPhysicalMemory@plt>
cmp    $0x0,%eax
jne    1140 <RE_EndRegistration+0x20>
jmp    1140 <RE_EndRegistration+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RE_EndRegistration() {
%1 = call i32 (...) @R_SyncRenderThread()
%2 = call i32 (...) @Sys_LowPhysicalMemory()
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
br label %5
5: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @RE_EndRegistration() {
%1 = tail call i32 (...) @R_SyncRenderThread()
%2 = tail call i32 (...) @Sys_LowPhysicalMemory()
ret void
}
/* Variables and functions */
int neio_putb(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int neio_puts(const char *s) { return neio_putb(s, strlen(s)); }


x86 assembly (clang, -O0):
<neio_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <neio_putb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neio_puts>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <neio_putb@plt>

LLVM IR (-O0):
define i32 @neio_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @neio_putb(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @neio_puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @neio_putb(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int getuid();
void main() {
  int uid = getuid();
  int i;
  for (i = 0; i < 20000000; i++) {
    getuid();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1312d00,-0x8(%rbp)
jge    114b <main+0x3b>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    $0x1312d00,%ebx
nopl   (%rax)
xor    %eax,%eax
call   1030 <getuid@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @getuid()
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @getuid()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 20000000
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
unsigned short int f62(unsigned short int x, unsigned long int y) {
  return (x << ((-y) & (8 * sizeof(unsigned short) - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f62>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0xf,%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f62>:
mov    %esi,%ecx
neg    %cl
and    $0xf,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = sub i64 0, %7
%9 = and i64 %8, 15
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = ashr i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @f62(i16 zeroext %0, i64 %1) {
%3 = zext i16 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 15
%7 = shl nuw nsw i32 %3, %6
%8 = lshr i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
int hash2fd(void *fd) { return (long)fd; }


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

x86 assembly (clang, -O2):
<hash2fd>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @hash2fd(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_be_u16(void *s) {
  uint16_t x;
  uint8_t *ptr = (uint8_t *)s;
  x = ptr[1] + (ptr[0] << 8);
  return x;
}


x86 assembly (clang, -O0):
<read_be_u16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x18(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_be_u16>:
mov    (%rdi),%eax
shl    $0x8,%eax
add    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read_be_u16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 0
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = add nsw i32 %9, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_be_u16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ pthread_mutex_init(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
void fthread_mutex_init_(pthread_mutex_t **theMutex) {
  *theMutex = (pthread_mutex_t *)malloc(sizeof(pthread_mutex_t));
  pthread_mutex_init(*theMutex, NULL);
}


x86 assembly (clang, -O0):
<fthread_mutex_init_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_mutex_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fthread_mutex_init_>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <pthread_mutex_init@plt>

LLVM IR (-O0):
define void @fthread_mutex_init_(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = load i32**, i32*** %2
store i32* %4, i32** %5
%6 = load i32**, i32*** %2
%7 = load i32*, i32** %6
%8 = call i32 @pthread_mutex_init(i32* %7, i32* null)
ret void
}

LLVM IR (-O2):
define void @fthread_mutex_init_(i32** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %0
%4 = tail call i32 @pthread_mutex_init(i32* %3, i32* null)
ret void
}
/* Variables and functions */
int rand();
int randomBet(int min, int max) { return (rand() % (max - min)) + min; }


x86 assembly (clang, -O0):
<randomBet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomBet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomBet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @randomBet(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int ILen(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void ICpy(char **dest, int i) {
  int len = ILen(i);
  snprintf(*dest, len, "i%d", i);
  (*dest)[len - 1] = 'e';
  *dest += len;
}


x86 assembly (clang, -O0):
<ICpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <ILen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%ecx
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x65,(%rax,%rcx,1)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICpy>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <ILen@plt>
mov    %eax,%ebp
mov    (%rbx),%rdi
lea    0xec3(%rip),%rdx
mov    %eax,%esi
mov    %r14d,%ecx
call   1030 <snprintf@plt>
mov    (%rbx),%rax
movslq %ebp,%rcx
movb   $0x65,-0x1(%rcx,%rax,1)
add    %rcx,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"i%d\00"
define void @ICpy(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @ILen(i32 %6)
store i32 %7, i32* %5
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @snprintf(i8* %9, i32 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 101, i8* %18
%19 = load i32, i32* %5
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = sext i32 %19 to i64
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8* %23, i8** %20
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"i%d\00"
define void @ICpy(i8** nocapture %0, i32 %1) {
%3 = tail call i32 @ILen(i32 %1)
%4 = load i8*, i8** %0
%5 = tail call i32 @snprintf(i8* %4, i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = load i8*, i8** %0
%7 = add nsw i32 %3, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 101, i8* %9
%10 = load i8*, i8** %0
%11 = sext i32 %3 to i64
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %0
ret void
}
/* Variables and functions */
double gettime();
void waitfor(double secs) {
  double time = gettime() + secs;
  while (gettime() < time)
    ;
}


x86 assembly (clang, -O0):
<waitfor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gettime@plt>
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <gettime@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114c <waitfor+0x3c>
jmp    112e <waitfor+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<waitfor>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <gettime@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <gettime@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     1130 <waitfor+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @waitfor(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = call double (...) @gettime()
%5 = load double, double* %2
%6 = fadd double %4, %5
store double %6, double* %3
br label %7
7: ; preds = %11, %1
%8 = call double (...) @gettime()
%9 = load double, double* %3
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @waitfor(double %0) {
%2 = tail call double (...) @gettime()
%3 = fadd double %2, %0
br label %4
4: ; preds = %4, %1
%5 = tail call double (...) @gettime()
%6 = fcmp olt double %5, %3
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
char *roadmap_trip_get_focus_name();
int /*<<< orphan*/ strcmp(char const *, char *);
int bottom_bar_status(void) {
  const char *focus;
  focus = roadmap_trip_get_focus_name();
  if (focus && !strcmp(focus, "GPS"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<bottom_bar_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <roadmap_trip_get_focus_name@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1163 <bottom_bar_status+0x43>
mov    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1163 <bottom_bar_status+0x43>
movl   $0x1,-0x4(%rbp)
jmp    116a <bottom_bar_status+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bottom_bar_status>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <roadmap_trip_get_focus_name@plt>
test   %rax,%rax
je     1147 <bottom_bar_status+0x27>
lea    0xeca(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
jne    1147 <bottom_bar_status+0x27>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"GPS\00"
define i32 @bottom_bar_status() {
%1 = tail call i8* (...) @roadmap_trip_get_focus_name()
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @strcmp(i8* %1, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %8
}
unsigned char __toupper(unsigned char c) {
  if (((c) >= 'a' && (c) <= 'z'))
    c -= 'a' - 'A';
  return c;
}


x86 assembly (clang, -O0):
<__toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     112e <__toupper+0x2e>
movzbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
jg     112e <__toupper+0x2e>
movzbl -0x1(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__toupper>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @__toupper(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %12, 32
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6, %1
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @__toupper(i8 zeroext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}