xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fread(void *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(void *);
int fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
void *malloc(int);
void Precache(const char *nf) {
  return;
  FILE *f = fopen(nf, "rb");
  if (f != NULL) {
    int len = fseek(f, 0, SEEK_END);
    if (len > 0) {
      fseek(f, 0, SEEK_SET);
      void *ptr = malloc(len);
      fread(ptr, len, 1, f);
      free(ptr);
    }
    fclose(f);
  }
}


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

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

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define void @Precache(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define void @Precache(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_test();
int main(int argc, char const *argv[]) {
  do_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_test()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int ftruncate(int, int /*<<< orphan*/);
int fu_Ftruncate(FILE *stream, int length) {
  int fd = fileno(stream);
  return ftruncate(fd, (off_t)length);
}


x86 assembly (clang, -O0):
<fu_Ftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fileno@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <ftruncate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fu_Ftruncate>:
push   %rbx
mov    %esi,%ebx
call   1040 <fileno@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <ftruncate@plt>

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

LLVM IR (-O2):
define i32 @fu_Ftruncate(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fileno(i32* %0)
%4 = tail call i32 @ftruncate(i32 %3, i32 %1)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ const UINT8_MAX;
uint32_t __stdfix_sat_uhr(const uint32_t x) {
  if (x > UINT8_MAX)
    return (UINT8_MAX);
  return (x);
}


x86 assembly (clang, -O0):
<__stdfix_sat_uhr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jle    112f <__stdfix_sat_uhr+0x2f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1137 <__stdfix_sat_uhr+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdfix_sat_uhr>:
mov    %rdi,%rax
sar    $0x3f,%rax
and    %rdi,%rax
ret

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

LLVM IR (-O2):
@UINT8_MAX = constant i64 0
define i64 @__stdfix_sat_uhr(i64 %0) {
%2 = icmp slt i64 %0, 0
%3 = select i1 %2, i64 %0, i64 0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, int);
int /*<<< orphan*/ spi_xfer(int, int /*<<< orphan*/);
int /*<<< orphan*/ spi_xfer_buf_set(int, int);
void sd_send_initial_clock(void) {
  int i;
  for (i = 0; i < 8; ++i)
    spi_xfer_buf_set(i, 0xff);
  outw(0xfff0, (1 << 9) | 0x1ff);
  spi_xfer(8, 0);
}


x86 assembly (clang, -O0):
<sd_send_initial_clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jge    1164 <sd_send_initial_clock+0x34>
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <sd_send_initial_clock+0xf>
mov    $0xfff0,%edi
mov    $0x3ff,%esi
call   1050 <outw@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1040 <spi_xfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_send_initial_clock>:
push   %rax
xor    %edi,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x1,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x2,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x3,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x4,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x5,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x6,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0x7,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    $0xfff0,%edi
mov    $0x3ff,%esi
call   1050 <outw@plt>
mov    $0x8,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <spi_xfer@plt>

LLVM IR (-O0):
define void @sd_send_initial_clock() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 8
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @spi_xfer_buf_set(i32 %6, i32 255)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
%12 = call i32 @outw(i32 65520, i32 1023)
%13 = call i32 @spi_xfer(i32 8, i32 0)
ret void
}

LLVM IR (-O2):
define void @sd_send_initial_clock() {
%1 = tail call i32 @spi_xfer_buf_set(i32 0, i32 255)
%2 = tail call i32 @spi_xfer_buf_set(i32 1, i32 255)
%3 = tail call i32 @spi_xfer_buf_set(i32 2, i32 255)
%4 = tail call i32 @spi_xfer_buf_set(i32 3, i32 255)
%5 = tail call i32 @spi_xfer_buf_set(i32 4, i32 255)
%6 = tail call i32 @spi_xfer_buf_set(i32 5, i32 255)
%7 = tail call i32 @spi_xfer_buf_set(i32 6, i32 255)
%8 = tail call i32 @spi_xfer_buf_set(i32 7, i32 255)
%9 = tail call i32 @outw(i32 65520, i32 1023)
%10 = tail call i32 @spi_xfer(i32 8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void min_test(void) { assert(((1) < (2) ? (1) : (2)) == 1); }


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

x86 assembly (clang, -O2):
<min_test>:
mov    $0x1,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @min_test() {
%1 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @min_test() {
%1 = tail call i32 @assert(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xe2() {
  Assert_real((isxdigit(226) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              1135, ("isxdigit should be 0 for 0xe2"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0xe2>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe2,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x46f,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0xe2>:
push   %rax
mov    $0xe2,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x46f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe2\00"
define void @t_isxdigit_0xe2() {
%1 = call i64 @isxdigit(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xe2\00"
define void @t_isxdigit_0xe2() {
%1 = tail call i64 @isxdigit(i32 226)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void foo484(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo484(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTLD_NOW;
void *dlopen(char const *, int /*<<< orphan*/);
void *khrIcdOsLibraryLoad(const char *libraryName) {
  return dlopen(libraryName, RTLD_NOW);
}


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

x86 assembly (clang, -O2):
<khrIcdOsLibraryLoad>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <dlopen@plt>

LLVM IR (-O0):
@RTLD_NOW = global i32 0
define i8* @khrIcdOsLibraryLoad(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @RTLD_NOW
%5 = call i8* @dlopen(i8* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@RTLD_NOW = global i32 0
define i8* @khrIcdOsLibraryLoad(i8* %0) {
%2 = load i32, i32* @RTLD_NOW
%3 = tail call i8* @dlopen(i8* %0, i32 %2)
ret i8* %3
}
/* Variables and functions */
int ENOMEM;
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int copy_string(char *dest, const char *src, size_t max) {
  if (strlen(src) + 1 > max)
    return -ENOMEM;
  strcpy(dest, src);
  return 0;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
cmp    -0x20(%rbp),%rax
jbe    115f <copy_string+0x3f>
xor    %eax,%eax
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1173 <copy_string+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
cmp    %r15,%rax
jbe    114d <copy_string+0x2d>
mov    0x2e99(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
jmp    115a <copy_string+0x3a>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
define i32 @copy_string(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %6
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = load i64, i64* %7
%13 = icmp ugt i64 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* @ENOMEM
%16 = sub nsw i32 0, %15
store i32 %16, i32* %4
br label %21
17: ; preds = %3
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i32 @strcpy(i8* %18, i8* %19)
store i32 0, i32* %4
br label %21
21: ; preds = %17, %14
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
@ENOMEM = global i32 0
define i32 @copy_string(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = icmp ugt i64 %6, %2
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* @ENOMEM
%10 = sub nsw i32 0, %9
br label %13
11: ; preds = %3
%12 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ 0, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ __set_string(char **, int /*<<< orphan*/ *);
void __drop_string(char **str_p) { __set_string(str_p, NULL); }


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

x86 assembly (clang, -O2):
<__drop_string>:
xor    %esi,%esi
jmp    1030 <__set_string@plt>

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

LLVM IR (-O2):
define void @__drop_string(i8** %0) {
%2 = tail call i32 @__set_string(i8** %0, i32* null)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int isDir(const char *path) {
  struct stat st;
  if (stat(path, &st) != 0)
    return 0;
  return S_ISDIR(st.st_mode);
}


x86 assembly (clang, -O0):
<isDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <isDir+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <isDir+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <isDir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISDIR(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISDIR(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
hello() {
  printf("Hello world!\n");
  return (1);
}


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

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void test_max_with_negpos_numbers(void) {
  do {
    seatest_assert_int_equal(12384, ({
                               typeof(-18239547) _a = (-18239547);
                               typeof(12384) _b = (12384);
                               (_a > _b) ? _a : _b;
                             }),
                             __FUNCTION__, 58);
  } while (0);
}


x86 assembly (clang, -O0):
<test_max_with_negpos_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xfee9afc5,-0x4(%rbp)
movl   $0x3060,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113d <test_max_with_negpos_numbers+0x2d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <test_max_with_negpos_numbers+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x3060,%edi
lea    0xea8(%rip),%rdx
mov    $0x3a,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_max_with_negpos_numbers>:
lea    0xee9(%rip),%rdx
mov    $0x3060,%edi
mov    $0x3060,%esi
mov    $0x3a,%ecx
xor    %eax,%eax
jmp    1030 <seatest_assert_int_equal@plt>

LLVM IR (-O0):
@__FUNCTION__.test_max_with_negpos_numbers = [29 x i8] c"test_max_with_negpos_numbers\00"
define void @test_max_with_negpos_numbers() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %0
store i32 -18239547, i32* %1
store i32 12384, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = load i32, i32* %1
br label %12
10: ; preds = %4
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 12384, i32 %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_max_with_negpos_numbers, i64 0, i64 0), i32 58)
br label %16
16: ; preds = %12
ret void
}

LLVM IR (-O2):
@__FUNCTION__.test_max_with_negpos_numbers = [29 x i8] c"test_max_with_negpos_numbers\00"
define void @test_max_with_negpos_numbers() {
%1 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 12384, i32 12384, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__FUNCTION__.test_max_with_negpos_numbers, i64 0, i64 0), i32 58)
ret void
}
int mklow(c)
int c;
{
  if (isupper(c))
    return (tolower(c));
  return (c);
}


x86 assembly (clang, -O0):
<mklow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <isupper@plt>
cmp    $0x0,%eax
je     114c <mklow+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <mklow+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklow>:
push   %rbx
mov    %edi,%ebx
call   1040 <isupper@plt>
test   %eax,%eax
je     1134 <mklow+0x14>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tolower@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mklow(i32 %0) {
%2 = tail call i32 @isupper(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tolower(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double sindg(double);
int main() {
  double x;
  double y;
  x = 30.0;
  y = sindg(30.0);
  printf("sin( %lf ) = %lf", x, y);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec3(%rip),%xmm0
call   1040 <sindg@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xeb0(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xec7(%rip),%xmm0
call   1050 <sindg@plt>
movaps %xmm0,%xmm1
lea    0xec0(%rip),%rdi
movsd  0xeb0(%rip),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"sin( %lf ) = %lf\00"
define i32 @main() {
%1 = tail call double @sindg(double 3.000000e+01)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), double 3.000000e+01, double %1)
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int /*<<< orphan*/);
void cgstorib(void) { ngen("%s\t[bx],al", "mov", 0); }


x86 assembly (clang, -O0):
<cgstorib>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %edx,%edx
call   1030 <ngen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgstorib>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s\09[bx],al\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorib() {
%1 = call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s\09[bx],al\00"
@.str.1 = [4 x i8] c"mov\00"
define void @cgstorib() {
%1 = tail call i32 @ngen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
scalar_t__ getpid();
scalar_t__ getppid();
int /*<<< orphan*/ printf(char *, long, long, int);
int main(void) {
  int x;
  x = 0;
  fork();
  x = 1;
  printf("I am process %ld, my parent is %ld and my x is %d\n", (long)getpid(),
         (long)getppid(), x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getppid@plt>
mov    -0x10(%rbp),%rsi
mov    %rax,%rdx
mov    -0x8(%rbp),%ecx
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xea0(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    $0x1,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"I am process %ld, my parent is %ld and my x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @fork()
store i32 1, i32* %2
%4 = call i64 (...) @getpid()
%5 = call i64 (...) @getppid()
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %4, i64 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"I am process %ld, my parent is %ld and my x is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @getppid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i64 %2, i64 %3, i32 1)
ret i32 0
}
int emac2_etherstatspkts65to127octets_set(
    unsigned int dev_id, union emac2_etherstatspkts65to127octets_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac2_etherstatspkts65to127octets_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac2_etherstatspkts65to127octets_u = type opaque
define i32 @emac2_etherstatspkts65to127octets_set(i32 %0, %union.emac2_etherstatspkts65to127octets_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac2_etherstatspkts65to127octets_u*
store i32 %0, i32* %3
store %union.emac2_etherstatspkts65to127octets_u* %1, %union.emac2_etherstatspkts65to127octets_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac2_etherstatspkts65to127octets_u = type opaque
define i32 @emac2_etherstatspkts65to127octets_set(i32 %0, %union.emac2_etherstatspkts65to127octets_u* nocapture readnone %1) {
ret i32 1
}
regx0imm1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (p0[x0]) = 33; }


x86 assembly (clang, -O0):
<regx0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x21,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0imm1_set>:
movslq %edx,%rax
movl   $0x21,(%r8,%rax,4)
ret

LLVM IR (-O0):
define i32 @regx0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %12
%15 = load i32, i32* %10
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 33, i32* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @regx0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
store i32 33, i32* %8
ret i32 undef
}
int main() {
  float f = 1.0f;
  return 100 * f;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xef1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xee0(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 1.000000e+00, float* %2
%3 = load float, float* %2
%4 = fmul float 1.000000e+02, %3
%5 = fptosi float %4 to i32
ret i32 %5
}

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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void writeGpxEndTrack(FILE *OUT) { fprintf(OUT, "</trkseg>\n</trk>\n"); }


x86 assembly (clang, -O0):
<writeGpxEndTrack>:
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):
<writeGpxEndTrack>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"</trkseg>\0A</trk>\0A\00"
define void @writeGpxEndTrack(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ uart_tx_int16_t(int /*<<< orphan*/);
void log_int16_t(int16_t i) { uart_tx_int16_t(i); }


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

x86 assembly (clang, -O2):
<log_int16_t>:
jmp    1030 <uart_tx_int16_t@plt>

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

LLVM IR (-O2):
define void @log_int16_t(i32 %0) {
%2 = tail call i32 @uart_tx_int16_t(i32 %0)
ret void
}
int cairo_code_draw_envThresholdLabel_get_height() { return 87; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envThresholdLabel_get_height() {
ret i32 87
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envThresholdLabel_get_height() {
ret i32 87
}
/* Variables and functions */
int array(int, int);
int main() {
  return array(0, 1) + array(2, 3) + array(4, 5) + array(6, 7) + array(8, 9);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <array@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <array@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <array@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <array@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x8,%edi
mov    $0x9,%esi
call   1030 <array@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <array@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <array@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x4,%edi
mov    $0x5,%esi
call   1030 <array@plt>
mov    %eax,%ebx
add    %ebp,%ebx
mov    $0x6,%edi
mov    $0x7,%esi
call   1030 <array@plt>
mov    %eax,%ebp
add    %ebx,%ebp
mov    $0x8,%edi
mov    $0x9,%esi
call   1030 <array@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @array(i32 0, i32 1)
%3 = call i32 @array(i32 2, i32 3)
%4 = add nsw i32 %2, %3
%5 = call i32 @array(i32 4, i32 5)
%6 = add nsw i32 %4, %5
%7 = call i32 @array(i32 6, i32 7)
%8 = add nsw i32 %6, %7
%9 = call i32 @array(i32 8, i32 9)
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @array(i32 0, i32 1)
%2 = tail call i32 @array(i32 2, i32 3)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @array(i32 4, i32 5)
%5 = add nsw i32 %3, %4
%6 = tail call i32 @array(i32 6, i32 7)
%7 = add nsw i32 %5, %6
%8 = tail call i32 @array(i32 8, i32 9)
%9 = add nsw i32 %7, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
char *dns_get_edns_opt(char const *, size_t);
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t dns_get_edns_udp_payload_size(const char *rsp, size_t len) {
  const char *opt = dns_get_edns_opt(rsp, len);
  if (opt)
    return ntohs(*(uint16_t *)(opt + 1 + sizeof(uint16_t)));
  return 0;
}


x86 assembly (clang, -O0):
<dns_get_edns_udp_payload_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <dns_get_edns_opt@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1160 <dns_get_edns_udp_payload_size+0x40>
mov    -0x20(%rbp),%rax
mov    0x5(%rax),%edi
call   1040 <ntohs@plt>
mov    %eax,-0x4(%rbp)
jmp    1167 <dns_get_edns_udp_payload_size+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_get_edns_udp_payload_size>:
push   %rax
call   1030 <dns_get_edns_opt@plt>
test   %rax,%rax
je     1134 <dns_get_edns_udp_payload_size+0x14>
mov    0x5(%rax),%edi
pop    %rax
jmp    1040 <ntohs@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dns_get_edns_udp_payload_size(i8* %0, i64 %1) {
%3 = tail call i8* @dns_get_edns_opt(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 5
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @ntohs(i32 %8)
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  char *pointer = (char *)malloc(6563875 * sizeof(char));
  printf("memleak\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)
mov    $0x642823,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x642823,%edi
call   1040 <malloc@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [8 x i8] c"memleak\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 6563875)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_munmap(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


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

x86 assembly (clang, -O2):
<sys_munmap>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_munmap(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_munmap(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Memory_Free(void *block) { free(block); }


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

x86 assembly (clang, -O2):
<Memory_Free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @Memory_Free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main(void) {
  char *s = "Look there";
  char *t = "Look here";
  printf("%d\n", strcmp(s, t));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
char foo6(int);
signed char bar6(int x) { return foo6(x + 6); }


x86 assembly (clang, -O0):
<bar6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x6,%edi
call   1030 <foo6@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar6>:
add    $0x6,%edi
jmp    1030 <foo6@plt>

LLVM IR (-O0):
define signext i8 @bar6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 6
%5 = call signext i8 @foo6(i32 %4)
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @bar6(i32 %0) {
%2 = add nsw i32 %0, 6
%3 = tail call signext i8 @foo6(i32 %2)
ret i8 %3
}
int test_imm_96int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x96 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_96int64_midword_mem>:
testb  $0x96,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 150
%7 = icmp ne i64 %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_96int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9830400
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ NS_GET_PARENT;
int ioctl(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return ioctl(0, NS_GET_PARENT); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
@NS_GET_PARENT = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @NS_GET_PARENT
%3 = call i32 @ioctl(i32 0, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
@NS_GET_PARENT = global i32 0
define i32 @main() {
%1 = load i32, i32* @NS_GET_PARENT
%2 = tail call i32 @ioctl(i32 0, i32 %1)
ret i32 %2
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ output(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int result;
  int n;
  printf("Enter an integer: ");
  scanf("%d", &n);
  result = factorial(n);
  output(result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
mov    %eax,%edi
call   1040 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Enter an integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @factorial(i32 %5)
%7 = call i32 @output(i32 %6)
ret i32 0
}
void g_cclosure_marshal_VOID__ULONG() {}


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

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

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

LLVM IR (-O2):
define void @g_cclosure_marshal_VOID__ULONG() {
ret void
}
/* Type definitions */
typedef unsigned char uint16_t;

/* Variables and functions */
uint16_t read_uint16(unsigned char *source) {
  return (source[0] << 8) | source[1];
}


x86 assembly (clang, -O0):
<read_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint16>:
mov    0x1(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @read_uint16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @read_uint16(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
ret i8 %3
}
void rt2x00crypto_create_tx_descriptor(struct queue_entry *entry,
                                       struct txentry_desc *txdesc) {}


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

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.queue_entry = type opaque
%struct.txentry_desc = type opaque
define void @rt2x00crypto_create_tx_descriptor(%struct.queue_entry* %0, %struct.txentry_desc* %1) {
%3 = alloca %struct.queue_entry*
%4 = alloca %struct.txentry_desc*
store %struct.queue_entry* %0, %struct.queue_entry** %3
store %struct.txentry_desc* %1, %struct.txentry_desc** %4
ret void
}

LLVM IR (-O2):
%struct.queue_entry = type opaque
%struct.txentry_desc = type opaque
define void @rt2x00crypto_create_tx_descriptor(%struct.queue_entry* nocapture %0, %struct.txentry_desc* nocapture %1) {
ret void
}