xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
void we(int result) {
  if (result == -1)
    err(1, "function failed");
}


x86 assembly (clang, -O0):
<we>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1136 <we+0x26>
mov    $0x1,%edi
lea    0xecf(%rip),%rsi
call   1030 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<we>:
cmp    $0xffffffff,%edi
je     1116 <we+0x6>
ret
lea    0xee3(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <err@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"function failed\00"
define void @we(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"function failed\00"
define void @we(i32 %0) {
%2 = icmp eq i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret void
}
void os_perfthr_quit_wait(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ sdnv_len(int /*<<< orphan*/ const *);
int bundle_raw_get_sdnv_off(const uint8_t *raw, const int field_num) {
  int i = 0, off = 0;
  for (i = 0; i < field_num; ++i) {
    off += sdnv_len(raw + off);
  }
  return off;
}


x86 assembly (clang, -O0):
<bundle_raw_get_sdnv_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116f <bundle_raw_get_sdnv_off+0x5f>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <sdnv_len@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <bundle_raw_get_sdnv_off+0x24>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bundle_raw_get_sdnv_off>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1135 <bundle_raw_get_sdnv_off+0x25>
mov    %esi,%ebp
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movslq %ebx,%rbx
lea    (%r14,%rbx,4),%rdi
call   1030 <sdnv_len@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1120 <bundle_raw_get_sdnv_off+0x10>
jmp    1137 <bundle_raw_get_sdnv_off+0x27>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @bundle_raw_get_sdnv_off(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %12, %4 ], [ 0, %2 ]
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i64 @sdnv_len(i32* %8)
%10 = trunc i64 %9 to i32
%11 = add i32 %5, %10
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alist_repeat64(struct hle_t *, int, int, int);
void DUPLICATE(struct hle_t *hle, uint32_t w1, uint32_t w2) {
  uint8_t count = (w1 >> 16);
  uint16_t dmemi = w1;
  uint16_t dmemo = (w2 >> 16);
  alist_repeat64(hle, dmemo, dmemi, count);
}


x86 assembly (clang, -O0):
<DUPLICATE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <alist_repeat64@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DUPLICATE>:
mov    %edx,%eax
mov    %esi,%edx
mov    %esi,%ecx
sar    $0x10,%ecx
sar    $0x10,%eax
mov    %eax,%esi
jmp    1030 <alist_repeat64@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @DUPLICATE(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = alloca %struct.hle_t*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store %struct.hle_t* %0, %struct.hle_t** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = ashr i32 %10, 16
store i32 %11, i32* %7
%12 = load i32, i32* %5
store i32 %12, i32* %8
%13 = load i32, i32* %6
%14 = ashr i32 %13, 16
store i32 %14, i32* %9
%15 = load %struct.hle_t*, %struct.hle_t** %4
%16 = load i32, i32* %9
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = call i32 @alist_repeat64(%struct.hle_t* %15, i32 %16, i32 %17, i32 %18)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @DUPLICATE(%struct.hle_t* %0, i32 %1, i32 %2) {
%4 = ashr i32 %1, 16
%5 = ashr i32 %2, 16
%6 = tail call i32 @alist_repeat64(%struct.hle_t* %0, i32 %5, i32 %1, i32 %4)
ret void
}
void provider2() {}


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

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

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

LLVM IR (-O2):
define void @provider2() {
ret void
}
/* Variables and functions */
scalar_t__ Char_2d_array(int, int);
int **Int_2d_array(int i_size, int j_size) {
  return ((int **)Char_2d_array(i_size, j_size * sizeof(int)));
}


x86 assembly (clang, -O0):
<Int_2d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
movslq -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <Char_2d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_2d_array>:
shl    $0x2,%esi
jmp    1030 <Char_2d_array@plt>

LLVM IR (-O0):
define i32** @Int_2d_array(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i64 @Char_2d_array(i32 %5, i32 %9)
%11 = inttoptr i64 %10 to i32**
ret i32** %11
}

LLVM IR (-O2):
define i32** @Int_2d_array(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @Char_2d_array(i32 %0, i32 %3)
%5 = inttoptr i64 %4 to i32**
ret i32** %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x12() {
  Assert_real((isgraph(18) == 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_isgraph.c",
              95, ("isgraph should be 0 for 0x12"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x12>:
push   %rax
mov    $0x12,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x5f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x12\00"
define void @t_isgraph_0x12() {
%1 = call i64 @isgraph(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x12\00"
define void @t_isgraph_0x12() {
%1 = tail call i64 @isgraph(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void test10(int a[0]) {}


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

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

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

LLVM IR (-O2):
define void @test10(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ ft_memcpy(void *, unsigned char *, unsigned long);
scalar_t__ malloc(int);
void *ft_memmove(void *s1, const void *s2, unsigned long n) {
  unsigned char *buf;
  buf = (unsigned char *)malloc(sizeof(buf) * n);
  (void)ft_memcpy(buf, s2, n);
  (void)ft_memcpy(s1, buf, n);
  (void)free(buf);
  return (s1);
}


x86 assembly (clang, -O0):
<ft_memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <ft_memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <ft_memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memmove>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rdx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   1050 <ft_memcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1050 <ft_memcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @ft_memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = mul i64 8, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @ft_memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %7
%19 = load i64, i64* %6
%20 = call i32 @ft_memcpy(i8* %17, i8* %18, i64 %19)
%21 = load i8*, i8** %7
%22 = call i32 @free(i8* %21)
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @ft_memmove(i8* returned %0, i8* %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = shl i32 %4, 3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @ft_memcpy(i8* %7, i8* %1, i64 %2)
%9 = tail call i32 @ft_memcpy(i8* %0, i8* %7, i64 %2)
%10 = tail call i32 @free(i8* %7)
ret i8* %0
}
void init_own_malloc() {}


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

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

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

LLVM IR (-O2):
define void @init_own_malloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  i = 1 ? 2 : 4;
  printf("number: %i\n", i);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"number: %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x40_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x40_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x40_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x40_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x40_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
/* Variables and functions */
int cos(double);
int sqrt(double);
double zf(double x, double y) {
  return cos(sqrt(x * x + y * y) * 10.0) / (sqrt(x * x + y * y) + 1);
}


x86 assembly (clang, -O0):
<zf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
cvtsi2sd %eax,%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <cos@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zf>:
push   %rbx
sub    $0x10,%rsp
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xeb5(%rip),%xmm0
call   1030 <cos@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <sqrt@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @zf(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call i32 @sqrt(double %10)
%12 = sitofp i32 %11 to double
%13 = fmul double %12, 1.000000e+01
%14 = call i32 @cos(double %13)
%15 = load double, double* %3
%16 = load double, double* %3
%17 = load double, double* %4
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %15, double %16, double %19)
%21 = call i32 @sqrt(double %20)
%22 = add nsw i32 %21, 1
%23 = sdiv i32 %14, %22
%24 = sitofp i32 %23 to double
ret double %24
}

LLVM IR (-O2):
define double @zf(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call i32 @sqrt(double %4)
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 1.000000e+01
%8 = tail call i32 @cos(double %7)
%9 = tail call i32 @sqrt(double %4)
%10 = add nsw i32 %9, 1
%11 = sdiv i32 %8, %10
%12 = sitofp i32 %11 to double
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x21_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x21_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x21_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x21_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x21_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void tegra_mipi_cal_clk_disable(struct tegra_mipi_cal *mipi_cal) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_mipi_cal = type opaque
define void @tegra_mipi_cal_clk_disable(%struct.tegra_mipi_cal* nocapture %0) {
ret void
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$Id: ascmagic.c 10 2006-07-10 18:22:27Z hyin $");
}


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

x86 assembly (clang, -O2):
<rcsid>:
jmp    1100 <rcsid>

LLVM IR (-O0):
@.str = [51 x i8] c"@(#)$Id: ascmagic.c 10 2006-07-10 18:22:27Z hyin $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socketpair(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
int s_pipe(int fd[2]) { return (socketpair(AF_UNIX, SOCK_STREAM, 0, fd)); }


x86 assembly (clang, -O0):
<s_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1030 <socketpair@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_pipe>:
mov    %rdi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socketpair@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @s_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @AF_UNIX
%4 = load i32, i32* @SOCK_STREAM
%5 = load i32*, i32** %2
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
ret i32 %6
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @s_pipe(i32* %0) {
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socketpair(i32 %2, i32 %3, i32 0, i32* %0)
ret i32 %4
}
void gtk_toolbar_insert() {}


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

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

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

LLVM IR (-O2):
define void @gtk_toolbar_insert() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int tgetnum(const char *id) {
  if (strcmp(id, "co") == 0)
    return 80;
  if (strcmp(id, "li") == 0)
    return 25;
  return -1;
}


x86 assembly (clang, -O0):
<tgetnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <tgetnum+0x32>
movl   $0x50,-0x4(%rbp)
jmp    116f <tgetnum+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <tgetnum+0x58>
movl   $0x19,-0x4(%rbp)
jmp    116f <tgetnum+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgetnum>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     113e <tgetnum+0x2e>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x19,%eax
pop    %rbx
ret
mov    $0x50,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"co\00"
@.str.1 = [3 x i8] c"li\00"
define i32 @tgetnum(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 80, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 25, i32* %2
br label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"co\00"
@.str.1 = [3 x i8] c"li\00"
define i32 @tgetnum(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i32 25, i32 -1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 80, %1 ], [ %7, %4 ]
ret i32 %9
}
int xcomp_enabled(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xcomp_enabled() {
ret i32 0
}
int f(int i1, int i2, unsigned u1, unsigned u2) {
  int x = i1 & i2;
  unsigned u = u1 & i2;
  short s = i1 & i2;
  short s2 = i1 + i2;
  u = u1 | u2;
  u = i1 << 3;
  u = u1 >> 4;
  u = u1 >> i1;
  u >>= 3;
  u = i1 ^ u1;
  u = u1 ^ i1;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %ax,-0x1a(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %ax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i16
%12 = alloca i16
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = and i32 %13, %14
store i32 %15, i32* %9
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = and i32 %16, %17
store i32 %18, i32* %10
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = and i32 %19, %20
%22 = trunc i32 %21 to i16
store i16 %22, i16* %11
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
%26 = trunc i32 %25 to i16
store i16 %26, i16* %12
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = or i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %5
%31 = shl i32 %30, 3
store i32 %31, i32* %10
%32 = load i32, i32* %7
%33 = lshr i32 %32, 4
store i32 %33, i32* %10
%34 = load i32, i32* %7
%35 = load i32, i32* %5
%36 = lshr i32 %34, %35
store i32 %36, i32* %10
%37 = load i32, i32* %10
%38 = lshr i32 %37, 3
store i32 %38, i32* %10
%39 = load i32, i32* %5
%40 = load i32, i32* %7
%41 = xor i32 %39, %40
store i32 %41, i32* %10
%42 = load i32, i32* %7
%43 = load i32, i32* %5
%44 = xor i32 %42, %43
store i32 %44, i32* %10
%45 = load i32, i32* %9
ret i32 %45
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, %0
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ mystrcpy(char *, char *);
scalar_t__ mystrlen(char *);
char *mystrdup(char *src) {
  if (src) {
    char *ptr = (char *)malloc(mystrlen(src) + 1);
    mystrcpy(ptr, src);
    return ptr;
  } else
    return NULL;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <mystrdup+0x4a>
mov    -0x10(%rbp),%rdi
call   1040 <mystrlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <mystrcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <mystrdup+0x52>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <mystrdup+0x2a>
mov    %rdi,%rbx
call   1040 <mystrlen@plt>
lea    0x1(%rax),%rdi
call   1030 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1050 <mystrcpy@plt>
jmp    115d <mystrdup+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @mystrlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i64 @malloc(i64 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @mystrcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %18
17: ; preds = %1
store i8* null, i8** %2
br label %18
18: ; preds = %17, %7
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @mystrlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @mystrcpy(i8* %7, i8* %0)
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
double fabs(double);
double absolute_error(double measured, double actual) {
  return fabs(measured - actual);
}


x86 assembly (clang, -O0):
<absolute_error>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute_error>:
subsd  %xmm1,%xmm0
andpd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @absolute_error(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
%8 = call double @llvm.fabs.f64(double %7)
ret double %8
}

LLVM IR (-O2):
define double @absolute_error(double %0, double %1) {
%3 = fsub double %0, %1
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
/* Variables and functions */
char gibberish();
void bar(char *foo) {
  long whizzo;
  short spazzo;
  if (*foo == gibberish())
    whizzo = spazzo;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <gibberish@plt>
mov    %al,%cl
mov    -0x18(%rbp),%eax
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1146 <bar+0x36>
movswq -0x12(%rbp),%rax
mov    %rax,-0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @bar(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i16
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = call signext i8 (...) @gibberish()
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i16, i16* %4
%13 = sext i16 %12 to i64
store i64 %13, i64* %3
br label %14
14: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @bar(i8* nocapture %0) {
%2 = tail call signext i8 (...) @gibberish()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_magic_number(int, int, int);
uint32_t n_map(uint32_t rn, int rank, int var_p) {
  uint32_t m0;
  uint32_t m1;
  uint32_t s;
  m0 = get_magic_number(rank, var_p, 0);
  m1 = get_magic_number(rank, var_p, 1);
  s = (1 << var_p);
  return ((rn & m0) << s) | ((rn & m1) >> s);
}


x86 assembly (clang, -O0):
<n_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1030 <get_magic_number@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <get_magic_number@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x18(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
and    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_map>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r12d
mov    %esi,%r15d
mov    %edi,%r14d
mov    %esi,%edi
mov    %edx,%esi
xor    %edx,%edx
call   1030 <get_magic_number@plt>
mov    %eax,%ebp
mov    $0x1,%ebx
mov    %r15d,%edi
mov    %r12d,%esi
mov    $0x1,%edx
call   1030 <get_magic_number@plt>
mov    %r12d,%ecx
shl    %cl,%ebx
and    %r14d,%ebp
mov    %ebx,%ecx
shl    %cl,%ebp
and    %r14d,%eax
sar    %cl,%eax
or     %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @n_map(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @get_magic_number(i32 %10, i32 %11, i32 0)
store i32 %12, i32* %7
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @get_magic_number(i32 %13, i32 %14, i32 1)
store i32 %15, i32* %8
%16 = load i32, i32* %6
%17 = shl i32 1, %16
store i32 %17, i32* %9
%18 = load i32, i32* %4
%19 = load i32, i32* %7
%20 = and i32 %18, %19
%21 = load i32, i32* %9
%22 = shl i32 %20, %21
%23 = load i32, i32* %4
%24 = load i32, i32* %8
%25 = and i32 %23, %24
%26 = load i32, i32* %9
%27 = ashr i32 %25, %26
%28 = or i32 %22, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @n_map(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @get_magic_number(i32 %1, i32 %2, i32 0)
%5 = tail call i32 @get_magic_number(i32 %1, i32 %2, i32 1)
%6 = shl nuw i32 1, %2
%7 = and i32 %4, %0
%8 = shl i32 %7, %6
%9 = and i32 %5, %0
%10 = ashr i32 %9, %6
%11 = or i32 %10, %8
ret i32 %11
}
int open_thin_subvol(struct mosaic *m, struct volume *v, int open_flags) {
  return -1;
}


x86 assembly (clang, -O0):
<open_thin_subvol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @open_thin_subvol(%struct.mosaic* %0, %struct.volume* %1, i32 %2) {
%4 = alloca %struct.mosaic*
%5 = alloca %struct.volume*
%6 = alloca i32
store %struct.mosaic* %0, %struct.mosaic** %4
store %struct.volume* %1, %struct.volume** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @open_thin_subvol(%struct.mosaic* nocapture readnone %0, %struct.volume* nocapture readnone %1, i32 %2) {
ret i32 -1
}
int dc_get_char_shift(int pos, int buflen) {
  int shift;
  if (pos % 2 == 1)
    shift = (0 + ((pos + 1) / 2));
  else
    shift = (buflen - ((pos / 2)));
  return shift;
}


x86 assembly (clang, -O0):
<dc_get_char_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1137 <dc_get_char_shift+0x37>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x0,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <dc_get_char_shift+0x52>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_get_char_shift>:
mov    %esi,%eax
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
mov    %ecx,%edx
and    $0xfffffffe,%edx
mov    %edi,%esi
sub    %edx,%esi
cmp    $0x1,%esi
jne    1127 <dc_get_char_shift+0x27>
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0x1,%eax
sar    %eax
ret
sar    %ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @dc_get_char_shift(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 = srem i32 %6, 2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
%12 = sdiv i32 %11, 2
%13 = add nsw i32 0, %12
store i32 %13, i32* %5
br label %19
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 2
%18 = sub nsw i32 %15, %17
store i32 %18, i32* %5
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @dc_get_char_shift(i32 %0, i32 %1) {
%3 = srem i32 %0, 2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = add nsw i32 %0, 1
%7 = sdiv i32 %6, 2
br label %11
8: ; preds = %2
%9 = sdiv i32 %0, -2
%10 = add i32 %9, %1
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
size_t strlen(char const *);
__attribute__((visibility("default"))) size_t trio_length(const char *string) {
  return strlen(string);
}


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

x86 assembly (clang, -O2):
<trio_length>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i64 @trio_length(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
ret i64 %2
}
/* Variables and functions */
char const *file_name_from_path_count(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
const char *file_name_from_path(const char *path) {
  return (file_name_from_path_count(path, strlen(path)));
}


x86 assembly (clang, -O0):
<file_name_from_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <file_name_from_path_count@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_name_from_path>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <file_name_from_path_count@plt>

LLVM IR (-O0):
define i8* @file_name_from_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @file_name_from_path_count(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @file_name_from_path(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @file_name_from_path_count(i8* %0, i32 %2)
ret i8* %3
}
int main() {
  int a[1];
  int b[1];
  a[0] = 1;
  b[0] = 1;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca [1 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 1, i32* %4
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 1, i32* %5
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void invalid_string(int string) {
  fprintf(stderr, "Invalid string %d\n", string);
}


x86 assembly (clang, -O0):
<invalid_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_string>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Invalid string %d\0A\00"
define void @invalid_string(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Invalid string %d\0A\00"
define void @invalid_string(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned int fib(unsigned int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add i32 %4, -2
%10 = add i32 %8, %3
br label %2
11: ; preds = %2
%12 = add i32 %4, %3
ret i32 %12
}
void int_setup() {
  unsigned short *table_limit = (unsigned short *)(0x100000 + 2048);
  unsigned int *table_address = (unsigned int *)((0x100000 + 2048) + 2);
  *table_limit = 256 * 8 - 1;
  *table_address = 0x100000;
  int_remap(0x20, 0x28);
  __asm__("lidt 0(,%0,)" ::"a"((0x100000 + 2048)));
}


x86 assembly (clang, -O0):
<int_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x100800,%eax
mov    %rax,-0x8(%rbp)
mov    $0x100802,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movw   $0x7ff,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x100000,(%rax)
mov    $0x20,%edi
mov    $0x28,%esi
mov    $0x0,%al
call   1030 <int_remap@plt>
mov    $0x100800,%eax
lidt   0x0(,%eax,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_setup>:
push   %rax
movw   $0x7ff,0x100800
movl   $0x100000,0x100802
mov    $0x20,%edi
mov    $0x28,%esi
xor    %eax,%eax
call   1030 <int_remap@plt>
mov    $0x100800,%eax
lidt   0x0(,%eax,1)
pop    %rax
ret

LLVM IR (-O0):
define void @int_setup() {
%1 = alloca i16*
%2 = alloca i32*
store i16* inttoptr (i64 1050624 to i16*), i16** %1
store i32* inttoptr (i64 1050626 to i32*), i32** %2
%3 = load i16*, i16** %1
store i16 2047, i16* %3
%4 = load i32*, i32** %2
store i32 1048576, i32* %4
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @int_remap to i32 (i32, i32, ...)*)(i32 32, i32 40)
ret void
}

LLVM IR (-O2):
define void @int_setup() {
store i16 2047, i16* inttoptr (i64 1050624 to i16*)
store i32 1048576, i32* inttoptr (i64 1050626 to i32*)
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @int_remap to i32 (i32, i32, ...)*)(i32 32, i32 40)
tail call void asm sideeffect "lidt 0(,$0,)", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 1050624)
ret void
}
/* Variables and functions */
unsigned long long get_reverse_complement(unsigned long long, unsigned int);
unsigned long long get_canonical_word(unsigned long long word,
                                      unsigned int wordlength) {
  unsigned long long rev_word;
  rev_word = get_reverse_complement(word, wordlength);
  return word < rev_word ? word : rev_word;
}


x86 assembly (clang, -O0):
<get_canonical_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <get_reverse_complement@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114a <get_canonical_word+0x3a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1152 <get_canonical_word+0x42>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_canonical_word>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_reverse_complement@plt>
cmp    %rbx,%rax
cmova  %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @get_canonical_word(i64 %0, i32 %1) {
%3 = tail call i64 @get_reverse_complement(i64 %0, i32 %1)
%4 = icmp ugt i64 %3, %0
%5 = select i1 %4, i64 %0, i64 %3
ret i64 %5
}