xunge/DecIR huggingface dataset:
void f1(int a) {}


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

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

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

LLVM IR (-O2):
define void @f1(i32 %0) {
ret void
}
/* Variables and functions */
int printf(char *, ...);
int strlen(char const *);
int prFileLineErr(const char *fmt, const char *fn, int lnum) {
  int tmpLen = strlen(fmt);
  if (fmt[tmpLen - 1] != '\n')
    printf("\n");
  return printf("* error in %s:%d\n\n", fn, lnum);
}


x86 assembly (clang, -O0):
<prFileLineErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     1167 <prFileLineErr+0x47>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prFileLineErr>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1040 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
je     1155 <prFileLineErr+0x25>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [19 x i8] c"* error in %s:%d\0A\0A\00"
define i32 @prFileLineErr(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %7
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %10, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 10
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %3
%21 = load i8*, i8** %5
%22 = load i32, i32* %6
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %21, i32 %22)
ret i32 %23
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"* error in %s:%d\0A\0A\00"
define i32 @prFileLineErr(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %12, label %10
10: ; preds = %3
%11 = tail call i32 @putchar(i32 10)
br label %12
12: ; preds = %10, %3
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2)
ret i32 %13
}
char sunxi_serial_getc(void) { return 0; }


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

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

LLVM IR (-O0):
define signext i8 @sunxi_serial_getc() {
ret i8 0
}

LLVM IR (-O2):
define signext i8 @sunxi_serial_getc() {
ret i8 0
}
/* Variables and functions */
int powI(int, int);
int place(int n, int pwr) {
  int digit = (n % powI(10, pwr)) / powI(10, pwr - 1);
  return digit;
}


