xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ twoSum(int *, int, int, int *, int *);
int main() {
  int a[] = {1, 2, 3, 3, 5, 6};
  int b, c;
  twoSum(a, 6, 9, &b, &c);
  printf("%d %d\n", b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
call   1040 <twoSum@plt>
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x6,%esi
mov    $0x9,%edx
call   1040 <twoSum@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [6 x i32] [i32 1, i32 2, i32 3, i32 3, i32 5, i32 6]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%7 = call i32 @twoSum(i32* %6, i32 6, i32 9, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i32] [i32 1, i32 2, i32 3, i32 3, i32 5, i32 6]
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = alloca i32
%4 = bitcast [6 x i32]* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%8 = call i32 @twoSum(i32* %7, i32 6, i32 9, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}
int main() {
  int m, n;
  int a[10], b[10];
  int i, j;
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      a[i] = 1;
    }
    for (j = 0; j < n; j++) {
      b[i] -= 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    118e <main+0x8e>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114b <main+0x4b>
movslq -0x74(%rbp),%rax
movl   $0x1,-0x40(%rbp,%rax,4)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1125 <main+0x25>
movl   $0x0,-0x78(%rbp)
mov    -0x78(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117b <main+0x7b>
movslq -0x74(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%ecx
sub    $0x1,%ecx
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1152 <main+0x52>
jmp    1180 <main+0x80>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
%5 = alloca [10 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
br label %8
8: ; preds = %39, %0
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %42
12: ; preds = %8
store i32 0, i32* %7
br label %13
13: ; preds = %21, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %19
store i32 1, i32* %20
br label %21
21: ; preds = %17
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
store i32 %23, i32* %7
br label %13
24: ; preds = %13
store i32 0, i32* %7
br label %25
25: ; preds = %35, %24
%26 = load i32, i32* %7
%27 = load i32, i32* %3
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %38
29: ; preds = %25
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = sub nsw i32 %33, 1
store i32 %34, i32* %32
br label %35
35: ; preds = %29
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %25
38: ; preds = %25
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %8
42: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int intLq(const void *i1, const void *i2) {
  return (*((int *)i1) <= *((int *)i2));
  ;
}


x86 assembly (clang, -O0):
<intLq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intLq>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setle  %al
ret

LLVM IR (-O0):
define i32 @intLq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sle i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @intLq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sle i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int redirect_stdout_to_file(char *);
int default_open_report_file(char *path,
                             __attribute__((unused)) void *report_data) {
  return redirect_stdout_to_file(path);
}


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

x86 assembly (clang, -O2):
<default_open_report_file>:
jmp    1030 <redirect_stdout_to_file@plt>

LLVM IR (-O0):
define i32 @default_open_report_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @redirect_stdout_to_file(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @default_open_report_file(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @redirect_stdout_to_file(i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ main_loop();
int main() {
  main_loop();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <main_loop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @main_loop()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main_loop()
ret i32 0
}
char CAS2(volatile void *addr, volatile void *v1, volatile long v2, void *n1,
          long n2) {
  register char ret;
  __asm__ __volatile__("# CAS2 \n\t"
                       "lock ; "
                       "cmpxchg8b (%1) \n\t"
                       "sete %0               \n\t"
                       : "=a"(ret)
                       : "D"(addr), "d"(v2), "a"(v1), "b"(n1), "c"(n2));
  return ret;
}


x86 assembly (clang, -O0):
<CAS2>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rbx
mov    -0x30(%rbp),%rcx
lock cmpxchg8b (%rdi)
sete   %al
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAS2>:
push   %rbx
mov    %rcx,%rbx
mov    %rsi,%rax
mov    %rdx,-0x8(%rsp)
mov    -0x8(%rsp),%rdx
mov    %r8,%rcx
lock cmpxchg8b (%rdi)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @CAS2(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8
store i8* %0, i8** %6
store i8* %1, i8** %7
store volatile i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%12 = load i8*, i8** %6
%13 = load volatile i64, i64* %8
%14 = load i8*, i8** %7
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = call i8 asm sideeffect "# CAS2 \0A\09lock ; cmpxchg8b ($1) \0A\09sete $0 \0A\09", "={ax},{di},{dx},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %12, i64 %13, i8* %14, i8* %15, i64 %16)
store i8 %17, i8* %11
%18 = load i8, i8* %11
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @CAS2(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i64
store volatile i64 %2, i64* %6
%7 = load volatile i64, i64* %6
%8 = tail call i8 asm sideeffect "# CAS2 \0A\09lock ; cmpxchg8b ($1) \0A\09sete $0 \0A\09", "={ax},{di},{dx},{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 %7, i8* %1, i8* %3, i64 %4)
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void Epoll_Close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<Epoll_Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @Epoll_Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_info(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/migrate_ATHLETICS.c",
            351, "[ INFO ] at %s:%d ,info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/migrate_ATHLETICS.c",
            351, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x15f,%r8d
lea    0xf6f(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_info>:
mov    %rdi,%r9
lea    0xf89(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x15f,%esi
mov    $0x15f,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/migrate_ATHLETICS.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 351, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 351, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/migrate_ATHLETICS.c\00"
@.str.1 = [29 x i8] c"[ INFO ] at %s:%d ,info: %s\0A\00"
define void @log_info(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 351, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 351, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int get_number(void) {
  int x = 10;
  printf("we got %d\n", x);
  puts("we got a number");
  return 9001;
}


x86 assembly (clang, -O0):
<get_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2329,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2329,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"we got %d\0A\00"
@.str.1 = [16 x i8] c"we got a number\00"
define i32 @get_number() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 9001
}

LLVM IR (-O2):
@.str = [11 x i8] c"we got %d\0A\00"
@.str.1 = [16 x i8] c"we got a number\00"
define i32 @get_number() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret i32 9001
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ clang_analyzer_warnIfReached();
void condition_constrained_false_after_loop() {
  int i = 0;
  while (i < 50) {
    ++i;
  }
  clang_analyzer_eval(i >= 50);
  clang_analyzer_warnIfReached();
}


x86 assembly (clang, -O0):
<condition_constrained_false_after_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jge    1147 <condition_constrained_false_after_loop+0x27>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <condition_constrained_false_after_loop+0xf>
cmpl   $0x32,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <clang_analyzer_eval@plt>
mov    $0x0,%al
call   1040 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_constrained_false_after_loop>:
push   %rax
mov    $0x1,%edi
call   1030 <clang_analyzer_eval@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clang_analyzer_warnIfReached@plt>

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

LLVM IR (-O2):
define void @condition_constrained_false_after_loop() {
%1 = tail call i32 @clang_analyzer_eval(i32 1)
%2 = tail call i32 (...) @clang_analyzer_warnIfReached()
ret void
}
__attribute__((ms_abi)) int foo(void) { return 0; }


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

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

LLVM IR (-O0):
define win64cc i32 @foo() {
ret i32 0
}

LLVM IR (-O2):
define win64cc i32 @foo() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int timlib_string_until_character_matches(char *, char *, char);
void test_string_until_character_matches(void) {
  char *source = "quick_ratio^whatever";
  char *compare = "quick_ratio";
  printf("should be 1: is = %d\n",
         timlib_string_until_character_matches(source, compare, '^'));
}


x86 assembly (clang, -O0):
<test_string_until_character_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5e,%edx
call   1040 <timlib_string_until_character_matches@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_string_until_character_matches>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x5e,%edx
call   1040 <timlib_string_until_character_matches@plt>
lea    0xee1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"quick_ratio^whatever\00"
@.str.1 = [12 x i8] c"quick_ratio\00"
@.str.2 = [22 x i8] c"should be 1: is = %d\0A\00"
define void @test_string_until_character_matches() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @timlib_string_until_character_matches(i8* %3, i8* %4, i8 signext 94)
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"quick_ratio^whatever\00"
@.str.1 = [12 x i8] c"quick_ratio\00"
@.str.2 = [22 x i8] c"should be 1: is = %d\0A\00"
define void @test_string_until_character_matches() {
%1 = tail call i32 @timlib_string_until_character_matches(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8 signext 94)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
float sqrtf(float);
float Geometry_distance_between_coordinates(float x1, float y1, float x2,
                                            float y2) {
  return sqrtf((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}


x86 assembly (clang, -O0):
<Geometry_distance_between_coordinates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
subss  -0xc(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm3
subss  -0x10(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Geometry_distance_between_coordinates>:
subss  %xmm2,%xmm0
subss  %xmm3,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <Geometry_distance_between_coordinates+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @Geometry_distance_between_coordinates(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %7
%11 = fsub float %9, %10
%12 = load float, float* %5
%13 = load float, float* %7
%14 = fsub float %12, %13
%15 = load float, float* %6
%16 = load float, float* %8
%17 = fsub float %15, %16
%18 = load float, float* %6
%19 = load float, float* %8
%20 = fsub float %18, %19
%21 = fmul float %17, %20
%22 = call float @llvm.fmuladd.f32(float %11, float %14, float %21)
%23 = call float @sqrtf(float %22)
ret float %23
}

LLVM IR (-O2):
define float @Geometry_distance_between_coordinates(float %0, float %1, float %2, float %3) {
%5 = fsub float %0, %2
%6 = fsub float %1, %3
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrtf(float %8)
ret float %9
}
/* Variables and functions */
int SIGALRM;
void SIG_IGN(int);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int, void (*)(int));
void signalHandler(int signo) {
  signal(signo, SIG_IGN);
  printf("SIGALRM delivered to process: %d\n", getpid());
  signal(SIGALRM, signalHandler);
}


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rsi
call   1050 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    0x2e71(%rip),%rsi
call   1050 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandler>:
push   %rax
mov    0x2ea0(%rip),%rsi
call   1050 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    0x2e7e(%rip),%rsi
pop    %rax
jmp    1050 <signal@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"SIGALRM delivered to process: %d\0A\00"
@SIGALRM = global i32 0
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @signal(i32 %3, void (i32)* @SIG_IGN)
%5 = call i32 (...) @getpid()
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @SIGALRM
%8 = call i32 @signal(i32 %7, void (i32)* @signalHandler)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"SIGALRM delivered to process: %d\0A\00"
@SIGALRM = global i32 0
define void @signalHandler(i32 %0) {
%2 = tail call i32 @signal(i32 %0, void (i32)* @SIG_IGN)
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @SIGALRM
%6 = tail call i32 @signal(i32 %5, void (i32)* @signalHandler)
ret void
}
void camc_q(const int c, const int n, const int a, const int f, int *q) {
  *q = 1;
}


x86 assembly (clang, -O0):
<camc_q>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<camc_q>:
movl   $0x1,(%r8)
ret

LLVM IR (-O0):
define void @camc_q(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32* %4, i32** %10
%11 = load i32*, i32** %10
store i32 1, i32* %11
ret void
}

LLVM IR (-O2):
define void @camc_q(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4) {
store i32 1, i32* %4
ret void
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t ml_clamp(int16_t low, int16_t high, int16_t value) {
  if (value < low)
    return low;
  else if (value > high)
    return high;
  else
    return value;
}


x86 assembly (clang, -O0):
<ml_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <ml_clamp+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <ml_clamp+0x4e>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <ml_clamp+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <ml_clamp+0x4e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ml_clamp>:
mov    %rsi,%rax
cmp    %rsi,%rdx
cmovle %rdx,%rax
cmp    %rdi,%rdx
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @ml_clamp(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %2, %0
%5 = icmp sgt i64 %2, %1
%6 = select i1 %5, i64 %1, i64 %2
%7 = select i1 %4, i64 %0, i64 %6
ret i64 %7
}
void readKeyboard() { ; }


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

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

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

LLVM IR (-O2):
define void @readKeyboard() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ say_stop(char *, int);
void push(void) { say_stop("Ugh, stupid rocks.", 1); }


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

x86 assembly (clang, -O2):
<push>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say_stop@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Ugh, stupid rocks.\00"
define void @push() {
%1 = call i32 @say_stop(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Ugh, stupid rocks.\00"
define void @push() {
%1 = tail call i32 @say_stop(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
long double __q_tand(long double *);
long double intr_wrap_083(long double p1) { return __q_tand(&p1); }


x86 assembly (clang, -O0):
<intr_wrap_083>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <__q_tand@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_083>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
mov    %rsp,%rdi
call   1030 <__q_tand@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @intr_wrap_083(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 @__q_tand(x86_fp80* %2)
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_083(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 @__q_tand(x86_fp80* %2)
ret x86_fp80 %3
}
int is_add_precedence_op(const char *token) {
  char c;
  c = token[0];
  return c == '+' || c == '-';
}


x86 assembly (clang, -O0):
<is_add_precedence_op>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0xa(%rbp)
je     1130 <is_add_precedence_op+0x30>
movsbl -0x9(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_add_precedence_op>:
mov    (%rdi),%cl
add    $0xd5,%cl
xor    %eax,%eax
test   $0xfd,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_add_precedence_op(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 43
br i1 %9, label %14, label %10
10: ; preds = %1
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br label %14
14: ; preds = %10, %1
%15 = phi i1 [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_add_precedence_op(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 43
%4 = icmp eq i8 %2, 45
%5 = or i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exchange(int, int, int);
int main() {
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  exchange(lower, upper, step);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12c,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <exchange@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x12c,%esi
mov    $0x14,%edx
call   1030 <exchange@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 300, i32* %2
store i32 20, i32* %3
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @exchange(i32 %4, i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exchange(i32 0, i32 300, i32 20)
ret i32 0
}
void __outb_p(unsigned char value, unsigned short port) {
  __asm__ __volatile__("out"
                       "b"
                       " %"
                       "b"
                       "0,%"
                       "w"
                       "1"
                       :
                       : "a"(value), "d"(port));
  __asm__ __volatile__("outb %al,$0x80");
}


x86 assembly (clang, -O0):
<__outb_p>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<__outb_p>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
out    %al,$0x80
ret

LLVM IR (-O0):
define void @__outb_p(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @__outb_p(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb ${0:b},${1:w}", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
tail call void asm sideeffect "outb %al,$$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long, long);
long getMaxW();
int /*<<< orphan*/ stderr;
void printCoords(long c) {
  fprintf(stderr, "[%ld, %ld]\n", c % getMaxW(), c / getMaxW());
}


x86 assembly (clang, -O0):
<printCoords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <getMaxW@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1040 <getMaxW@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe7d(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCoords>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%r14d
xor    %eax,%eax
call   1040 <getMaxW@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1151 <printCoords+0x31>
mov    %rbx,%rax
cqto
idiv   %rcx
mov    %rdx,%rbp
jmp    1159 <printCoords+0x39>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ebp
xor    %eax,%eax
call   1040 <getMaxW@plt>
mov    %rax,%rcx
or     %rbx,%rax
shr    $0x20,%rax
je     1176 <printCoords+0x56>
mov    %rbx,%rax
cqto
idiv   %rcx
jmp    117c <printCoords+0x5c>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
lea    0xe7d(%rip),%rsi
mov    %r14d,%edi
mov    %rbp,%rdx
mov    %rax,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"[%ld, %ld]\0A\00"
define void @printCoords(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stderr
%4 = load i64, i64* %2
%5 = call i64 (...) @getMaxW()
%6 = srem i64 %4, %5
%7 = load i64, i64* %2
%8 = call i64 (...) @getMaxW()
%9 = sdiv i64 %7, %8
%10 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %9)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"[%ld, %ld]\0A\00"
define void @printCoords(i64 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 (...) @getMaxW()
%4 = srem i64 %0, %3
%5 = tail call i64 (...) @getMaxW()
%6 = sdiv i64 %0, %5
%7 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %6)
ret void
}
int is_func(char *s, int size, int (*func)(int)) {
  char *p = s;
  for (; size >= 0; p++, size--)
    if (!func(*(unsigned char *)p))
      return 0;
  return (!0);
}


x86 assembly (clang, -O0):
<is_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1166 <is_func+0x66>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
movzbl (%rcx),%edi
call   *%rax
cmp    $0x0,%eax
jne    1147 <is_func+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116d <is_func+0x6d>
jmp    114c <is_func+0x4c>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <is_func+0x1b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_func>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
test   %esi,%esi
js     113a <is_func+0x3a>
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
nopl   0x0(%rax)
movzbl (%rbx),%edi
call   *%r15
test   %eax,%eax
je     1137 <is_func+0x37>
add    $0x1,%rbx
add    $0xffffffff,%ebp
test   %ebp,%ebp
jg     1120 <is_func+0x20>
jmp    113a <is_func+0x3a>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_func(i8* nocapture %0, i32 %1, i32 (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, -1
br i1 %4, label %5, label %16
5: ; preds = %3, %12
%6 = phi i8* [ %13, %12 ], [ %0, %3 ]
%7 = phi i32 [ %14, %12 ], [ %1, %3 ]
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 %2(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = add nsw i32 %7, -1
%15 = icmp sgt i32 %7, 0
br i1 %15, label %5, label %16
16: ; preds = %5, %12, %3
%17 = phi i32 [ 1, %3 ], [ 1, %12 ], [ 0, %5 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ mktemp(char *);
int /*<<< orphan*/ strcpy(char *, char *);
FILE *tmpfile() {
  char buffer[128];
  strcpy(buffer, "/tmp/libcXXXXXX");
  mktemp(buffer);
  if (buffer[0] == 0) {
    return NULL;
  };
  return fopen(buffer, "w+");
}


x86 assembly (clang, -O0):
<tmpfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x90(%rbp),%rdi
call   1050 <mktemp@plt>
movsbl -0x90(%rbp),%eax
cmp    $0x0,%eax
jne    1177 <tmpfile+0x47>
movq   $0x0,-0x8(%rbp)
jmp    118e <tmpfile+0x5e>
lea    -0x90(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpfile>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <mktemp@plt>
cmpb   $0x0,(%rsp)
je     1169 <tmpfile+0x39>
lea    0xeb1(%rip),%rsi
mov    %rsp,%rdi
call   1040 <fopen@plt>
jmp    116b <tmpfile+0x3b>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/libcXXXXXX\00"
@.str.1 = [3 x i8] c"w+\00"
define i32* @tmpfile() {
%1 = alloca i32*
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%6 = call i32 @mktemp(i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32* null, i32** %1
br label %15
12: ; preds = %0
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%14 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %14, i32** %1
br label %15
15: ; preds = %12, %11
%16 = load i32*, i32** %1
ret i32* %16
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/libcXXXXXX\00"
@.str.1 = [3 x i8] c"w+\00"
define noalias i32* @tmpfile() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @mktemp(i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32* @fopen(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %0, %7
%10 = phi i32* [ %8, %7 ], [ null, %0 ]
ret i32* %10
}
void __attribute__((__warning__("curl_easy_getinfo expects a pointer to struct "
                                "curl_slist * for this info")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_getinfo_err_curl_slist(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_getinfo_err_curl_slist() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
scalar_t__ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void copy_file(FILE *in, FILE *out) {
  char c;
  while (c = fgetc(in) != EOF) {
    fputc(c, out);
  }
}


x86 assembly (clang, -O0):
<copy_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     116a <copy_file+0x4a>
mov    -0x11(%rbp),%al
mov    -0x10(%rbp),%rsi
movsbl %al,%edi
call   1040 <fputc@plt>
jmp    1130 <copy_file+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_file>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%rax
je     115a <copy_file+0x3a>
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%rax
jne    1140 <copy_file+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i64 0
define void @copy_file(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %14, %2
%7 = load i32*, i32** %3
%8 = call i64 @fgetc(i32* %7)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
%11 = zext i1 %10 to i32
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %6
%15 = load i8, i8* %5
%16 = load i32*, i32** %4
%17 = call i32 @fputc(i8 signext %15, i32* %16)
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
define void @copy_file(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @fgetc(i32* %0)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = tail call i32 @fputc(i8 signext 1, i32* %1)
%8 = tail call i64 @fgetc(i32* %0)
%9 = load i64, i64* @EOF
%10 = icmp eq i64 %8, %9
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
const char *yaml_get_version_string(void) { return "0.1.5"; }


x86 assembly (clang, -O0):
<yaml_get_version_string>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaml_get_version_string>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0.1.5\00"
define i8* @yaml_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.1.5\00"
define i8* @yaml_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
__attribute__((always_)) int is_dma32(struct zone *zone) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define i32 @is_dma32(%struct.zone* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *strcpy(char *dest, const char *src) {
  const uint8_t *src_bytes = ((const uint8_t *)src);
  uint8_t *dest_bytes = ((uint8_t *)dest);
  for (;; src_bytes++, dest_bytes++) {
    *dest_bytes = *src_bytes;
    if (!*dest_bytes)
      break;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
jne    113a <strcpy+0x3a>
jmp    115c <strcpy+0x5c>
jmp    113f <strcpy+0x3f>
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <strcpy+0x1c>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
test   %ecx,%ecx
je     111e <strcpy+0x1e>
mov    $0x4,%ecx
mov    (%rsi,%rcx,1),%edx
mov    %edx,(%rax,%rcx,1)
add    $0x4,%rcx
test   %edx,%edx
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %2, %7
%8 = phi i32* [ %11, %7 ], [ %4, %2 ]
%9 = phi i32* [ %10, %7 ], [ %3, %2 ]
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = load i32, i32* %10
store i32 %12, i32* %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret i8* %0
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_data_source {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int /*<<< orphan*/,
                                    char const *);
void wl_data_source_offer(struct wl_data_source *wl_data_source,
                          const char *mime_type) {
  wl_proxy_marshal((struct wl_proxy *)wl_data_source, 0, mime_type);
}


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

x86 assembly (clang, -O2):
<wl_data_source_offer>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_data_source = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_source_offer(%struct.wl_data_source* %0, i8* %1) {
%3 = alloca %struct.wl_data_source*
%4 = alloca i8*
store %struct.wl_data_source* %0, %struct.wl_data_source** %3
store i8* %1, i8** %4
%5 = load %struct.wl_data_source*, %struct.wl_data_source** %3
%6 = bitcast %struct.wl_data_source* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %6, i32 0, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_data_source = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_source_offer(%struct.wl_data_source* %0, i8* %1) {
%3 = bitcast %struct.wl_data_source* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 0, i8* %1)
ret void
}