xunge/DecIR huggingface dataset:
/* Variables and functions */
int SSL_CTX_use_certificate_file(void *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ SSL_FILETYPE_PEM;
int dv_openssl_ctx_use_certificate_file(void *ctx, const char *file) {
  int ret = 0;
  ret = SSL_CTX_use_certificate_file(ctx, file, SSL_FILETYPE_PEM);
  if (ret <= 0) {
    return (-1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<dv_openssl_ctx_use_certificate_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <SSL_CTX_use_certificate_file@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1156 <dv_openssl_ctx_use_certificate_file+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <dv_openssl_ctx_use_certificate_file+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dv_openssl_ctx_use_certificate_file>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
call   1030 <SSL_CTX_use_certificate_file@plt>
xor    %ecx,%ecx
test   %eax,%eax
setle  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SSL_FILETYPE_PEM = global i32 0
define i32 @dv_openssl_ctx_use_certificate_file(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 0, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* @SSL_FILETYPE_PEM
%10 = call i32 @SSL_CTX_use_certificate_file(i8* %7, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@SSL_FILETYPE_PEM = global i32 0
define i32 @dv_openssl_ctx_use_certificate_file(i8* %0, i8* %1) {
%3 = load i32, i32* @SSL_FILETYPE_PEM
%4 = tail call i32 @SSL_CTX_use_certificate_file(i8* %0, i8* %1, i32 %3)
%5 = icmp slt i32 %4, 1
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ j64_estr_encode(char *, int);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ strcmp(char *, char *);
int test_estr_encode_1(void) {
  char buf[1 + 1];
  memset(buf, '\0', sizeof(buf));
  j64_estr_encode(buf, 1);
  return strcmp(buf, "\"") == 0;
}


x86 assembly (clang, -O0):
<test_estr_encode_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
lea    -0x2(%rbp),%rdi
mov    $0x1,%esi
call   1050 <j64_estr_encode@plt>
lea    -0x2(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_estr_encode_1>:
push   %rbx
sub    $0x10,%rsp
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1050 <j64_estr_encode@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\22\00"
define i32 @test_estr_encode_1() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 2)
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = call i32 @j64_estr_encode(i8* %4, i32 1)
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [2 x i8] c"\22\00"
define i32 @test_estr_encode_1() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i8 signext 0, i32 2)
%4 = call i32 @j64_estr_encode(i8* %2, i32 1)
%5 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int impl_frame_ptr_to_reg(int nframes) {
  ice("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/src/cc1/"
      "out/mipsel_32.c",
      524, __func__, "TODO: builtin frame address");
  return -1;
}


x86 assembly (clang, -O0):
<impl_frame_ptr_to_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
mov    $0x20c,%esi
lea    0xf68(%rip),%rdx
lea    0xf77(%rip),%rcx
mov    $0x0,%al
call   1030 <ice@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<impl_frame_ptr_to_reg>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf77(%rip),%rdx
lea    0xf86(%rip),%rcx
mov    $0x20c,%esi
xor    %eax,%eax
call   1030 <ice@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/src/cc1/out/mipsel_32.c\00"
@__func__.impl_frame_ptr_to_reg = [22 x i8] c"impl_frame_ptr_to_reg\00"
@.str.1 = [28 x i8] c"TODO: builtin frame address\00"
define i32 @impl_frame_ptr_to_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ice to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 524, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.impl_frame_ptr_to_reg, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [150 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/ucc-c-compiler/refs/heads/master/src/cc1/out/mipsel_32.c\00"
@__func__.impl_frame_ptr_to_reg = [22 x i8] c"impl_frame_ptr_to_reg\00"
@.str.1 = [28 x i8] c"TODO: builtin frame address\00"
define i32 @impl_frame_ptr_to_reg(i32 %0) {
%2 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @ice to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([150 x i8], [150 x i8]* @.str, i64 0, i64 0), i32 524, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__func__.impl_frame_ptr_to_reg, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_tcp(void) { return socket(PF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<socket_tcp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_tcp>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_tcp() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_tcp() {
%1 = load i32, i32* @PF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ err(char *);
void *mmap(void *, size_t, int, int, int, int /*<<< orphan*/);
void *checked_mmap(void *start, size_t length, int prot, int flags, int fd,
                   off_t offset) {
  void *map = mmap(start, length, prot, flags, fd, offset);
  if (map == (void *)-1L)
    err("mmap");
  return map;
}


x86 assembly (clang, -O0):
<checked_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1030 <mmap@plt>
mov    %rax,-0x28(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x28(%rbp)
jne    117a <checked_mmap+0x5a>
lea    0xe8b(%rip),%rdi
call   1040 <err@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_mmap>:
push   %rbx
call   1030 <mmap@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    113b <checked_mmap+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"mmap\00"
define i8* @checked_mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i8* @mmap(i8* %0, i64 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = icmp eq i8* %7, inttoptr (i64 -1 to i8*)
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
ret i8* %7
}
/* Variables and functions */
int test(long double);
int main(void) {
  double a = -3.3;
  long double b = 22.5f;
  return test(a) + test(b) + test(1.0L) + test(3.14L);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0xc00a666666666666,%rax
66 0a c0
mov    %rax,-0x10(%rbp)
flds   0xedd(%rip)
fstpt  -0x20(%rbp)
fldl   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,-0x2c(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    %rsp,%rax
fld1
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    %rsp,%rax
fldt   0xe84(%rip)
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
fldl   0xee4(%rip)
fstpt  (%rsp)
call   1030 <test@plt>
mov    %eax,%ebx
flds   0xedc(%rip)
fstpt  (%rsp)
call   1030 <test@plt>
mov    %eax,%ebp
add    %ebx,%ebp
fld1
fstpt  (%rsp)
call   1030 <test@plt>
mov    %eax,%ebx
add    %ebp,%ebx
fldt   0xec4(%rip)
fstpt  (%rsp)
call   1030 <test@plt>
add    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca x86_fp80
store i32 0, i32* %1
store double -3.300000e+00, double* %2
store x86_fp80 0xK4003B400000000000000, x86_fp80* %3
%4 = load double, double* %2
%5 = fpext double %4 to x86_fp80
%6 = call i32 @test(x86_fp80 %5)
%7 = load x86_fp80, x86_fp80* %3
%8 = call i32 @test(x86_fp80 %7)
%9 = add nsw i32 %6, %8
%10 = call i32 @test(x86_fp80 0xK3FFF8000000000000000)
%11 = add nsw i32 %9, %10
%12 = call i32 @test(x86_fp80 0xK4000C8F5C28F5C28F5C3)
%13 = add nsw i32 %11, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(x86_fp80 0xKC000D333333333333000)
%2 = tail call i32 @test(x86_fp80 0xK4003B400000000000000)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @test(x86_fp80 0xK3FFF8000000000000000)
%5 = add nsw i32 %3, %4
%6 = tail call i32 @test(x86_fp80 0xK4000C8F5C28F5C28F5C3)
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *chk(char *al) {
  if (al == NULL) {
    fprintf(stderr, "Out of allocation space\n");
    exit(1);
  }
  return al;
}


x86 assembly (clang, -O0):
<chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <chk+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk>:
test   %rdi,%rdi
je     1129 <chk+0x9>
mov    %rdi,%rax
ret
push   %rax
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Out of allocation space\0A\00"
define i8* @chk(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Out of allocation space\0A\00"
define i8* @chk(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *funopen(void *, int (*)(void *, char *, int),
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
FILE *fropen(void *cookie, int (*readfn)(void *, char *, int)) {
  return funopen(cookie, readfn, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<fropen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1030 <funopen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fropen>:
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <funopen@plt>

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

LLVM IR (-O2):
define i32* @fropen(i8* %0, i32 (i8*, i8*, i32)* %1) {
%3 = tail call i32* @funopen(i8* %0, i32 (i8*, i8*, i32)* %1, i32* null, i32* null, i32* null)
ret i32* %3
}
int test_imm_65int64_highword_reg(long long val) {
  return ((val >> 32) & (0x65 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_65int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x65,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_65int64_highword_reg>:
movabs $0x6500000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_65int64_highword_reg(i64 %0) {
%2 = and i64 %0, 433791696896
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hash_file_path(char *, int);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    return 1;
  }
  hash_file_path(argv[1], 64);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    113c <main+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1155 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x40,%esi
call   1030 <hash_file_path@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     112f <main+0x1f>
push   %rax
mov    0x8(%rsi),%rdi
mov    $0x40,%esi
call   1030 <hash_file_path@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @hash_file_path(i8* %6, i32 64)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ 0, %4 ], [ 1, %2 ]
ret i32 %9
}
float area(float radius) { return 3.14 * (radius * radius); }


x86 assembly (clang, -O0):
<area>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<area>:
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @area(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = fmul double 3.140000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @area(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
%4 = fmul double %3, 3.140000e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int get_international(char *, double **, double **, int const *, int const,
                      double const, double);
int spg_get_international(char symbol[11], double lattice[3][3],
                          double position[][3], const int types[],
                          const int num_atom, const double symprec) {
  return get_international(symbol, lattice, position, types, num_atom, symprec,
                           -1.0);
}


x86 assembly (clang, -O0):
<spg_get_international>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
call   1030 <get_international@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spg_get_international>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <get_international@plt>

LLVM IR (-O0):
define i32 @spg_get_international(i8* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32 %4, double %5) {
%7 = alloca i8*
%8 = alloca [3 x double]*
%9 = alloca [3 x double]*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca double
store i8* %0, i8** %7
store [3 x double]* %1, [3 x double]** %8
store [3 x double]* %2, [3 x double]** %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store double %5, double* %12
%13 = load i8*, i8** %7
%14 = load [3 x double]*, [3 x double]** %8
%15 = bitcast [3 x double]* %14 to double**
%16 = load [3 x double]*, [3 x double]** %9
%17 = bitcast [3 x double]* %16 to double**
%18 = load i32*, i32** %10
%19 = load i32, i32* %11
%20 = load double, double* %12
%21 = call i32 @get_international(i8* %13, double** %15, double** %17, i32* %18, i32 %19, double %20, double -1.000000e+00)
ret i32 %21
}

LLVM IR (-O2):
define i32 @spg_get_international(i8* %0, [3 x double]* %1, [3 x double]* %2, i32* %3, i32 %4, double %5) {
%7 = bitcast [3 x double]* %1 to double**
%8 = bitcast [3 x double]* %2 to double**
%9 = tail call i32 @get_international(i8* %0, double** %7, double** %8, i32* %3, i32 %4, double %5, double -1.000000e+00)
ret i32 %9
}
int test_imm_74int16_reg(short val) {
  return ((val) & (-0x74 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_74int16_reg(i16 signext %0) {
%2 = and i16 %0, -116
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *strtok(char *str, const char *delimiters) { return 0; }


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

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

LLVM IR (-O0):
define i8* @strtok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strtok(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void charIn(char *arr, int arrSize) { fgets(arr, arrSize, stdin); }


x86 assembly (clang, -O0):
<charIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
call   1030 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charIn>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fgets@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @charIn(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %5, i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @charIn(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @fgets(i8* %0, i32 %1, i32 %3)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t lsri31(uint32_t x) { return x >> 31; }


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

x86 assembly (clang, -O2):
<lsri31>:
mov    %edi,%eax
sar    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @lsri31(i32 %0) {
%2 = ashr i32 %0, 31
ret i32 %2
}
int test_imm_89int8_reg(signed char val) {
  return ((val) & (0x89 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_89int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_89int8_reg>:
test   $0x89,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_89int8_reg(i8 signext %0) {
%2 = and i8 %0, -119
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fclose(int /*<<< orphan*/ *);
void pdb_close_file(FILE *fptr) {
  if (fptr != NULL)
    if (fclose(fptr)) {
    }
}


x86 assembly (clang, -O0):
<pdb_close_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <pdb_close_file+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
cmp    $0x0,%rax
je     113f <pdb_close_file+0x2f>
jmp    113f <pdb_close_file+0x2f>
jmp    1144 <pdb_close_file+0x34>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdb_close_file>:
test   %rdi,%rdi
je     111a <pdb_close_file+0xa>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @pdb_close_file(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int rand();
void generateRandomInputForSize(int *theArrayPointer, int arraySize) {
  for (int i = 0; i < arraySize; i++) {
    theArrayPointer[i] = rand() % arraySize;
  }
}


x86 assembly (clang, -O0):
<generateRandomInputForSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1156 <generateRandomInputForSize+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <generateRandomInputForSize+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateRandomInputForSize>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <generateRandomInputForSize+0x38>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <generateRandomInputForSize+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @generateRandomInputForSize(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @generateRandomInputForSize(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %1
%11 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ ti2s(long);
void bgpdump_test_utils() {
  ti2s(0);
  ti2s(99999);
  ti2s(4294967295L);
}


x86 assembly (clang, -O0):
<bgpdump_test_utils>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ti2s@plt>
mov    $0x1869f,%edi
call   1030 <ti2s@plt>
mov    $0xffffffff,%edi
call   1030 <ti2s@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgpdump_test_utils>:
push   %rax
xor    %edi,%edi
call   1030 <ti2s@plt>
mov    $0x1869f,%edi
call   1030 <ti2s@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1030 <ti2s@plt>

LLVM IR (-O0):
define void @bgpdump_test_utils() {
%1 = call i32 @ti2s(i64 0)
%2 = call i32 @ti2s(i64 99999)
%3 = call i32 @ti2s(i64 4294967295)
ret void
}

LLVM IR (-O2):
define void @bgpdump_test_utils() {
%1 = tail call i32 @ti2s(i64 0)
%2 = tail call i32 @ti2s(i64 99999)
%3 = tail call i32 @ti2s(i64 4294967295)
ret void
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ s6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/, char *, int);
int is_v4inv6(const struct in6_addr *a) {
  return !memcmp(a->s6_addr, "\0\0\0\0\0\0\0\0\0\0\xff\xff", 12);
}


x86 assembly (clang, -O0):
<is_v4inv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xed7(%rip),%rsi
mov    $0xc,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_v4inv6>:
push   %rax
mov    (%rdi),%edi
lea    0xee6(%rip),%rsi
mov    $0xc,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in6_addr = type { i32 }
@.str = [13 x i8] c"\00\00\00\00\00\00\00\00\00\00\FF\FF\00"
define i32 @is_v4inv6(%struct.in6_addr* %0) {
%2 = alloca %struct.in6_addr*
store %struct.in6_addr* %0, %struct.in6_addr** %2
%3 = load %struct.in6_addr*, %struct.in6_addr** %2
%4 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @memcmp(i32 %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.in6_addr = type { i32 }
@.str = [13 x i8] c"\00\00\00\00\00\00\00\00\00\00\FF\FF\00"
define i32 @is_v4inv6(%struct.in6_addr* nocapture %0) {
%2 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @memcmp(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ uart_putchar(int /*<<< orphan*/);
int uart_puts(const char *str) {
  while (*str) {
    uart_putchar(*str++);
  }
  return 1;
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <uart_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putchar@plt>
jmp    111c <uart_puts+0xc>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_puts+0x10>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @uart_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @uart_putchar(i32 %11)
br label %3
13: ; preds = %3
ret i32 1
}

LLVM IR (-O2):
define i32 @uart_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @uart_putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 1
}
int fun1289() { return 1289; }


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

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

LLVM IR (-O0):
define i32 @fun1289() {
ret i32 1289
}

LLVM IR (-O2):
define i32 @fun1289() {
ret i32 1289
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
extern long Bar3(long one, long two) {
  printf(" Hello from Bar3: one = %d, two = %d!\n ", one, two);
  return one + two;
}


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

x86 assembly (clang, -O2):
<Bar3>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xedf(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c" Hello from Bar3: one = %d, two = %d!\0A \00"
define i64 @Bar3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
@.str = [40 x i8] c" Hello from Bar3: one = %d, two = %d!\0A \00"
define i64 @Bar3(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = add nsw i64 %1, %0
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void google_earth_output_closing(FILE *output_file) {
  fprintf(output_file, "</Folder>\n"
                       "</Document>\n"
                       "</kml>\n");
}


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

x86 assembly (clang, -O2):
<google_earth_output_closing>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"</Folder>\0A</Document>\0A</kml>\0A\00"
define void @google_earth_output_closing(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"</Folder>\0A</Document>\0A</kml>\0A\00"
define void @google_earth_output_closing(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 29, i64 1, i32* %0)
ret void
}
void free_mat2D_double(double **mat2D_double, int x) {
  unsigned int i;
  for (i = 0; i < x; ++i)
    free(mat2D_double[i]);
  free(mat2D_double);
}


x86 assembly (clang, -O0):
<free_mat2D_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1150 <free_mat2D_double+0x40>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_mat2D_double+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_mat2D_double>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
je     1142 <free_mat2D_double+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_mat2D_double+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mat2D_double(double** nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = bitcast double** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast double** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
double floor(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double x;
  double f;
  printf("x: ");
  scanf("%lf", &x);
  f = floor(x);
  printf("f = %lf\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <floor@plt>
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [9 x i8] c"f = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @llvm.floor.f64(double %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int *getPointer();
void testInitCheck() {
  int *a = getPointer();
  if (a) {
    ;
  }
  *a = 1;
}


x86 assembly (clang, -O0):
<testInitCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getPointer@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1133 <testInitCheck+0x23>
jmp    1133 <testInitCheck+0x23>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testInitCheck>:
push   %rax
xor    %eax,%eax
call   1030 <getPointer@plt>
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @testInitCheck() {
%1 = alloca i32*
%2 = call i32* (...) @getPointer()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = load i32*, i32** %1
store i32 1, i32* %7
ret void
}

LLVM IR (-O2):
define void @testInitCheck() {
%1 = tail call i32* (...) @getPointer()
store i32 1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
int ssl_init(void) {
  SSL_load_error_strings();
  SSL_library_init();
  return 0;
}


x86 assembly (clang, -O0):
<ssl_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_init>:
push   %rax
xor    %eax,%eax
call   1040 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ssl_init() {
%1 = call i32 (...) @SSL_load_error_strings()
%2 = call i32 (...) @SSL_library_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @ssl_init() {
%1 = tail call i32 (...) @SSL_load_error_strings()
%2 = tail call i32 (...) @SSL_library_init()
ret i32 0
}
int xg_resume(int guest_bitness) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xg_resume(i32 %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ foo(int);
int main() {
  int il;
  for (il = 0; foo(il) && il < 2; ++il) {
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114a <main+0x3a>
cmpl   $0x2,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <main+0x4a>
jmp    116d <main+0x5d>
jmp    115f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <foo@plt>
cmp    $0x1,%ebx
ja     1134 <main+0x24>
add    $0x1,%ebx
test   %rax,%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = call i64 @foo(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 2
br label %10
10: ; preds = %7, %3
%11 = phi i1 [ false, %3 ], [ %9, %7 ]
br i1 %11, label %12, label %16
12: ; preds = %10
br label %13
13: ; preds = %12
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %7, %1 ]
%3 = tail call i64 @foo(i32 %2)
%4 = icmp ne i64 %3, 0
%5 = icmp ult i32 %2, 2
%6 = and i1 %5, %4
%7 = add nuw nsw i32 %2, 1
br i1 %6, label %1, label %8
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int scaled_add(int, int, int);
int do_scaled_add(int a, int b, int s) { return scaled_add(a, b, s); }


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

x86 assembly (clang, -O2):
<do_scaled_add>:
jmp    1030 <scaled_add@plt>

LLVM IR (-O0):
define i32 @do_scaled_add(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @scaled_add(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @do_scaled_add(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @scaled_add(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int read_size(void *);
int /*<<< orphan*/ write_size(void *, size_t);
void coalesce(void *ptr1, void *ptr2) {
  size_t new_size = read_size(ptr1) + (sizeof(size_t)) + read_size(ptr2);
  write_size(ptr1, new_size);
}


x86 assembly (clang, -O0):
<coalesce>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_size@plt>
cltq
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <read_size@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <write_size@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<coalesce>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <read_size@plt>
movslq %eax,%r15
mov    %r14,%rdi
call   1030 <read_size@plt>
cltq
lea    (%r15,%rax,1),%rsi
add    $0x8,%rsi
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <write_size@plt>

LLVM IR (-O0):
define void @coalesce(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @read_size(i8* %6)
%8 = sext i32 %7 to i64
%9 = add i64 %8, 8
%10 = load i8*, i8** %4
%11 = call i32 @read_size(i8* %10)
%12 = sext i32 %11 to i64
%13 = add i64 %9, %12
store i64 %13, i64* %5
%14 = load i8*, i8** %3
%15 = load i64, i64* %5
%16 = call i32 @write_size(i8* %14, i64 %15)
ret void
}

LLVM IR (-O2):
define void @coalesce(i8* %0, i8* %1) {
%3 = tail call i32 @read_size(i8* %0)
%4 = sext i32 %3 to i64
%5 = add nsw i64 %4, 8
%6 = tail call i32 @read_size(i8* %1)
%7 = sext i32 %6 to i64
%8 = add nsw i64 %5, %7
%9 = tail call i32 @write_size(i8* %0, i64 %8)
ret void
}