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

/* Variables and functions */
int /*<<< orphan*/ glGetFloatv(int /*<<< orphan*/, float *);
void dumpmat(GLenum mat, const char *s) {
  float m[16];
  glGetFloatv(mat, m);
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<dumpmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x50(%rbp),%rsi
call   1030 <glGetFloatv@plt>
jmp    1130 <dumpmat+0x20>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpmat>:
sub    $0x48,%rsp
mov    %rsp,%rsi
call   1030 <glGetFloatv@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @dumpmat(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [16 x float]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [16 x float], [16 x float]* %5, i64 0, i64 0
%8 = call i32 @glGetFloatv(i32 %6, float* %7)
br label %9
9: ; preds = %2
br label %10
10: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @dumpmat(i32 %0, i8* nocapture readnone %1) {
%3 = alloca [16 x float]
%4 = bitcast [16 x float]* %3 to i8*
%5 = getelementptr inbounds [16 x float], [16 x float]* %3, i64 0, i64 0
%6 = call i32 @glGetFloatv(i32 %0, float* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x60() {
  Assert_real((isgraph(96)),
              "/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",
              485, ("isgraph should be 1 for `"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x60,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1e5,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x60>:
push   %rax
mov    $0x60,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1e5,%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 = [26 x i8] c"isgraph should be 1 for `\00"
define void @t_isgraph_0x60() {
%1 = call i32 @isgraph(i32 96)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isgraph should be 1 for `\00"
define void @t_isgraph_0x60() {
%1 = tail call i32 @isgraph(i32 96)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ machdep_SystemInit();
void McSrv_SystemInit(void) { machdep_SystemInit(); }


x86 assembly (clang, -O0):
<McSrv_SystemInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <machdep_SystemInit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @McSrv_SystemInit() {
%1 = call i32 (...) @machdep_SystemInit()
ret void
}

LLVM IR (-O2):
define void @McSrv_SystemInit() {
%1 = tail call i32 (...) @machdep_SystemInit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void sp_nonblocking(int fd) {
  int flag = fcntl(fd, F_GETFL, 0);
  if (-1 == flag) {
    return;
  }
  fcntl(fd, F_SETFL, flag | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<sp_nonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    -0x8(%rbp),%eax
jne    1144 <sp_nonblocking+0x34>
jmp    1161 <sp_nonblocking+0x51>
mov    -0x4(%rbp),%edi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e8e(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_nonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1144 <sp_nonblocking+0x34>
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb0(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @sp_nonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 -1, %7
br i1 %8, label %9, label %10
9: ; preds = %1
br label %17
10: ; preds = %1
%11 = load i32, i32* %2
%12 = load i32, i32* @F_SETFL
%13 = load i32, i32* %3
%14 = load i32, i32* @O_NONBLOCK
%15 = or i32 %13, %14
%16 = call i32 @fcntl(i32 %11, i32 %12, i32 %15)
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @sp_nonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %7, %3
%9 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %8)
br label %10
10: ; preds = %1, %5
ret void
}
void mxc_gpio_set(unsigned int gpio, unsigned int value) {}


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

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

LLVM IR (-O0):
define void @mxc_gpio_set(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @mxc_gpio_set(i32 %0, i32 %1) {
ret void
}
int dequeue(int *items, int *_head, int cap) {
  int head = *_head;
  int item = items[head];
  *_head = (head + 1) % cap;
  return item;
}


x86 assembly (clang, -O0):
<dequeue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dequeue>:
mov    %edx,%ecx
movslq (%rsi),%rax
mov    (%rdi,%rax,4),%edi
add    $0x1,%eax
cltd
idiv   %ecx
mov    %edx,(%rsi)
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @dequeue(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %4
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %6
%19 = srem i32 %17, %18
%20 = load i32*, i32** %5
store i32 %19, i32* %20
%21 = load i32, i32* %8
ret i32 %21
}

LLVM IR (-O2):
define i32 @dequeue(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = add nsw i32 %4, 1
%9 = srem i32 %8, %2
store i32 %9, i32* %1
ret i32 %7
}
void pixie_end_thread() {}


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

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

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

LLVM IR (-O2):
define void @pixie_end_thread() {
ret void
}
/* Variables and functions */
int add(char const *, int);
char *strrchr(char const *, char);
int loader_add_dir_from_file(const char *fname) {
  const char *slash = strrchr(fname, '/');
  return slash ? add(fname, slash - fname + 1) : add("./", 2);
}


x86 assembly (clang, -O0):
<loader_add_dir_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <loader_add_dir_from_file+0x4b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%esi
call   1030 <add@plt>
mov    %eax,-0x14(%rbp)
jmp    117f <loader_add_dir_from_file+0x5f>
lea    0xe8e(%rip),%rdi
mov    $0x2,%esi
call   1030 <add@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_add_dir_from_file>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1143 <loader_add_dir_from_file+0x23>
sub    %ebx,%eax
add    $0x1,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <add@plt>
lea    0xeb6(%rip),%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <add@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"./\00"
define i32 @loader_add_dir_from_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = add nsw i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = call i32 @add(i8* %9, i32 %16)
br label %20
18: ; preds = %1
%19 = call i32 @add(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
br label %20
20: ; preds = %18, %8
%21 = phi i32 [ %17, %8 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
define i32 @loader_add_dir_from_file(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = ptrtoint i8* %2 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = add i32 %8, 1
%10 = tail call i32 @add(i8* %0, i32 %9)
br label %13
11: ; preds = %1
%12 = tail call i32 @add(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
br label %13
13: ; preds = %11, %4
%14 = phi i32 [ %10, %4 ], [ %12, %11 ]
ret i32 %14
}
int bswapl(int data) {
  int res;
  __asm__("bswap %%eax" : "=a"(res) : "a"(data));
  return res;
}


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

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

LLVM IR (-O0):
define i32 @bswapl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bswap %eax", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @bswapl(i32 %0) {
%2 = tail call i32 asm "bswap %eax", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
void output_temp(E, file_number) struct All_variables *E;
int file_number;
{
  int m, nno, i, j, fd;
  char output_file[255];
  return;
}


x86 assembly (clang, -O0):
<output_temp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
add    $0xa0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.All_variables = type opaque
define void @output_temp(%struct.All_variables* %0, i32 %1) {
%3 = alloca %struct.All_variables*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [255 x i8]
store %struct.All_variables* %0, %struct.All_variables** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.All_variables = type opaque
define void @output_temp(%struct.All_variables* nocapture %0, i32 %1) {
ret void
}
int scmp(const void *p, const void *q) {
  int l = ((int *)p)[0];
  int r = ((int *)q)[0];
  return (l - r);
}


x86 assembly (clang, -O0):
<scmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scmp>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @scmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = getelementptr inbounds i32, i32* %12, i64 0
%14 = load i32, i32* %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = sub nsw i32 %15, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @scmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct pattern {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ obvious_false_eye(int, int);
int offset(int /*<<< orphan*/, int, int, int);
int autohelperowl_attackpat158(struct pattern *patt, int transformation,
                               int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, -1, move, transformation);
  return !obvious_false_eye(a, (1 + 2 - (color)));
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat158>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x3,%esi
sub    -0x14(%rbp),%esi
call   1030 <obvious_false_eye@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat158>:
push   %rbx
mov    %ecx,%ebx
mov    %esi,%ecx
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1040 <offset@plt>
mov    $0x3,%esi
sub    %ebx,%esi
mov    %eax,%edi
call   1030 <obvious_false_eye@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat158(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 -1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = load i32, i32* %9
%20 = sub nsw i32 3, %19
%21 = call i32 @obvious_false_eye(i32 %18, i32 %20)
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat158(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 -1, i32 %2, i32 %1)
%7 = sub nsw i32 3, %3
%8 = tail call i32 @obvious_false_eye(i32 %6, i32 %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
float BMP180_readPressure();
double pow(float, double);
float BMP180_readAltitude(float sealevelPressure) {
  float altitude;
  float pressure = BMP180_readPressure();
  altitude = 44330 * (1.0 - pow(pressure / sealevelPressure / 100, 0.1903));
  return altitude;
}


x86 assembly (clang, -O0):
<BMP180_readAltitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <BMP180_readPressure@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x4(%rbp),%xmm0
movss  0xecd(%rip),%xmm1
divss  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xea4(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xe90(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BMP180_readAltitude>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <BMP180_readPressure@plt>
divss  0x4(%rsp),%xmm0
divss  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xebf(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xebb(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @BMP180_readAltitude(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float (...) @BMP180_readPressure()
store float %5, float* %4
%6 = load float, float* %4
%7 = load float, float* %2
%8 = fdiv float %6, %7
%9 = fdiv float %8, 1.000000e+02
%10 = call double @pow(float %9, double 1.903000e-01)
%11 = fsub double 1.000000e+00, %10
%12 = fmul double 4.433000e+04, %11
%13 = fptrunc double %12 to float
store float %13, float* %3
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @BMP180_readAltitude(float %0) {
%2 = tail call float (...) @BMP180_readPressure()
%3 = fdiv float %2, %0
%4 = fdiv float %3, 1.000000e+02
%5 = tail call double @pow(float %4, double 1.903000e-01)
%6 = fsub double 1.000000e+00, %5
%7 = fmul double %6, 4.433000e+04
%8 = fptrunc double %7 to float
ret float %8
}
int q_isdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<q_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <q_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<q_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @q_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @q_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *s1) {
  char *s2;
  if (s2 = (char *)malloc(strlen(s1) + 1))
    strcpy(s2, s1);
  return s2;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116c <strdup+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void recurse(void) {
  char c;
  char iptr[10000];
  printf("&c     = 0x%lx, iptr = 0x%lx  ...  ", &c, iptr);
  fflush(stdout);
  c = iptr[0];
  printf("ok\n");
  recurse();
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2720,%rsp
lea    -0x2720(%rbp),%rdx
lea    0xeb7(%rip),%rdi
lea    -0x1(%rbp),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x2720(%rbp),%al
mov    %al,-0x1(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
call   1030 <recurse@plt>
add    $0x2720,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
sub    $0x2728,%rsp
lea    0xeb2(%rip),%rdi
lea    0xf(%rsp),%rsi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
mov    0x10(%rsp),%al
mov    %al,0xf(%rsp)
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
call   1030 <recurse@plt>
add    $0x2728,%rsp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"&c = 0x%lx, iptr = 0x%lx ... \00"
@stdout = global i32 0
@.str.1 = [4 x i8] c"ok\0A\00"
define void @recurse() {
%1 = alloca i8
%2 = alloca [10000 x i8]
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"&c = 0x%lx, iptr = 0x%lx ... \00"
@stdout = global i32 0
@str = [3 x i8] c"ok\00"
define void @recurse() {
%1 = alloca i8
%2 = alloca [10000 x i8]
%3 = getelementptr inbounds [10000 x i8], [10000 x i8]* %2, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i8, i8* %3
store i8 %7, i8* %1
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FW_CDEV_LONG_RESET;
int /*<<< orphan*/ do_bus_reset(int /*<<< orphan*/);
void do_long_reset(void) { do_bus_reset(FW_CDEV_LONG_RESET); }


x86 assembly (clang, -O0):
<do_long_reset>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <do_bus_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_long_reset>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <do_bus_reset@plt>

LLVM IR (-O0):
@FW_CDEV_LONG_RESET = global i32 0
define void @do_long_reset() {
%1 = load i32, i32* @FW_CDEV_LONG_RESET
%2 = call i32 @do_bus_reset(i32 %1)
ret void
}

LLVM IR (-O2):
@FW_CDEV_LONG_RESET = global i32 0
define void @do_long_reset() {
%1 = load i32, i32* @FW_CDEV_LONG_RESET
%2 = tail call i32 @do_bus_reset(i32 %1)
ret void
}
void test_41_1(short *mem) { __atomic_fetch_xor(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_41_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0xffff,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x24(%rbp)
xor    %esi,%edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    115d <test_41_1+0x5d>
jmp    1125 <test_41_1+0x25>
mov    -0x1a(%rbp),%ax
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_41_1>:
lock xorw $0xffff,(%rdi)
ret

LLVM IR (-O0):
define void @test_41_1(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
store i16 -1, i16* %3
%6 = load i16, i16* %3
%7 = atomicrmw xor i16* %5, i16 %6 acq_rel
store i16 %7, i16* %4
%8 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @test_41_1(i16* nocapture %0) {
%2 = atomicrmw xor i16* %0, i16 -1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void print_version(const char *name) {
  fprintf(stderr, "%s (%s)\n", name, "0.0.1");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
lea    0xed2(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xedf(%rip),%rcx
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"%s (%s)\0A\00"
@.str.1 = [6 x i8] c"0.0.1\00"
define void @print_version(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int detect();
int /*<<< orphan*/ printf(char *);
void get_subarchitecture(void) {
  if (detect() == 1) {
    printf("LOONGSON3R5");
  } else {
    printf("UNKNOWN");
  }
}


x86 assembly (clang, -O0):
<get_subarchitecture>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <detect@plt>
cmp    $0x1,%eax
jne    1145 <get_subarchitecture+0x25>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    1151 <get_subarchitecture+0x31>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_subarchitecture>:
push   %rax
xor    %eax,%eax
call   1040 <detect@plt>
cmp    $0x1,%eax
lea    0xece(%rip),%rax
lea    0xed3(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"LOONGSON3R5\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
define void @get_subarchitecture() {
%1 = call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"LOONGSON3R5\00"
@.str.1 = [8 x i8] c"UNKNOWN\00"
define void @get_subarchitecture() {
%1 = tail call i32 (...) @detect()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret void
}
int foo(int x) { return x * 100; }


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

x86 assembly (clang, -O2):
<foo>:
imul   $0x64,%edi,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 100
ret i32 %2
}
int dbg_is_chk_orph(const struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @dbg_is_chk_orph(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *receive_message(int /*<<< orphan*/);
int /*<<< orphan*/ release_memory_block(void *);
void *request_memory_block();
int /*<<< orphan*/ send_message(int, void *);
void mem_test_blocking2() {
  void *msg = receive_message(0);
  void *msgBack = request_memory_block();
  send_message(27, msgBack);
  release_memory_block(msg);
}


x86 assembly (clang, -O0):
<mem_test_blocking2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <receive_message@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <request_memory_block@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x1b,%edi
call   1040 <send_message@plt>
mov    -0x8(%rbp),%rdi
call   1060 <release_memory_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_test_blocking2>:
push   %rbx
xor    %edi,%edi
call   1050 <receive_message@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <request_memory_block@plt>
mov    $0x1b,%edi
mov    %rax,%rsi
call   1040 <send_message@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <release_memory_block@plt>

LLVM IR (-O0):
define void @mem_test_blocking2() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* @receive_message(i32 0)
store i8* %3, i8** %1
%4 = call i8* (...) @request_memory_block()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @send_message(i32 27, i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @release_memory_block(i8* %7)
ret void
}

LLVM IR (-O2):
define void @mem_test_blocking2() {
%1 = tail call i8* @receive_message(i32 0)
%2 = tail call i8* (...) @request_memory_block()
%3 = tail call i32 @send_message(i32 27, i8* %2)
%4 = tail call i32 @release_memory_block(i8* %1)
ret void
}
void _Z11_Jv_ZMallocPvjj(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z11_Jv_ZMallocPvjj() {
ret void
}
unsigned long UARTFlowControlGet(unsigned long ulBase) {
  ;

  ;
  return ((*((volatile unsigned long *)(ulBase + 0x00000030))) &
          (0x00008000 | 0x00004000));
}


x86 assembly (clang, -O0):
<UARTFlowControlGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
and    $0xc000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTFlowControlGet>:
mov    0x30(%rdi),%rax
and    $0xc000,%eax
ret

LLVM IR (-O0):
define i64 @UARTFlowControlGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 48
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 49152
ret i64 %7
}

LLVM IR (-O2):
define i64 @UARTFlowControlGet(i64 %0) {
%2 = add i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 49152
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char str[100] = "abc";
  str[0] = 'b';
  str[1] = 'd';
  str[2] = 'f';
  strcpy(str, "bcd");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x61,-0x80(%rbp)
movb   $0x62,-0x7f(%rbp)
movb   $0x63,-0x7e(%rbp)
movb   $0x62,-0x80(%rbp)
movb   $0x64,-0x7f(%rbp)
movb   $0x66,-0x7e(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movw   $0x6462,(%rsp)
movb   $0x66,0x2(%rsp)
lea    0xeb2(%rip),%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"bcd\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [100 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = bitcast [100 x i8]* %5 to i8*
%7 = bitcast i8* %6 to [100 x i8]*
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 0
store i8 97, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 1
store i8 98, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i32 0, i32 2
store i8 99, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
store i8 98, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 1
store i8 100, i8* %12
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 2
store i8 102, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"bcd\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 1
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 2
store i8 98, i8* %4
store i8 100, i8* %5
store i8 102, i8* %6
%7 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int Sign(int val) {
  if (val < 0)
    return -1;
  if (val > 0)
    return +1;
  return 0;
}


x86 assembly (clang, -O0):
<Sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <Sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <Sign+0x3a>
cmpl   $0x0,-0x8(%rbp)
jle    1133 <Sign+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <Sign+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void error() {
  perror("ERROR");
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
define void @error() {
%1 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @error() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __mark_inode_dirty(struct inode *, int);
__attribute__((always_)) void mark_inode_dirty_sync(struct inode *inode) {
  __mark_inode_dirty(inode, 1);
}


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

x86 assembly (clang, -O2):
<mark_inode_dirty_sync>:
mov    $0x1,%esi
jmp    1030 <__mark_inode_dirty@plt>

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

LLVM IR (-O2):
%struct.inode = type { i32 }
define void @mark_inode_dirty_sync(%struct.inode* %0) {
%2 = tail call i32 @__mark_inode_dirty(%struct.inode* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(int *, int *, int);
void strncpy_bad3() {
  int arr1[10];
  int arr2[20];
  strncpy(arr1, arr2, -1);
}


x86 assembly (clang, -O0):
<strncpy_bad3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0xffffffff,%edx
call   1030 <strncpy@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_bad3>:
sub    $0x88,%rsp
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
mov    $0xffffffff,%edx
call   1030 <strncpy@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
define void @strncpy_bad3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%5 = call i32 @strncpy(i32* %3, i32* %4, i32 -1)
ret void
}

LLVM IR (-O2):
define void @strncpy_bad3() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @strncpy(i32* %5, i32* %6, i32 -1)
ret void
}
/* Variables and functions */
int fstat(int, void *);
int lisp_fstat(int fd, void *buf) { return fstat(fd, buf); }


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

x86 assembly (clang, -O2):
<lisp_fstat>:
jmp    1030 <fstat@plt>

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

LLVM IR (-O2):
define i32 @lisp_fstat(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @fstat(i32 %0, i8* %1)
ret i32 %3
}
/* Type definitions */
struct server_attr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_request_data(struct server_attr *);
int /*<<< orphan*/ send_request_header(struct server_attr *);
void send_request(struct server_attr *attr) {
  send_request_header(attr);
  send_request_data(attr);
}


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

x86 assembly (clang, -O2):
<send_request>:
push   %rbx
mov    %rdi,%rbx
call   1030 <send_request_header@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <send_request_data@plt>

LLVM IR (-O0):
%struct.server_attr = type { i32 }
define void @send_request(%struct.server_attr* %0) {
%2 = alloca %struct.server_attr*
store %struct.server_attr* %0, %struct.server_attr** %2
%3 = load %struct.server_attr*, %struct.server_attr** %2
%4 = call i32 @send_request_header(%struct.server_attr* %3)
%5 = load %struct.server_attr*, %struct.server_attr** %2
%6 = call i32 @send_request_data(%struct.server_attr* %5)
ret void
}

LLVM IR (-O2):
%struct.server_attr = type { i32 }
define void @send_request(%struct.server_attr* %0) {
%2 = tail call i32 @send_request_header(%struct.server_attr* %0)
%3 = tail call i32 @send_request_data(%struct.server_attr* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myprint(char *, int);
int choose(int a, int b) {
  if (a >= b) {
    myprint("this is 1st one\n", 16);
  } else {
    myprint("this is 2nd one\n", 16);
  }
  return 0;
}


x86 assembly (clang, -O0):
<choose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1140 <choose+0x30>
lea    0xecf(%rip),%rdi
mov    $0x10,%esi
call   1030 <myprint@plt>
jmp    1151 <choose+0x41>
lea    0xeca(%rip),%rdi
mov    $0x10,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<choose>:
push   %rax
cmp    %esi,%edi
lea    0xef7(%rip),%rax
lea    0xedf(%rip),%rdi
cmovl  %rax,%rdi
mov    $0x10,%esi
call   1030 <myprint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"this is 1st one\0A\00"
@.str.1 = [17 x i8] c"this is 2nd one\0A\00"
define i32 @choose(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 = icmp sge i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @myprint(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 16)
br label %12
10: ; preds = %2
%11 = call i32 @myprint(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 16)
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"this is 1st one\0A\00"
@.str.1 = [17 x i8] c"this is 2nd one\0A\00"
define i32 @choose(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @myprint(i8* %4, i32 16)
ret i32 0
}
void ft_add_test_case(int *data, int nb, int power, int result) {
  data[0] = nb;
  data[1] = power;
  data[2] = result;
}


x86 assembly (clang, -O0):
<ft_add_test_case>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_add_test_case>:
mov    %esi,(%rdi)
mov    %edx,0x4(%rdi)
mov    %ecx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @ft_add_test_case(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3) {
store i32 %1, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %2, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int32_t implicitSignChange(uint32_t argc) {
  fprintf(stderr, "TEST\n");
  return argc;
}


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

x86 assembly (clang, -O2):
<implicitSignChange>:
push   %rbx
mov    %edi,%ebx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"TEST\0A\00"
define i32 @implicitSignChange(i32 returned %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ Fail(char const *);
int ReadNumber(int);
int /*<<< orphan*/ Ws(char *);
int ReadInstructionAddress(const char *dest) {
  int addr = ReadNumber(1);
  if (addr & 1) {
    Ws("Expecting even instruction address for ");
    Fail(dest);
  }
  return addr;
}


x86 assembly (clang, -O0):
<ReadInstructionAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <ReadNumber@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     116d <ReadInstructionAddress+0x3d>
lea    0xea1(%rip),%rdi
call   1030 <Ws@plt>
mov    -0x8(%rbp),%rdi
call   1050 <Fail@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadInstructionAddress>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <ReadNumber@plt>
mov    %eax,%ebp
test   $0x1,%bpl
je     115c <ReadInstructionAddress+0x2c>
lea    0xeb1(%rip),%rdi
call   1030 <Ws@plt>
mov    %rbx,%rdi
call   1050 <Fail@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Expecting even instruction address for \00"
define i32 @ReadInstructionAddress(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @ReadNumber(i32 1)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @Ws(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %2
%11 = call i32 @Fail(i8* %10)
br label %12
12: ; preds = %8, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [40 x i8] c"Expecting even instruction address for \00"
define i32 @ReadInstructionAddress(i8* %0) {
%2 = tail call i32 @ReadNumber(i32 1)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @Ws(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @Fail(i8* %0)
br label %8
8: ; preds = %5, %1
ret i32 %2
}