xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ time(char *);
char *timeset() {
  register char *sp;
  char buf[16];
  extern char *ctime();
  time(buf);
  sp = ctime(buf);
  sp[strlen(sp) - 1] = 0;
  return (sp);
}


x86 assembly (clang, -O0):
<timeset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
call   1050 <time@plt>
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <ctime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timeset>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @timeset() {
%1 = alloca i8*
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @time(i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = call i8* (i8*, ...) bitcast (i8* (...)* @ctime to i8* (i8*, ...)*)(i8* %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i8*, i8** %1
%9 = call i32 @strlen(i8* %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8 0, i8* %12
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
define i8* @timeset() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @time(i8* %2)
%4 = call i8* (i8*, ...) bitcast (i8* (...)* @ctime to i8* (i8*, ...)*)(i8* %2)
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %4, i64 %7
store i8 0, i8* %8
ret i8* %4
}
short f0(short x) {
  int z;
  do {
    z = 0;
    if (x <= 0) {
      z = 1;
      return 100;
    }
  } while (x--);
  z = 2;
  return 200;
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jg     1131 <f0+0x31>
movl   $0x1,-0x8(%rbp)
movw   $0x64,-0x2(%rbp)
jmp    115c <f0+0x5c>
jmp    1136 <f0+0x36>
mov    -0x4(%rbp),%ax
mov    %ax,%cx
add    $0xffff,%cx
mov    %cx,-0x4(%rbp)
cmp    $0x0,%ax
jne    110b <f0+0xb>
movl   $0x2,-0x8(%rbp)
movw   $0xc8,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    $0x64,%ax
ret

LLVM IR (-O0):
define signext i16 @f0(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
br label %5
5: ; preds = %11, %1
store i32 0, i32* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
store i32 1, i32* %4
store i16 100, i16* %2
br label %16
10: ; preds = %5
br label %11
11: ; preds = %10
%12 = load i16, i16* %3
%13 = add i16 %12, -1
store i16 %13, i16* %3
%14 = icmp ne i16 %12, 0
br i1 %14, label %5, label %15
15: ; preds = %11
store i32 2, i32* %4
store i16 200, i16* %2
br label %16
16: ; preds = %15, %9
%17 = load i16, i16* %2
ret i16 %17
}

LLVM IR (-O2):
define signext i16 @f0(i16 signext %0) {
ret i16 100
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void csv_wakeup_table_header(__attribute__((unused)) void *report_data) {
  printf("\n");
  printf("Wakeup Table\n");
  printf("cluster,core,cpu,IRQ,Name,Count,early,late\n");
}


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

x86 assembly (clang, -O2):
<csv_wakeup_table_header>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rdi
call   1040 <puts@plt>
lea    0xecf(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [14 x i8] c"Wakeup Table\0A\00"
@.str.2 = [44 x i8] c"cluster,core,cpu,IRQ,Name,Count,early,late\0A\00"
define void @csv_wakeup_table_header(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Wakeup Table\00"
@str.3 = [43 x i8] c"cluster,core,cpu,IRQ,Name,Count,early,late\00"
define void @csv_wakeup_table_header(i8* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int use_Digest_Auth(char *s) {
  if (strstr(s, "WWW-Authenticate: Digest") != NULL) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<use_Digest_Auth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <use_Digest_Auth+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <use_Digest_Auth+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<use_Digest_Auth>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"WWW-Authenticate: Digest\00"
define i32 @use_Digest_Auth(i8* %0) {
%2 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world\n");
  main(argc, argv);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %3
}
int ft_strlen(const char *s) {
  char *tmp;
  tmp = (char *)s;
  while (*tmp)
    ++tmp;
  return (tmp - s);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <ft_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ft_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgshl(void) { gen("shlq\t%cl,%rax"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"shlq\09%cl,%rax\00"
define void @cgshl() {
%1 = call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"shlq\09%cl,%rax\00"
define void @cgshl() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void av_vlog() {}


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

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

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

LLVM IR (-O2):
define void @av_vlog() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_0408172235_2320432267_init() {
  xsi_register_didat(
      "work_a_0408172235_2320432267",
      "isim/IM_tb_isim_beh.exe.sim/work/a_0408172235_2320432267.didat");
}


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

x86 assembly (clang, -O2):
<work_a_0408172235_2320432267_init>:
lea    0xee9(%rip),%rdi
lea    0xeff(%rip),%rsi
jmp    1030 <xsi_register_didat@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_0408172235_2320432267\00"
@.str.1 = [63 x i8] c"isim/IM_tb_isim_beh.exe.sim/work/a_0408172235_2320432267.didat\00"
define void @work_a_0408172235_2320432267_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_0408172235_2320432267\00"
@.str.1 = [63 x i8] c"isim/IM_tb_isim_beh.exe.sim/work/a_0408172235_2320432267.didat\00"
define void @work_a_0408172235_2320432267_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ logger_putchar(char);
unsigned int strlen(char *);
void logger(char *string) {
  unsigned int len = strlen(string);
  unsigned int i;
  for (i = 0; i < len; i++) {
    logger_putchar(string[i]);
  }
  logger_putchar('\r');
  logger_putchar('\n');
}


x86 assembly (clang, -O0):
<logger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1169 <logger+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <logger_putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <logger+0x1f>
mov    $0xd,%edi
call   1040 <logger_putchar@plt>
mov    $0xa,%edi
call   1040 <logger_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
je     1153 <logger+0x33>
mov    %eax,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1040 <logger_putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <logger+0x20>
mov    $0xd,%edi
call   1040 <logger_putchar@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <logger_putchar@plt>

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

LLVM IR (-O2):
define void @logger(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @logger_putchar(i8 signext %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
%14 = tail call i32 @logger_putchar(i8 signext 13)
%15 = tail call i32 @logger_putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DiskImage_RemoveDisk(int);
int /*<<< orphan*/ FDD_InsertDisk(int, int);
void DiskImage_Finish(void) {
  DiskImage_RemoveDisk(0);
  FDD_InsertDisk(0, (1 == 0));
  DiskImage_RemoveDisk(1);
  FDD_InsertDisk(1, (1 == 0));
}


x86 assembly (clang, -O0):
<DiskImage_Finish>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <DiskImage_RemoveDisk@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <FDD_InsertDisk@plt>
mov    $0x1,%edi
call   1040 <DiskImage_RemoveDisk@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <FDD_InsertDisk@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DiskImage_Finish>:
push   %rax
xor    %edi,%edi
call   1040 <DiskImage_RemoveDisk@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <FDD_InsertDisk@plt>
mov    $0x1,%edi
call   1040 <DiskImage_RemoveDisk@plt>
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <FDD_InsertDisk@plt>

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

LLVM IR (-O2):
define void @DiskImage_Finish() {
%1 = tail call i32 @DiskImage_RemoveDisk(i32 0)
%2 = tail call i32 @FDD_InsertDisk(i32 0, i32 0)
%3 = tail call i32 @DiskImage_RemoveDisk(i32 1)
%4 = tail call i32 @FDD_InsertDisk(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db_readPlayerSchedule(char const *);
int /*<<< orphan*/ printf(char *, char const *);
void updatePlayerSchedule(const char *id) {
  db_readPlayerSchedule(id);
  printf("UpdatePlayerSchedule.id=%s\n", id);
}


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

x86 assembly (clang, -O2):
<updatePlayerSchedule>:
push   %rbx
mov    %rdi,%rbx
call   1040 <db_readPlayerSchedule@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"UpdatePlayerSchedule.id=%s\0A\00"
define void @updatePlayerSchedule(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @db_readPlayerSchedule(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"UpdatePlayerSchedule.id=%s\0A\00"
define void @updatePlayerSchedule(i8* %0) {
%2 = tail call i32 @db_readPlayerSchedule(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cc_cache_fini();
scalar_t__ cc_cache_init();
scalar_t__ cc_reg_init();
int cc_allocator_init(void) {
  if (cc_cache_init() < 0) {
    ;
    return -1;
  }
  if (cc_reg_init() < 0) {
    ;
    cc_cache_fini();
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<cc_allocator_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <cc_cache_init@plt>
cmp    $0x0,%rax
jge    1155 <cc_allocator_init+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <cc_allocator_init+0x50>
mov    $0x0,%al
call   1030 <cc_reg_init@plt>
cmp    $0x0,%rax
jge    1179 <cc_allocator_init+0x49>
mov    $0x0,%al
call   1040 <cc_cache_fini@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <cc_allocator_init+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_allocator_init>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <cc_cache_init@plt>
test   %rax,%rax
js     1152 <cc_allocator_init+0x22>
xor    %eax,%eax
call   1030 <cc_reg_init@plt>
test   %rax,%rax
jns    1157 <cc_allocator_init+0x27>
xor    %eax,%eax
call   1040 <cc_cache_fini@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cc_allocator_init() {
%1 = tail call i64 (...) @cc_cache_init()
%2 = icmp slt i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i64 (...) @cc_reg_init()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @cc_cache_fini()
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ -1, %6 ], [ -1, %0 ], [ 0, %3 ]
ret i32 %9
}
void rop3_4_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_4_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_4_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
or     %dl,%cl
not    %cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_4_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %5
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = and i32 %27, %29
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = or i32 %30, %36
%38 = load i8, i8* %6
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %43, %46
%48 = or i32 %37, %47
%49 = trunc i32 %48 to i8
%50 = load i8*, i8** %4
store i8 %49, i8* %50
ret void
}

LLVM IR (-O2):
define void @rop3_4_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = xor i8 %5, -1
%7 = and i8 %6, %1
%8 = xor i8 %1, -1
%9 = and i8 %8, %2
%10 = and i8 %9, %4
%11 = or i8 %7, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ExecCfg(char *);
int /*<<< orphan*/ sprintf(char *, char *);
void AboutDlgProc(void) {
  char args[256];
  sprintf(args, "ABOUT");
  ExecCfg(args);
}


x86 assembly (clang, -O0):
<AboutDlgProc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <ExecCfg@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AboutDlgProc>:
sub    $0x108,%rsp
movw   $0x54,0x4(%rsp)
movl   $0x554f4241,(%rsp)
mov    %rsp,%rdi
call   1030 <ExecCfg@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ABOUT\00"
define void @AboutDlgProc() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @ExecCfg(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ABOUT\00"
define void @AboutDlgProc() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @ExecCfg(i8* %2)
ret void
}
void get_task_mm(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<get_task_mm>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_task_mm>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.get_task_mm = [12 x i8] c"get_task_mm\00"
define void @get_task_mm() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.get_task_mm, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.get_task_mm = [12 x i8] c"get_task_mm\00"
define void @get_task_mm() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.get_task_mm, i64 0, i64 0))
ret void
}
/* Variables and functions */
int callee_2(int, int, float);
int test_2(int first, int second, float third) {
  return callee_2(first, second, third);
}


x86 assembly (clang, -O0):
<test_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
call   1030 <callee_2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_2>:
jmp    1030 <callee_2@plt>

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

LLVM IR (-O2):
define i32 @test_2(i32 %0, i32 %1, float %2) {
%4 = tail call i32 @callee_2(i32 %0, i32 %1, float %2)
ret i32 %4
}
void TestB() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<TestB>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <TestB+0x9>
jmp    1109 <TestB+0x9>

x86 assembly (clang, -O2):
<TestB>:
jmp    1100 <TestB>

LLVM IR (-O0):
define void @TestB() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @TestB() {
br label %1
1: ; preds = %0, %1
br label %1
}
int hash2(const void *key) { return (*(const int *)key % (11 - 2)); }


x86 assembly (clang, -O0):
<hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash2>:
movslq (%rdi),%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hash2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 9
ret i32 %6
}

LLVM IR (-O2):
define i32 @hash2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 9
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t bam_swap_endian_8(uint64_t v) {
  v = ((v & 0x00000000FFFFFFFFULL) << 32) | (v >> 32);
  v = ((v & 0x0000FFFF0000FFFFULL) << 16) | ((v & 0xFFFF0000FFFF0000ULL) >> 16);
  return ((v & 0x00FF00FF00FF00FFULL) << 8) |
         ((v & 0xFF00FF00FF00FF00ULL) >> 8);
}


x86 assembly (clang, -O0):
<bam_swap_endian_8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffffffff,%rcx
and    %rcx,%rax
shl    $0x20,%rax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xffff0000ffff,%rcx
and    %rcx,%rax
shl    $0x10,%rax
movslq -0x4(%rbp),%rcx
movabs $0xffff0000ffff0000,%rdx
and    %rdx,%rcx
shr    $0x10,%rcx
or     %rcx,%rax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movabs $0xff00ff00ff00ff,%rcx
and    %rcx,%rax
shl    $0x8,%rax
movslq -0x4(%rbp),%rcx
movabs $0xff00ff00ff00ff00,%rdx
and    %rdx,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bam_swap_endian_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = and i64 %4, 4294967295
%6 = shl i64 %5, 32
%7 = load i32, i32* %2
%8 = ashr i32 %7, 32
%9 = sext i32 %8 to i64
%10 = or i64 %6, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = and i64 %13, 281470681808895
%15 = shl i64 %14, 16
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = and i64 %17, -281470681808896
%19 = lshr i64 %18, 16
%20 = or i64 %15, %19
%21 = trunc i64 %20 to i32
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = sext i32 %22 to i64
%24 = and i64 %23, 71777214294589695
%25 = shl i64 %24, 8
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = and i64 %27, -71777214294589696
%29 = lshr i64 %28, 8
%30 = or i64 %25, %29
%31 = trunc i64 %30 to i32
ret i32 %31
}

LLVM IR (-O2):
define i32 @bam_swap_endian_8(i32 %0) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigint_handler(int signum) {
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cleanup@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int globalvar_add_simple(const char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @globalvar_add_simple(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ create_listener_thread();
int /*<<< orphan*/ create_ozy_thread();
int /*<<< orphan*/ init_receivers();
int /*<<< orphan*/ ozy_handle_events();
int /*<<< orphan*/ process_args(int, char **);
int /*<<< orphan*/ usleep(int);
int main(int argc, char *argv[]) {
  process_args(argc, argv);
  init_receivers();
  create_listener_thread();
  create_ozy_thread();
  while (1) {
    ozy_handle_events();
    usleep(200);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <process_args@plt>
mov    $0x0,%al
call   1030 <init_receivers@plt>
mov    $0x0,%al
call   1050 <create_listener_thread@plt>
mov    $0x0,%al
call   1040 <create_ozy_thread@plt>
mov    $0x0,%al
call   1060 <ozy_handle_events@plt>
mov    $0xc8,%edi
call   1080 <usleep@plt>
jmp    1197 <main+0x37>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1070 <process_args@plt>
xor    %eax,%eax
call   1030 <init_receivers@plt>
xor    %eax,%eax
call   1050 <create_listener_thread@plt>
xor    %eax,%eax
call   1040 <create_ozy_thread@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <ozy_handle_events@plt>
mov    $0xc8,%edi
call   1080 <usleep@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @process_args(i32 %6, i8** %7)
%9 = call i32 (...) @init_receivers()
%10 = call i32 (...) @create_listener_thread()
%11 = call i32 (...) @create_ozy_thread()
br label %12
12: ; preds = %2, %12
%13 = call i32 (...) @ozy_handle_events()
%14 = call i32 @usleep(i32 200)
br label %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @process_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @init_receivers()
%5 = tail call i32 (...) @create_listener_thread()
%6 = tail call i32 (...) @create_ozy_thread()
br label %7
7: ; preds = %2, %7
%8 = tail call i32 (...) @ozy_handle_events()
%9 = tail call i32 @usleep(i32 200)
br label %7
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, char *, char *,
                          char *, char *, char *);
int interpret_xyzr(char in_line[100], char xs[10], char ys[10], char zs[10],
                   char rs[6], char res[6], char seq[6], char atom[6]) {
  sscanf(in_line, "%s %s %s %s %s %s %s", xs, ys, zs, rs, res, seq, atom);
  return (1);
}


x86 assembly (clang, -O0):
<interpret_xyzr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r11
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
lea    0xea1(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <sscanf@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpret_xyzr>:
sub    $0x18,%rsp
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
movaps 0x20(%rsp),%xmm0
movups %xmm0,0x8(%rsp)
mov    %r9,(%rsp)
lea    0xecb(%rip),%rsi
mov    %rax,%r9
call   1030 <sscanf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s %s %s %s %s %s %s\00"
define i32 @interpret_xyzr(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i8*, i8** %11
%20 = load i8*, i8** %12
%21 = load i8*, i8** %13
%22 = load i8*, i8** %14
%23 = load i8*, i8** %15
%24 = load i8*, i8** %16
%25 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19, i8* %20, i8* %21, i8* %22, i8* %23, i8* %24)
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s %s %s %s %s %s %s\00"
define i32 @interpret_xyzr(i8* nocapture %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7) {
%9 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7)
ret i32 1
}
/* Type definitions */
struct fid_domain {
  int dummy;
};
struct fid_cq {
  int dummy;
};
struct fi_cq_attr {
  int dummy;
};

/* Variables and functions */
int gnix_cq_open(struct fid_domain *, struct fi_cq_attr *, struct fid_cq **,
                 void *);
int fi_cq_open(struct fid_domain *domain, struct fi_cq_attr *attr,
               struct fid_cq **cq, void *context) {
  return gnix_cq_open(domain, attr, cq, context);
}


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

x86 assembly (clang, -O2):
<fi_cq_open>:
jmp    1030 <gnix_cq_open@plt>

LLVM IR (-O0):
%struct.fid_domain = type { i32 }
%struct.fi_cq_attr = type { i32 }
%struct.fid_cq = type { i32 }
define i32 @fi_cq_open(%struct.fid_domain* %0, %struct.fi_cq_attr* %1, %struct.fid_cq** %2, i8* %3) {
%5 = alloca %struct.fid_domain*
%6 = alloca %struct.fi_cq_attr*
%7 = alloca %struct.fid_cq**
%8 = alloca i8*
store %struct.fid_domain* %0, %struct.fid_domain** %5
store %struct.fi_cq_attr* %1, %struct.fi_cq_attr** %6
store %struct.fid_cq** %2, %struct.fid_cq*** %7
store i8* %3, i8** %8
%9 = load %struct.fid_domain*, %struct.fid_domain** %5
%10 = load %struct.fi_cq_attr*, %struct.fi_cq_attr** %6
%11 = load %struct.fid_cq**, %struct.fid_cq*** %7
%12 = load i8*, i8** %8
%13 = call i32 @gnix_cq_open(%struct.fid_domain* %9, %struct.fi_cq_attr* %10, %struct.fid_cq** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fid_domain = type { i32 }
%struct.fi_cq_attr = type { i32 }
%struct.fid_cq = type { i32 }
define i32 @fi_cq_open(%struct.fid_domain* %0, %struct.fi_cq_attr* %1, %struct.fid_cq** %2, i8* %3) {
%5 = tail call i32 @gnix_cq_open(%struct.fid_domain* %0, %struct.fi_cq_attr* %1, %struct.fid_cq** %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ readlink_dir();
int /*<<< orphan*/ readlink_empty();
int /*<<< orphan*/ readlink_file();
int /*<<< orphan*/ test_readlink_buf();
int /*<<< orphan*/ test_readlink_path();
void test_readlink(void) {
  test_readlink_path();
  test_readlink_buf();
  readlink_file();
  readlink_dir();
  readlink_empty();
}


x86 assembly (clang, -O0):
<test_readlink>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_readlink_path@plt>
mov    $0x0,%al
call   1070 <test_readlink_buf@plt>
mov    $0x0,%al
call   1040 <readlink_file@plt>
mov    $0x0,%al
call   1050 <readlink_dir@plt>
mov    $0x0,%al
call   1060 <readlink_empty@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_readlink>:
push   %rax
xor    %eax,%eax
call   1030 <test_readlink_path@plt>
xor    %eax,%eax
call   1070 <test_readlink_buf@plt>
xor    %eax,%eax
call   1040 <readlink_file@plt>
xor    %eax,%eax
call   1050 <readlink_dir@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <readlink_empty@plt>

LLVM IR (-O0):
define void @test_readlink() {
%1 = call i32 (...) @test_readlink_path()
%2 = call i32 (...) @test_readlink_buf()
%3 = call i32 (...) @readlink_file()
%4 = call i32 (...) @readlink_dir()
%5 = call i32 (...) @readlink_empty()
ret void
}

LLVM IR (-O2):
define void @test_readlink() {
%1 = tail call i32 (...) @test_readlink_path()
%2 = tail call i32 (...) @test_readlink_buf()
%3 = tail call i32 (...) @readlink_file()
%4 = tail call i32 (...) @readlink_dir()
%5 = tail call i32 (...) @readlink_empty()
ret void
}
int fun510() { return 510; }


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

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

LLVM IR (-O0):
define i32 @fun510() {
ret i32 510
}

LLVM IR (-O2):
define i32 @fun510() {
ret i32 510
}
int f5(void) {
  int c[64] = {}, d[64] = {};
  return (long unsigned int)&c[64] != (long unsigned int)&d[0];
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    -0x200(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <memset@plt>
lea    -0x100(%rbp),%rax
add    $0x100,%rax
lea    -0x200(%rbp),%rcx
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x200,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f5() {
%1 = alloca [64 x i32]
%2 = alloca [64 x i32]
%3 = bitcast [64 x i32]* %1 to i8*
%4 = bitcast [64 x i32]* %2 to i8*
%5 = getelementptr inbounds [64 x i32], [64 x i32]* %1, i64 0, i64 64
%6 = ptrtoint i32* %5 to i64
%7 = getelementptr inbounds [64 x i32], [64 x i32]* %2, i64 0, i64 0
%8 = ptrtoint i32* %7 to i64
%9 = icmp ne i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f5() {
ret i32 1
}
/* Variables and functions */
int inb(int);
int i8042_read_status(void) { return inb(0x64); }


x86 assembly (clang, -O0):
<i8042_read_status>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1030 <inb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i8042_read_status>:
mov    $0x64,%edi
jmp    1030 <inb@plt>

LLVM IR (-O0):
define i32 @i8042_read_status() {
%1 = call i32 @inb(i32 100)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i8042_read_status() {
%1 = tail call i32 @inb(i32 100)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
int /*<<< orphan*/ scanf(char *, int *);
int promptValue(const char *invite) {
  int value = 0;
  puts(invite);
  scanf("%d", &value);
  return value;
}


x86 assembly (clang, -O0):
<promptValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<promptValue>:
push   %rax
movl   $0x0,0x4(%rsp)
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @promptValue(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = call i32 @puts(i8* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @promptValue(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = tail call i32 @puts(i8* dereferenceable(1) %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ inspect_flac_file(char *);
int main(int argc, char *argv[]) {
  char *filename;
  filename = "/home/oneman/kode/test1/07 - Nine.flac";
  if (argc == 2) {
    filename = argv[1];
  }
  inspect_flac_file(filename);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1147 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <inspect_flac_file@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    111c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1123 <main+0x13>
lea    0xedd(%rip),%rdi
call   1030 <inspect_flac_file@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"/home/oneman/kode/test1/07 - Nine.flac\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %6
br label %13
13: ; preds = %9, %2
%14 = load i8*, i8** %6
%15 = call i32 @inspect_flac_file(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"/home/oneman/kode/test1/07 - Nine.flac\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @inspect_flac_file(i8* %8)
ret i32 0
}
int main(void) {
  while (1)
    ;
  return 0xDEADBEEF;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int acceptClient(int sockfd, struct sockaddr_in *client_addr) {
  int new_sockfd;
  socklen_t sin_size;
  sin_size = sizeof(struct sockaddr_in);
  new_sockfd = accept(sockfd, (struct sockaddr *)client_addr, &sin_size);
  return new_sockfd;
}


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

x86 assembly (clang, -O2):
<acceptClient>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <accept@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @acceptClient(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %4
store i32 4, i32* %6
%7 = load i32, i32* %3
%8 = load %struct.sockaddr_in*, %struct.sockaddr_in** %4
%9 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%10 = call i32 @accept(i32 %7, %struct.sockaddr* %9, i32* %6)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @acceptClient(i32 %0, %struct.sockaddr_in* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%5 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%6 = call i32 @accept(i32 %0, %struct.sockaddr* %5, i32* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ eruConfigureETL2(int, int, int);
int /*<<< orphan*/ eruConfigureOGU0(int);
int /*<<< orphan*/ eruEnable();
void configureERU(void) {
  eruEnable();
  eruConfigureETL2(1, 2,
                   (1 << 0) | (1 << 1) | (0 << 2) | (1 << 3) | (0 << 4) |
                       (0 << 8) | (0 << 10) | (0 << 11));
  eruConfigureOGU0((0 << 0) | (0 << 2) | (1 << 4) | (1 << 14));
}


x86 assembly (clang, -O0):
<configureERU>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <eruEnable@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xb,%edx
call   1030 <eruConfigureETL2@plt>
mov    $0x4010,%edi
call   1050 <eruConfigureOGU0@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureERU>:
push   %rax
xor    %eax,%eax
call   1040 <eruEnable@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xb,%edx
call   1030 <eruConfigureETL2@plt>
mov    $0x4010,%edi
pop    %rax
jmp    1050 <eruConfigureOGU0@plt>

LLVM IR (-O0):
define void @configureERU() {
%1 = call i32 (...) @eruEnable()
%2 = call i32 @eruConfigureETL2(i32 1, i32 2, i32 11)
%3 = call i32 @eruConfigureOGU0(i32 16400)
ret void
}

LLVM IR (-O2):
define void @configureERU() {
%1 = tail call i32 (...) @eruEnable()
%2 = tail call i32 @eruConfigureETL2(i32 1, i32 2, i32 11)
%3 = tail call i32 @eruConfigureOGU0(i32 16400)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hfp_subevent_network_operator_changed_get_network_operator_mode(
    const uint8_t *event) {
  return event[3];
}


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

x86 assembly (clang, -O2):
<hfp_subevent_network_operator_changed_get_network_operator_mode>:
mov    0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hfp_subevent_network_operator_changed_get_network_operator_mode(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hfp_subevent_network_operator_changed_get_network_operator_mode(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}