x86 assembly (clang, -O0):
<place>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    $0xa,%edi
call   1030 <powI@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <powI@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @place(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @powI(i32 10, i32 %7)
%9 = srem i32 %6, %8
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @powI(i32 10, i32 %11)
%13 = sdiv i32 %9, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @place(i32 %0, i32 %1) {
%3 = tail call i32 @powI(i32 10, i32 %1)
%4 = srem i32 %0, %3
%5 = add nsw i32 %1, -1
%6 = tail call i32 @powI(i32 10, i32 %5)
%7 = sdiv i32 %4, %6
ret i32 %7
}
void test_four(int x, int y) {
#pragma omp parallel for collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FIONBIO;
int ioctl(int, int /*<<< orphan*/, int *);
int oct_set_nonblocking(int fd) {
  int nb = 1;
  return ioctl(fd, FIONBIO, &nb);
}


x86 assembly (clang, -O0):
<oct_set_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oct_set_nonblocking>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdx
call   1030 <ioctl@plt>
pop    %rcx
ret

LLVM IR (-O0):
@FIONBIO = global i32 0
define i32 @oct_set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @FIONBIO
%6 = call i32 @ioctl(i32 %4, i32 %5, i32* %3)
ret i32 %6
}

LLVM IR (-O2):
@FIONBIO = global i32 0
define i32 @oct_set_nonblocking(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @FIONBIO
%5 = call i32 @ioctl(i32 %0, i32 %4, i32* %2)
ret i32 %5
}
/* Variables and functions */
int call(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int z, num = 0;
  z = call(num);
  printf("%d", z);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <call@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @call(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct main_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_given(struct main_args_info *);
void main_cmdline_parser_release(struct main_args_info *args_info) {
  clear_given(args_info);
}


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

x86 assembly (clang, -O2):
<main_cmdline_parser_release>:
jmp    1030 <clear_given@plt>

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

LLVM IR (-O2):
%struct.main_args_info = type { i32 }
define void @main_cmdline_parser_release(%struct.main_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.main_args_info* %0)
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int m, n;
  printf("Enter the numbers m and n\n");
  scanf("%d %d", &m, &n);
  printf(" GCD is %d\n", gcd(m, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <gcd@plt>
lea    0xe92(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Enter the numbers m and n\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [12 x i8] c" GCD is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @gcd(i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [12 x i8] c" GCD is %d\0A\00"
@str = [26 x i8] c"Enter the numbers m and n\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @gcd(i32 %9, i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void rt_err(char *err_msg) {
  fprintf(stderr, "RUNTIME ERROR: %s\n", err_msg);
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"RUNTIME ERROR: %s\0A\00"
define void @rt_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"RUNTIME ERROR: %s\0A\00"
define void @rt_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ coio_yield();
int /*<<< orphan*/ printf(char *);
void _t2(void *arg) {
  printf("Hello 1 from _t2\n");
  coio_yield();
  printf("Hello 2 from _t2\n");
}


x86 assembly (clang, -O0):
<_t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <coio_yield@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_t2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <coio_yield@plt>
lea    0xed6(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Hello 1 from _t2\0A\00"
@.str.1 = [18 x i8] c"Hello 2 from _t2\0A\00"
define void @_t2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @coio_yield()
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Hello 1 from _t2\00"
@str.2 = [17 x i8] c"Hello 2 from _t2\00"
define void @_t2(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @coio_yield()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret void
}
void moudrv_close(void) {}


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

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

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

LLVM IR (-O2):
define void @moudrv_close() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_aupdate_read_end() {
  printf("NOT IMPLEMENTED:"
         "pa_aupdate_read_end"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"NOT IMPLEMENTED:pa_aupdate_read_end\0A\00"
define i32 @pa_aupdate_read_end() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_aupdate_read_end\00"
define i32 @pa_aupdate_read_end() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char *);
int strtol(char *, char **, int /*<<< orphan*/);
int to_number(char *num) {
  int number;
  char *end;
  number = strtol(num, &end, 0);
  if (end && *end)
    die("Not a number: \"%s\"", num);
  return number;
}


x86 assembly (clang, -O0):
<to_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <to_number+0x49>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <to_number+0x49>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <die@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_number>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,%ebp
mov    (%rsp),%rax
test   %rax,%rax
je     114f <to_number+0x2f>
cmpb   $0x0,(%rax)
je     114f <to_number+0x2f>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <die@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Not a number: \22%s\22\00"
define i32 @to_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strtol(i8* %5, i8** %4, i32 0)
store i32 %6, i32* %3
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %9, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [19 x i8] c"Not a number: \22%s\22\00"
define i32 @to_number(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 0)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %10, %7, %1
ret i32 %4
}
int test_imm_FAuint16_mem(unsigned short *val) {
  return ((*val) & (-0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff06,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint16_mem>:
movzwl (%rdi),%eax
test   $0xff06,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FAuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -250
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned char signum_fun_uchar(unsigned char a) { return (a > 0); }


x86 assembly (clang, -O0):
<signum_fun_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_uchar>:
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define zeroext i8 @signum_fun_uchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @signum_fun_uchar(i8 zeroext %0) {
%2 = icmp ne i8 %0, 0
%3 = zext i1 %2 to i8
ret i8 %3
}
int reoxoo(char ch) {
  int i;
  for (i = 0; i < 16; i++) {
    if (ch == "0123456789ABCDEF"[i])
      return i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<reoxoo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1154 <reoxoo+0x54>
movsbl -0x5(%rbp),%eax
movslq -0xc(%rbp),%rdx
lea    0xed6(%rip),%rcx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1141 <reoxoo+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <reoxoo+0x5b>
jmp    1146 <reoxoo+0x46>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <reoxoo+0x11>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reoxoo>:
add    $0xcf,%dil
xor    %eax,%eax
cmp    $0x15,%dil
ja     111a <reoxoo+0x1a>
movsbq %dil,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789ABCDEF\00"
define i32 @reoxoo(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %10, %15
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = load i32, i32* %4
store i32 %18, i32* %2
br label %24
19: ; preds = %8
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %5
23: ; preds = %5
store i32 0, i32* %2
br label %24
24: ; preds = %23, %17
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@switch.table.reoxoo = [22 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15]
define i32 @reoxoo(i8 signext %0) {
%2 = add i8 %0, -49
%3 = icmp ult i8 %2, 22
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [22 x i32], [22 x i32]* @switch.table.reoxoo, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
void *am(size_t);
void *a3(size_t n) { return am(n); }


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

x86 assembly (clang, -O2):
<a3>:
jmp    1030 <am@plt>

LLVM IR (-O0):
define i8* @a3(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @am(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @a3(i64 %0) {
%2 = tail call i8* @am(i64 %0)
ret i8* %2
}
int aaa_f1(int a, int b) { return a * a + b * b - a * b; }


x86 assembly (clang, -O0):
<aaa_f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aaa_f1>:
mov    %esi,%eax
sub    %edi,%eax
imul   %edi,%edi
imul   %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @aaa_f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %4
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @aaa_f1(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, %0
%4 = sub i32 %1, %0
%5 = mul i32 %4, %1
%6 = add i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ se_out(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void do_DrCP(uint8_t *p, uint8_t *max, int is_up) {
  se_out("RDPDR: Client Capability: ", p + 4, max);
}


x86 assembly (clang, -O0):
<do_DrCP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
add    $0x10,%rsi
mov    -0x10(%rbp),%rdx
lea    0xeca(%rip),%rdi
call   1030 <se_out@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_DrCP>:
mov    %rsi,%rdx
lea    0x10(%rdi),%rsi
lea    0xee2(%rip),%rdi
jmp    1030 <se_out@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"RDPDR: Client Capability: \00"
define void @do_DrCP(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 4
%9 = load i32*, i32** %5
%10 = call i32 @se_out(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"RDPDR: Client Capability: \00"
define void @do_DrCP(i32* %0, i32* %1, i32 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = tail call i32 @se_out(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %1)
ret void
}
int d_bge_rr2(double a1, double a2) {
  return !(__builtin_isgreaterequal(a1, a2));
}


x86 assembly (clang, -O0):
<d_bge_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_bge_rr2>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
setb   %al
ret

LLVM IR (-O0):
define i32 @d_bge_rr2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp oge double %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_bge_rr2(double %0, double %1) {
%3 = fcmp ult double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_cleanup_all_ex_data();
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ EVP_cleanup();
int /*<<< orphan*/ crypto_random_deinit();
void crypto_deinit(void) {
  crypto_random_deinit();
  EVP_cleanup();
  CRYPTO_cleanup_all_ex_data();
  ERR_free_strings();
}


x86 assembly (clang, -O0):
<crypto_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <crypto_random_deinit@plt>
mov    $0x0,%al
call   1040 <EVP_cleanup@plt>
mov    $0x0,%al
call   1030 <CRYPTO_cleanup_all_ex_data@plt>
mov    $0x0,%al
call   1050 <ERR_free_strings@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_deinit>:
push   %rax
xor    %eax,%eax
call   1060 <crypto_random_deinit@plt>
xor    %eax,%eax
call   1040 <EVP_cleanup@plt>
xor    %eax,%eax
call   1030 <CRYPTO_cleanup_all_ex_data@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ERR_free_strings@plt>

LLVM IR (-O0):
define void @crypto_deinit() {
%1 = call i32 (...) @crypto_random_deinit()
%2 = call i32 (...) @EVP_cleanup()
%3 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%4 = call i32 (...) @ERR_free_strings()
ret void
}

LLVM IR (-O2):
define void @crypto_deinit() {
%1 = tail call i32 (...) @crypto_random_deinit()
%2 = tail call i32 (...) @EVP_cleanup()
%3 = tail call i32 (...) @CRYPTO_cleanup_all_ex_data()
%4 = tail call i32 (...) @ERR_free_strings()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void version(void) { puts("nutparse version 0.1"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"nutparse version 0.1\00"
define void @version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"nutparse version 0.1\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
int oppositeOf(int value) { return -1 * value; }


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

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

LLVM IR (-O0):
define i32 @oppositeOf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 -1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @oppositeOf(i32 %0) {
%2 = sub nsw i32 0, %0
ret i32 %2
}
const char *db_list_nomaccts_report_sql(void) {
  static const char *query = "SELECT"
                             "  num AS 'A/C Number',"
                             "  description AS 'Description',"
                             "  CASE enabled"
                             "    WHEN TRUE"
                             "      THEN 'Yes'"
                             "    WHEN FALSE"
                             "      THEN 'No'"
                             "    ELSE 'Unknown'"
                             "  END"
                             "    AS 'Enabled?'"
                             "  FROM nomaccts"
                             "  ORDER BY num";
  return query;
}


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

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

LLVM IR (-O0):
@db_list_nomaccts_report_sql.query = internal global i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i32 0, i32 0)
@.str = [201 x i8] c"SELECT num AS 'A/C Number', description AS 'Description', CASE enabled WHEN TRUE THEN 'Yes' WHEN FALSE THEN 'No' ELSE 'Unknown' END AS 'Enabled?' FROM nomaccts ORDER BY num\00"
define i8* @db_list_nomaccts_report_sql() {
%1 = load i8*, i8** @db_list_nomaccts_report_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [201 x i8] c"SELECT num AS 'A/C Number', description AS 'Description', CASE enabled WHEN TRUE THEN 'Yes' WHEN FALSE THEN 'No' ELSE 'Unknown' END AS 'Enabled?' FROM nomaccts ORDER BY num\00"
define i8* @db_list_nomaccts_report_sql() {
ret i8* getelementptr inbounds ([201 x i8], [201 x i8]* @.str, i64 0, i64 0)
}
char *fname(void) { return "dltest"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"dltest\00"
define i8* @fname() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ clear_bit(int, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ set_bit(int, int /*<<< orphan*/ *, int);
void assign_bit(int len, uint64_t *array, int element, int bit) {
  if (bit)
    set_bit(len, array, element);
  else
    clear_bit(len, array, element);
}


x86 assembly (clang, -O0):
<assign_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1153 <assign_bit+0x33>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <set_bit@plt>
jmp    1162 <assign_bit+0x42>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <clear_bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign_bit>:
test   %ecx,%ecx
je     1129 <assign_bit+0x9>
jmp    1040 <set_bit@plt>
jmp    1030 <clear_bit@plt>

LLVM IR (-O0):
define void @assign_bit(i32 %0, i32* %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32*, i32** %6
%14 = load i32, i32* %7
%15 = call i32 @set_bit(i32 %12, i32* %13, i32 %14)
br label %21
16: ; preds = %4
%17 = load i32, i32* %5
%18 = load i32*, i32** %6
%19 = load i32, i32* %7
%20 = call i32 @clear_bit(i32 %17, i32* %18, i32 %19)
br label %21
21: ; preds = %16, %11
ret void
}

LLVM IR (-O2):
define void @assign_bit(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @set_bit(i32 %0, i32* %1, i32 %2)
br label %10
8: ; preds = %4
%9 = tail call i32 @clear_bit(i32 %0, i32* %1, i32 %2)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RecursivePermute3(char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
void ListPermutations2(char *str) {
  char *p;
  int i;
  char *tmp;
  char *buf = (char *)malloc(strlen(str) + 1);
  memset(buf, 0, strlen(str) + 1);
  RecursivePermute3(buf, str);
  free(buf);
}


x86 assembly (clang, -O0):
<ListPermutations2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1070 <RecursivePermute3@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ListPermutations2>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <RecursivePermute3@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ListPermutations2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %2
%14 = call i64 @strlen(i8* %13)
%15 = add nsw i64 %14, 1
%16 = call i32 @memset(i8* %12, i32 0, i64 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %2
%19 = call i32 @RecursivePermute3(i8* %17, i8* %18)
%20 = load i8*, i8** %6
%21 = call i32 @free(i8* %20)
ret void
}

LLVM IR (-O2):
define void @ListPermutations2(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = add nsw i64 %6, 1
%8 = tail call i32 @memset(i8* %5, i32 0, i64 %7)
%9 = tail call i32 @RecursivePermute3(i8* %5, i8* %0)
%10 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void disp_usage(char *prog) {
  printf("usage: %s [-v] [-h] [-n] [-t lang] [-] [file] [...]\n", prog);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<disp_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<disp_usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"usage: %s [-v] [-h] [-n] [-t lang] [-] [file] [...]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @disp_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [53 x i8] c"usage: %s [-v] [-h] [-n] [-t lang] [-] [file] [...]\0A\00"
@EXIT_SUCCESS = global i32 0
define void @disp_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void two(struct Matrix *matrix[]) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ EVP_cleanup();
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int SSL_get_fd(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_shutdown(int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ stderr;
void ShutdownSSL(SSL *ssl) {
  SSL_shutdown(ssl);
  int sd = SSL_get_fd(ssl);
  SSL_free(ssl);
  close(sd);
  ERR_print_errors_fp(stderr);
  ERR_free_strings();
  EVP_cleanup();
}


x86 assembly (clang, -O0):
<ShutdownSSL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <SSL_shutdown@plt>
mov    -0x8(%rbp),%rdi
call   1030 <SSL_get_fd@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <SSL_free@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
call   1090 <ERR_print_errors_fp@plt>
mov    $0x0,%al
call   1080 <ERR_free_strings@plt>
mov    $0x0,%al
call   1070 <EVP_cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShutdownSSL>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1060 <SSL_shutdown@plt>
mov    %rbx,%rdi
call   1030 <SSL_get_fd@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <SSL_free@plt>
mov    %ebp,%edi
call   1050 <close@plt>
mov    0x2e45(%rip),%rax
mov    (%rax),%edi
call   1090 <ERR_print_errors_fp@plt>
xor    %eax,%eax
call   1080 <ERR_free_strings@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <EVP_cleanup@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @ShutdownSSL(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @SSL_shutdown(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @SSL_get_fd(i32* %6)
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = call i32 @SSL_free(i32* %8)
%10 = load i32, i32* %3
%11 = call i32 @close(i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @ERR_print_errors_fp(i32 %12)
%14 = call i32 (...) @ERR_free_strings()
%15 = call i32 (...) @EVP_cleanup()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @ShutdownSSL(i32* %0) {
%2 = tail call i32 @SSL_shutdown(i32* %0)
%3 = tail call i32 @SSL_get_fd(i32* %0)
%4 = tail call i32 @SSL_free(i32* %0)
%5 = tail call i32 @close(i32 %3)
%6 = load i32, i32* @stderr
%7 = tail call i32 @ERR_print_errors_fp(i32 %6)
%8 = tail call i32 (...) @ERR_free_strings()
%9 = tail call i32 (...) @EVP_cleanup()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lfs_aligndown(uint32_t a, uint32_t alignment) {
  return a - (a % alignment);
}


x86 assembly (clang, -O0):
<lfs_aligndown>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfs_aligndown>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @lfs_aligndown(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub nsw i32 %0, %3
ret i32 %4
}
void XtAppSetExitFlag() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int fsize(FILE *fp) {
  fseek(fp, 0, SEEK_END);
  int size = ftell(fp);
  rewind(fp);
  return size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i32 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @ftell(i32* %7)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i32 @fsize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i32 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i32 %4
}
void *tag_ptr(void *ptr, unsigned long tag) {
  return (void *)(tag | (unsigned long)ptr);
}


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

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

LLVM IR (-O0):
define i8* @tag_ptr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = or i64 %5, %7
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @tag_ptr(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = or i64 %3, %1
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ read_16u(int /*<<< orphan*/ const *);
int16_t read_16s(const uint8_t *src) { return (int16_t)read_16u(src); }


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

x86 assembly (clang, -O2):
<read_16s>:
jmp    1030 <read_16u@plt>

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

LLVM IR (-O2):
define i32 @read_16s(i32* %0) {
%2 = tail call i32 @read_16u(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void retire() {
  printf("So long for now.\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<retire>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<retire>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"So long for now.\0A\00"
@EXIT_SUCCESS = global i32 0
define void @retire() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [17 x i8] c"So long for now.\00"
define void @retire() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ nsblk_reg(char *, int);
void nsblk_eggs_reg(int id) { nsblk_reg("eggs", id); }


x86 assembly (clang, -O0):
<nsblk_eggs_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <nsblk_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsblk_eggs_reg>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <nsblk_reg@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"eggs\00"
define void @nsblk_eggs_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @nsblk_reg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"eggs\00"
define void @nsblk_eggs_reg(i32 %0) {
%2 = tail call i32 @nsblk_reg(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}