xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ app_init();
int /*<<< orphan*/ buf_destroy();
int /*<<< orphan*/ buf_init();
int /*<<< orphan*/ putter();
int main(int argc, char *argv[]) {
  app_init();
  buf_init();
  putter();
  buf_destroy();
  return 0;
}


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    $0x0,%al
call   1030 <app_init@plt>
mov    $0x0,%al
call   1050 <buf_init@plt>
mov    $0x0,%al
call   1040 <putter@plt>
mov    $0x0,%al
call   1060 <buf_destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <app_init@plt>
xor    %eax,%eax
call   1050 <buf_init@plt>
xor    %eax,%eax
call   1040 <putter@plt>
xor    %eax,%eax
call   1060 <buf_destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

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 = call i32 (...) @app_init()
%7 = call i32 (...) @buf_init()
%8 = call i32 (...) @putter()
%9 = call i32 (...) @buf_destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @app_init()
%4 = tail call i32 (...) @buf_init()
%5 = tail call i32 (...) @putter()
%6 = tail call i32 (...) @buf_destroy()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ WIFSTOPPED(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int wait(int *);
void wsigtrap(int stat) {
  int ret;
  do {
    ret = wait(&stat);
    if (ret == -1) {
      perror("wait");
      exit(1);
    }
  } while (!WIFSTOPPED(stat));
}


x86 assembly (clang, -O0):
<wsigtrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1060 <wait@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1177 <wsigtrap+0x37>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    117c <wsigtrap+0x3c>
mov    -0x4(%rbp),%edi
call   1030 <WIFSTOPPED@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114b <wsigtrap+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wsigtrap>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1060 <wait@plt>
cmp    $0xffffffff,%eax
je     1170 <wsigtrap+0x30>
mov    0xc(%rsp),%edi
call   1030 <WIFSTOPPED@plt>
test   %eax,%eax
je     1150 <wsigtrap+0x10>
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe89(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"wait\00"
define void @wsigtrap(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %12, %1
%5 = call i32 @wait(i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %2
%14 = call i32 @WIFSTOPPED(i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %4, label %17
17: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"wait\00"
define void @wsigtrap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %9, %1
%4 = call i32 @wait(i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 @WIFSTOPPED(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %3, label %13
13: ; preds = %9
ret void
}
/* Variables and functions */
int bbm_hostif_select(void *, unsigned char);
int bbm_com_hostif_select(void *handle, unsigned char hostif) {
  int res = 1;
  res = bbm_hostif_select(handle, hostif);
  return res;
}


x86 assembly (clang, -O0):
<bbm_com_hostif_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%esi
call   1030 <bbm_hostif_select@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bbm_com_hostif_select>:
jmp    1030 <bbm_hostif_select@plt>

LLVM IR (-O0):
define i32 @bbm_com_hostif_select(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 1, i32* %5
%6 = load i8*, i8** %3
%7 = load i8, i8* %4
%8 = call i32 @bbm_hostif_select(i8* %6, i8 zeroext %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @bbm_com_hostif_select(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @bbm_hostif_select(i8* %0, i8 zeroext %1)
ret i32 %3
}
void cvmx_fpa_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @cvmx_fpa_enable() {
ret void
}
void RTSemPing(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemPing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("Usage: nsense <options> <source files>");
  printf("\nwhere possible options include:");
  printf("\n  -h or -help\t\t for more help");
  printf("\n  -v or -version\t for check version");
  printf("\n  .ns \t\t\t compile and execute .ns extension class file");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
lea    0xf2b(%rip),%rdi
call   1030 <printf@plt>
lea    0xf44(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage: nsense <options> <source files>\00"
@.str.1 = [33 x i8] c"\0Awhere possible options include:\00"
@.str.2 = [31 x i8] c"\0A -h or -help\09\09 for more help\00"
@.str.3 = [37 x i8] c"\0A -v or -version\09 for check version\00"
@.str.4 = [56 x i8] c"\0A .ns \09\09\09 compile and execute .ns extension class file\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage: nsense <options> <source files>\00"
@.str.1 = [33 x i8] c"\0Awhere possible options include:\00"
@.str.2 = [31 x i8] c"\0A -h or -help\09\09 for more help\00"
@.str.3 = [37 x i8] c"\0A -v or -version\09 for check version\00"
@.str.4 = [56 x i8] c"\0A .ns \09\09\09 compile and execute .ns extension class file\00"
define void @help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
const char *getblksiz(int bs) {
  static char buf[25];
  if (bs == 0)
    return "variable";
  else {
    sprintf(buf, "%d bytes", bs);
    return buf;
  }
}


x86 assembly (clang, -O0):
<getblksiz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1135 <getblksiz+0x25>
lea    0xed4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <getblksiz+0x46>
mov    -0xc(%rbp),%edx
lea    0x2f01(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2eee(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getblksiz>:
push   %rbx
test   %edi,%edi
je     112f <getblksiz+0x1f>
mov    %edi,%edx
lea    0x2f22(%rip),%rbx
lea    0xee4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1136 <getblksiz+0x26>
lea    0xeca(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@getblksiz.buf = internal global [25 x i8] zeroinitializer
@.str = [9 x i8] c"variable\00"
@.str.1 = [9 x i8] c"%d bytes\00"
define i8* @getblksiz(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @sprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @getblksiz.buf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
store i8* getelementptr inbounds ([25 x i8], [25 x i8]* @getblksiz.buf, i64 0, i64 0), i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@getblksiz.buf = internal global [25 x i8] zeroinitializer
@.str = [9 x i8] c"variable\00"
@.str.1 = [9 x i8] c"%d bytes\00"
define i8* @getblksiz(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @getblksiz.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @getblksiz.buf, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %6
}
/* Variables and functions */
int fibonacci(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  for (i = 1; i <= 40; i++) {
    printf("\n\t\tGeneration %d: %d", i, fibonacci(i));
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x28,-0x8(%rbp)
jg     116f <main+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <fibonacci@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xec0(%rip),%r14
mov    %ebx,%edi
call   1050 <fibonacci@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x29,%ebx
jne    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"\0A\09\09Generation %d: %d\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 40
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @fibonacci(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\0A\09\09Generation %d: %d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %5, %1 ]
%3 = tail call i32 @fibonacci(i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 41
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ITIMER_REAL;
int /*<<< orphan*/ err_msg(char *);
int setitimer(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void dlinfo_sigalrm_detach(void) {
  if (setitimer(ITIMER_REAL, NULL, NULL) == -1)
    err_msg("setitimer");
}


x86 assembly (clang, -O0):
<dlinfo_sigalrm_detach>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <setitimer@plt>
cmp    $0xffffffff,%eax
jne    114e <dlinfo_sigalrm_detach+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <err_msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlinfo_sigalrm_detach>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <setitimer@plt>
cmp    $0xffffffff,%eax
je     113a <dlinfo_sigalrm_detach+0x1a>
pop    %rax
ret
lea    0xebf(%rip),%rdi
pop    %rax
jmp    1040 <err_msg@plt>

LLVM IR (-O0):
@ITIMER_REAL = global i32 0
@.str = [10 x i8] c"setitimer\00"
define void @dlinfo_sigalrm_detach() {
%1 = load i32, i32* @ITIMER_REAL
%2 = call i32 @setitimer(i32 %1, i32* null, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @err_msg(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@ITIMER_REAL = global i32 0
@.str = [10 x i8] c"setitimer\00"
define void @dlinfo_sigalrm_detach() {
%1 = load i32, i32* @ITIMER_REAL
%2 = tail call i32 @setitimer(i32 %1, i32* null, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @err_msg(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tty_getc_irq(void *);
int /*<<< orphan*/ tty_puts(char *);
int main() {
  volatile char c;
  while (1) {
    tty_puts("hello world\n");
    tty_getc_irq((void *)&c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <tty_puts@plt>
lea    -0x5(%rbp),%rdi
call   1040 <tty_getc_irq@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x7(%rsp),%rbx
mov    %r14,%rdi
call   1030 <tty_puts@plt>
mov    %rbx,%rdi
call   1040 <tty_getc_irq@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @tty_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @tty_getc_irq(i8* %2)
br label %3
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @tty_puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @tty_getc_irq(i8* %1)
br label %2
}
f() {
  struct A {
    int i;
  } a;
  a.i = 5;
  return a.i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i32 }
define i32 @f() {
%1 = alloca %struct.A
%2 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 0
store i32 5, i32* %2
%3 = getelementptr inbounds %struct.A, %struct.A* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @f() {
ret i32 5
}
int search(unsigned int n, unsigned int *x, unsigned int v) {
  unsigned int i = 0;
  while (i < n) {
    if (x[i] == v)
      return 1;
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    114e <search+0x4e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1140 <search+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1155 <search+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
test   %edi,%edi
je     111e <search+0x1e>
mov    %edi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edx,(%rsi,%rcx,4)
je     1121 <search+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <search+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %2
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Type definitions */
struct _Locale_numeric {
  int dummy;
};
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_numeric *_Locale_numeric_create(const char *name,
                                               struct _Locale_name_hint *hint
                                               __attribute__((__unused__)),
                                               int *__err_code) {
  return (struct _Locale_numeric *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_numeric_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_numeric = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_numeric* @_Locale_numeric_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_numeric*
ret %struct._Locale_numeric* %10
}

LLVM IR (-O2):
%struct._Locale_numeric = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_numeric* @_Locale_numeric_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_numeric*
ret %struct._Locale_numeric* %5
}
/* Variables and functions */
int get_flag(int);
bool get_subtract() { return get_flag(6); }


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

x86 assembly (clang, -O2):
<get_subtract>:
mov    $0x6,%edi
jmp    1030 <get_flag@plt>

LLVM IR (-O0):
define i32 @get_subtract() {
%1 = call i32 @get_flag(i32 6)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_subtract() {
%1 = tail call i32 @get_flag(i32 6)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fopen_t01();
int /*<<< orphan*/ fopen_t02();
int /*<<< orphan*/ printf(char *);
int fopen_main() {
  assert(fopen_t01());
  assert(fopen_t02());
  printf("fopen ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<fopen_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fopen_t01@plt>
mov    %eax,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1060 <fopen_t02@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_main>:
push   %rax
xor    %eax,%eax
call   1040 <fopen_t01@plt>
mov    %eax,%edi
call   1050 <assert@plt>
xor    %eax,%eax
call   1060 <fopen_t02@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"fopen ok\0A\00"
define i32 @fopen_main() {
%1 = call i32 (...) @fopen_t01()
%2 = call i32 @assert(i32 %1)
%3 = call i32 (...) @fopen_t02()
%4 = call i32 @assert(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"fopen ok\00"
define i32 @fopen_main() {
%1 = tail call i32 (...) @fopen_t01()
%2 = tail call i32 @assert(i32 %1)
%3 = tail call i32 (...) @fopen_t02()
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Trying to open test.c");
  FILE *f = fopen("test.c", "r");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Trying to open test.c\00"
@.str.1 = [7 x i8] c"test.c\00"
@.str.2 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %3, i32** %1
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Trying to open test.c\00"
@.str.1 = [7 x i8] c"test.c\00"
@.str.2 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ im_a_minion_03();
void testFuncBreak(void) {
  int i = 1U;
  for (i = 1U; i < 10U; i++) {
    if (i > 0U) {
      break;
    }
    im_a_minion_03();
  }
}


x86 assembly (clang, -O0):
<testFuncBreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jae    1154 <testFuncBreak+0x44>
cmpl   $0x0,-0x4(%rbp)
jbe    113f <testFuncBreak+0x2f>
jmp    1154 <testFuncBreak+0x44>
mov    $0x0,%al
call   1030 <im_a_minion_03@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <testFuncBreak+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @testFuncBreak() {
ret void
}
int test_imm_78uint16_reg(unsigned short val) {
  return ((val) & (-0x78 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_78uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff88,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_78uint16_reg>:
test   $0xff88,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_78uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -120
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int is_end_of_key(const char c) { return (c == '='); }


x86 assembly (clang, -O0):
<is_end_of_key>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end_of_key>:
xor    %eax,%eax
cmp    $0x3d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_end_of_key(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 61
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_end_of_key(i8 signext %0) {
%2 = icmp eq i8 %0, 61
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned long cast(double);
unsigned long int myround(double value) {
  unsigned long int intpart = cast(value);
  return ((value -= intpart) < 0.5) ? intpart : intpart + 1;
}


x86 assembly (clang, -O0):
<myround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cast@plt>
mov    %rax,-0x10(%rbp)
movaps 0xede(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xedd(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rbp)
movsd  0xe98(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    117f <myround+0x6f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    118b <myround+0x7b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myround>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <cast@plt>
movq   %rax,%xmm0
punpckldq 0xed8(%rip),%xmm0
subpd  0xee0(%rip),%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
addsd  %xmm0,%xmm1
movsd  (%rsp),%xmm2
subsd  %xmm1,%xmm2
movsd  0xed3(%rip),%xmm0
xor    %ecx,%ecx
ucomisd %xmm2,%xmm0
setbe  %cl
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @myround(double %0) {
%2 = alloca double
%3 = alloca i64
store double %0, double* %2
%4 = load double, double* %2
%5 = call i64 @cast(double %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = uitofp i64 %6 to double
%8 = load double, double* %2
%9 = fsub double %8, %7
store double %9, double* %2
%10 = fcmp olt double %9, 5.000000e-01
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i64, i64* %3
br label %16
13: ; preds = %1
%14 = load i64, i64* %3
%15 = add i64 %14, 1
br label %16
16: ; preds = %13, %11
%17 = phi i64 [ %12, %11 ], [ %15, %13 ]
ret i64 %17
}

LLVM IR (-O2):
define i64 @myround(double %0) {
%2 = tail call i64 @cast(double %0)
%3 = uitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fcmp uge double %4, 5.000000e-01
%6 = zext i1 %5 to i64
%7 = add i64 %2, %6
ret i64 %7
}
/* Type definitions */
struct rtattr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ RTA_DATA(struct rtattr *);
int /*<<< orphan*/ RTA_PAYLOAD(struct rtattr *);
int /*<<< orphan*/ rtnl_parse(struct rtattr **, int, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void rtnl_parse_nested(struct rtattr *tb[], int max, struct rtattr *rta) {
  rtnl_parse(tb, max, RTA_DATA(rta), RTA_PAYLOAD(rta));
}


x86 assembly (clang, -O0):
<rtnl_parse_nested>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <RTA_DATA@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <RTA_PAYLOAD@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1040 <rtnl_parse@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtnl_parse_nested>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rdx,%rdi
call   1050 <RTA_DATA@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <RTA_PAYLOAD@plt>
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <rtnl_parse@plt>

LLVM IR (-O0):
%struct.rtattr = type { i32 }
define void @rtnl_parse_nested(%struct.rtattr** %0, i32 %1, %struct.rtattr* %2) {
%4 = alloca %struct.rtattr**
%5 = alloca i32
%6 = alloca %struct.rtattr*
store %struct.rtattr** %0, %struct.rtattr*** %4
store i32 %1, i32* %5
store %struct.rtattr* %2, %struct.rtattr** %6
%7 = load %struct.rtattr**, %struct.rtattr*** %4
%8 = load i32, i32* %5
%9 = load %struct.rtattr*, %struct.rtattr** %6
%10 = call i32 @RTA_DATA(%struct.rtattr* %9)
%11 = load %struct.rtattr*, %struct.rtattr** %6
%12 = call i32 @RTA_PAYLOAD(%struct.rtattr* %11)
%13 = call i32 @rtnl_parse(%struct.rtattr** %7, i32 %8, i32 %10, i32 %12)
ret void
}

LLVM IR (-O2):
%struct.rtattr = type { i32 }
define void @rtnl_parse_nested(%struct.rtattr** %0, i32 %1, %struct.rtattr* %2) {
%4 = tail call i32 @RTA_DATA(%struct.rtattr* %2)
%5 = tail call i32 @RTA_PAYLOAD(%struct.rtattr* %2)
%6 = tail call i32 @rtnl_parse(%struct.rtattr** %0, i32 %1, i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ listen(int, size_t);
int /*<<< orphan*/ stderr;
void _startListening(int _serverSocket, size_t _maxConnections) {
  if (listen(_serverSocket, _maxConnections) < 0) {
    fprintf(stderr, "Error: Listening.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<_startListening>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <listen@plt>
cmp    $0x0,%rax
jge    1178 <_startListening+0x48>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_startListening>:
push   %rax
call   1040 <listen@plt>
test   %rax,%rax
js     113d <_startListening+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error: Listening.\0A\00"
@EXIT_FAILURE = global i32 0
define void @_startListening(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = call i64 @listen(i32 %5, i64 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error: Listening.\0A\00"
@EXIT_FAILURE = global i32 0
define void @_startListening(i32 %0, i64 %1) {
%3 = tail call i64 @listen(i32 %0, i64 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret void
}
void rop3_9_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D ^ S;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_9_1_0>:
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 -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%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_9_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
or     %esi,%edx
or     %cl,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_9_1_0(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* %5
%13 = zext i8 %12 to i32
%14 = xor i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%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 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = trunc i32 %38 to i8
%40 = load i8*, i8** %4
store i8 %39, i8* %40
ret void
}

LLVM IR (-O2):
define void @rop3_9_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = or i8 %2, %1
%7 = or i8 %6, %5
%8 = xor i8 %7, -1
%9 = and i8 %4, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long long f4(unsigned long long x,
                                                   unsigned long long y) {
  unsigned long long r = x - y;
  if (x >= r)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jb     1141 <f4+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
push   %rbx
mov    %rdi,%rbx
sub    %rsi,%rbx
jb     1120 <f4+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @f4(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sub i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %5
%11 = icmp uge i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @f4(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @foo(i32 0)
br label %6
6: ; preds = %4, %2
%7 = sub i64 %0, %1
ret i64 %7
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int comp(char s2[10], char s3[10]) {
  if (strcmp(s2, s3) > 0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jle    1143 <comp+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <comp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @comp(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp sgt i64 %3, 0
%5 = select i1 %4, i32 1, i32 -1
ret i32 %5
}
char removeCastlingRights(char original_rights, char removed_rights) {
  return (char)(original_rights & ~(removed_rights));
}


x86 assembly (clang, -O0):
<removeCastlingRights>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeCastlingRights>:
mov    %esi,%eax
not    %al
and    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @removeCastlingRights(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @removeCastlingRights(i8 signext %0, i8 signext %1) {
%3 = xor i8 %1, -1
%4 = and i8 %3, %0
ret i8 %4
}
void rop3_244_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_244_1_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
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%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_244_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_244_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
int c() { return 12; }


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

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

LLVM IR (-O0):
define i32 @c() {
ret i32 12
}

LLVM IR (-O2):
define i32 @c() {
ret i32 12
}
/* Variables and functions */
int yogrt_get_interval2();
int iyogrt_get_interval2_(void) { return yogrt_get_interval2(); }


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

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

LLVM IR (-O0):
define i32 @iyogrt_get_interval2_() {
%1 = call i32 (...) @yogrt_get_interval2()
ret i32 %1
}

LLVM IR (-O2):
define i32 @iyogrt_get_interval2_() {
%1 = tail call i32 (...) @yogrt_get_interval2()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ si475xAMRX_powerdown();
void si47xxAMRX_powerdown(void) { si475xAMRX_powerdown(); }


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

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

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

LLVM IR (-O2):
define void @si47xxAMRX_powerdown() {
%1 = tail call i32 (...) @si475xAMRX_powerdown()
ret void
}
double geom_dV_cart(double *x, double *dx) { return dx[0] * dx[1] * dx[3]; }


x86 assembly (clang, -O0):
<geom_dV_cart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x18(%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<geom_dV_cart>:
movsd  (%rsi),%xmm0
mulsd  0x8(%rsi),%xmm0
mulsd  0x18(%rsi),%xmm0
ret

LLVM IR (-O0):
define double @geom_dV_cart(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 1
%10 = load double, double* %9
%11 = fmul double %7, %10
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 3
%14 = load double, double* %13
%15 = fmul double %11, %14
ret double %15
}

LLVM IR (-O2):
define double @geom_dV_cart(double* nocapture readnone %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = fmul double %3, %5
%7 = getelementptr inbounds double, double* %1, i64 3
%8 = load double, double* %7
%9 = fmul double %6, %8
ret double %9
}
void ff_hevc_put_hevc_uni_qpel_h8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h8_8_sse4() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_initialize_number_of_multprec_Laurentials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(573, &length, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_initialize_number_of_multprec_Laurentials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x23d,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_multprec_Laurentials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 573, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}