xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void erase_area(void *addr, size_t size) {
  memset(addr, 0, size);
  *(volatile char *)addr = *(volatile char *)addr;
  ;
}


x86 assembly (clang, -O0):
<erase_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_area>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <memset@plt>
mov    (%rbx),%al
mov    %al,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @erase_area(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
%8 = load i8*, i8** %3
%9 = load volatile i8, i8* %8
%10 = load i8*, i8** %3
store volatile i8 %9, i8* %10
ret void
}

LLVM IR (-O2):
define void @erase_area(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%4 = load volatile i8, i8* %0
store volatile i8 %4, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int setnonblocking(int fd) {
  int flags;
  if (-1 == (flags = fcntl(fd, F_GETFL, 0))) {
    flags = 0;
  }
  return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<setnonblocking>:
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,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1147 <setnonblocking+0x37>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e8b(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
cmovne %eax,%ebp
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
or     (%rax),%ebp
mov    %ebx,%edi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnonblocking(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 = icmp eq i32 -1, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = load i32, i32* @O_NONBLOCK
%14 = or i32 %12, %13
%15 = call i32 @fcntl(i32 %10, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setnonblocking(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
%5 = select i1 %4, i32 0, i32 %3
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %5, %7
%9 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void method_(int *i) { printf("-DFORTRAN_SINGLE_TRAILINGBAR"); }


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"-DFORTRAN_SINGLE_TRAILINGBAR\00"
define void @method_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"-DFORTRAN_SINGLE_TRAILINGBAR\00"
define void @method_(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *my_strstr(char const *, char const *);
int my_strpos(const char *needle, const char *haystack) {
  char *s = my_strstr(needle, haystack);
  if (s)
    return (int)(s - haystack);
  else
    return -1;
}


x86 assembly (clang, -O0):
<my_strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <my_strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <my_strpos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <my_strpos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strpos>:
push   %rbx
mov    %rsi,%rbx
call   1030 <my_strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @my_strpos(i8* %0, i8* %1) {
%3 = tail call i8* @my_strstr(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
int test_imm_D3int16_mem(short *val) {
  return ((*val) & (-0xD3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D3int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -211
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void checkCoders(void) {}


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

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

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

LLVM IR (-O2):
define void @checkCoders() {
ret void
}
const char *Float_Description(void) {
  return "64-bit double precision float point Object.";
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"64-bit double precision float point Object.\00"
define i8* @Float_Description() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [44 x i8] c"64-bit double precision float point Object.\00"
define i8* @Float_Description() {
ret i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
size_t shl_htable_rehash_ulong(const void *elem, void *priv) {
  return (size_t) * (const unsigned long *)elem;
}


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

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

LLVM IR (-O0):
define i64 @shl_htable_rehash_ulong(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @shl_htable_rehash_ulong(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ spin(char *);
void TestC() { spin("TestC"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"TestC\00"
define void @TestC() {
%1 = tail call i32 @spin(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int power(int a, int b) {
  if (a == 0)
    return 0;
  if (b == 0)
    return 1;
  if (b == 1)
    return a;
  return a * power(a, --b);
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1134 <power+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1181 <power+0x71>
cmpl   $0x0,-0xc(%rbp)
jne    114a <power+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1181 <power+0x71>
cmpl   $0x1,-0xc(%rbp)
jne    115f <power+0x4f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <power+0x71>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0xc(%rbp)
call   1030 <power@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %edi,%edi
je     1128 <power+0x28>
mov    $0x1,%eax
test   %esi,%esi
je     111f <power+0x1f>
nopl   (%rax)
cmp    $0x1,%esi
je     1124 <power+0x24>
add    $0xffffffff,%esi
imul   %edi,%eax
test   %esi,%esi
jne    1110 <power+0x10>
mov    $0x1,%edi
imul   %edi,%eax
ret
xor    %edi,%edi
mov    $0x1,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %7
%5 = phi i32 [ %8, %7 ], [ %1, %2 ]
%6 = phi i32 [ %9, %7 ], [ 1, %2 ]
switch i32 %5, label %7 [
i32 0, label %10
i32 1, label %11
]
7: ; preds = %4
%8 = add nsw i32 %5, -1
%9 = mul nsw i32 %6, %0
br label %4
10: ; preds = %4
br label %11
11: ; preds = %4, %10, %2
%12 = phi i32 [ 1, %2 ], [ %6, %10 ], [ %6, %4 ]
%13 = phi i32 [ 0, %2 ], [ 1, %10 ], [ %0, %4 ]
%14 = mul nsw i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ nondet_int();
int main() {
  int x = nondet_int();
  int *p = &x;
  while (x < 100) {
    (*p)++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <nondet_int@plt>
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    114b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1131 <main+0x21>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int example_function(const char *s) {
  printf("%s", s);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @example_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *my_name) {
  fprintf(stderr, "Usage: %s filename\n", my_name);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
define void @usage(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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Usage: %s filename\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void OBJ_dup(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_dup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ac_mainloop();
int /*<<< orphan*/ acdaemon_daemonize_default();
void ac_mainloop_daemonize() {
  acdaemon_daemonize_default();
  ac_mainloop();
}


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

x86 assembly (clang, -O2):
<ac_mainloop_daemonize>:
push   %rax
xor    %eax,%eax
call   1030 <acdaemon_daemonize_default@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ac_mainloop@plt>

LLVM IR (-O0):
define void @ac_mainloop_daemonize() {
%1 = call i32 (...) @acdaemon_daemonize_default()
%2 = call i32 (...) @ac_mainloop()
ret void
}

LLVM IR (-O2):
define void @ac_mainloop_daemonize() {
%1 = tail call i32 (...) @acdaemon_daemonize_default()
%2 = tail call i32 (...) @ac_mainloop()
ret void
}
/* Variables and functions */
void touch_size_t(size_t *x) {}


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

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

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

LLVM IR (-O2):
define void @touch_size_t(i64* nocapture %0) {
ret void
}
void led_on() { *((volatile unsigned long *)0x7f008824) = 0x0d; }


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
movq   $0xd,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
movq   $0xd,0x7f008824
ret

LLVM IR (-O0):
define void @led_on() {
store volatile i64 13, i64* inttoptr (i64 2130741284 to i64*)
ret void
}

LLVM IR (-O2):
define void @led_on() {
store volatile i64 13, i64* inttoptr (i64 2130741284 to i64*)
ret void
}
/* Variables and functions */
size_t strlen(const char *src) {
  size_t i = 0;
  while (*src++) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1139 <strlen+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
void button_transfer_onpress(void) {}


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

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

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

LLVM IR (-O2):
define void @button_transfer_onpress() {
ret void
}
double pdfBernoulli(double p, long x) { return ((x == 0) ? 1.0 - p : p); }


x86 assembly (clang, -O0):
<pdfBernoulli>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112f <pdfBernoulli+0x2f>
movsd  0xee0(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1139 <pdfBernoulli+0x39>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdfBernoulli>:
test   %rdi,%rdi
jne    1115 <pdfBernoulli+0x15>
movsd  0xef3(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pdfBernoulli(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load double, double* %3
%9 = fsub double 1.000000e+00, %8
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %7
%13 = phi double [ %9, %7 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @pdfBernoulli(double %0, i64 %1) {
%3 = icmp eq i64 %1, 0
%4 = fsub double 1.000000e+00, %0
%5 = select i1 %3, double %4, double %0
ret double %5
}
/* Variables and functions */
double pow(double, double);
__attribute__((const)) double linear(unsigned long c) {
  if (c <= 10)
    return (double)c / (255. * 12.92);
  return pow(((double)c + 14.025) / 269.025, 2.4);
}


x86 assembly (clang, -O0):
<linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
ja     1164 <linear+0x54>
movaps 0xef2(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xef1(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b5 <linear+0xa5>
movaps 0xeb5(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xeb4(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe7d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe55(%rip),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear>:
movq   %rdi,%xmm1
punpckldq 0xee3(%rip),%xmm1
subpd  0xeeb(%rip),%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
cmp    $0xa,%rdi
ja     1140 <linear+0x30>
divsd  0xef9(%rip),%xmm0
ret
addsd  0xed8(%rip),%xmm0
divsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @linear(i64 %0) {
%2 = alloca double
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ule i64 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i64, i64* %3
%8 = uitofp i64 %7 to double
%9 = fdiv double %8, 3.294600e+03
store double %9, double* %2
br label %16
10: ; preds = %1
%11 = load i64, i64* %3
%12 = uitofp i64 %11 to double
%13 = fadd double %12, 1.402500e+01
%14 = fdiv double %13, 2.690250e+02
%15 = call double @pow(double %14, double 2.400000e+00)
store double %15, double* %2
br label %16
16: ; preds = %10, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @linear(i64 %0) {
%2 = icmp ult i64 %0, 11
%3 = uitofp i64 %0 to double
br i1 %2, label %4, label %6
4: ; preds = %1
%5 = fdiv double %3, 3.294600e+03
br label %10
6: ; preds = %1
%7 = fadd double %3, 1.402500e+01
%8 = fdiv double %7, 2.690250e+02
%9 = tail call double @pow(double %8, double 2.400000e+00)
br label %10
10: ; preds = %6, %4
%11 = phi double [ %5, %4 ], [ %9, %6 ]
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int getc(FILE *fp) { return fgetc(fp); }


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

x86 assembly (clang, -O2):
<getc>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @getc(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 %2
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *indirectString(struct sqlConnection *, int, char *, char *);
char *genePixTreatment(struct sqlConnection *conn, int id) {
  return indirectString(conn, id, "treatment", "conditions");
}


x86 assembly (clang, -O0):
<genePixTreatment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
lea    0xed6(%rip),%rcx
call   1030 <indirectString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genePixTreatment>:
lea    0xee9(%rip),%rdx
lea    0xeec(%rip),%rcx
jmp    1030 <indirectString@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [10 x i8] c"treatment\00"
@.str.1 = [11 x i8] c"conditions\00"
define i8* @genePixTreatment(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @indirectString(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [10 x i8] c"treatment\00"
@.str.1 = [11 x i8] c"conditions\00"
define i8* @genePixTreatment(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @indirectString(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
void xdrmem_destroy(XDR *xdrs) {}


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

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

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

LLVM IR (-O2):
define void @xdrmem_destroy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRF6_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRF6_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRF6_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void xmlClose(void) { printf("</database>\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"</database>\0A\00"
define void @xmlClose() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"</database>\00"
define void @xmlClose() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }


x86 assembly (clang, -O0):
<devpts_new_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<devpts_new_index>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.inode = type { i32 }
@EINVAL = global i32 0
define i32 @devpts_new_index(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.inode = type { i32 }
@EINVAL = global i32 0
define i32 @devpts_new_index(%struct.inode* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int ccache_ispowerof2(int value) {
  return value > 0 ? ((value & (~value + 1)) == value ? 1 : 0) : 0;
}


x86 assembly (clang, -O0):
<ccache_ispowerof2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1136 <ccache_ispowerof2+0x36>
mov    -0x4(%rbp),%edx
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    $0x1,%eax
and    %eax,%edx
mov    -0x4(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <ccache_ispowerof2+0x40>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <ccache_ispowerof2+0x40>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccache_ispowerof2>:
test   %edi,%edi
jle    110f <ccache_ispowerof2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ccache_ispowerof2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = xor i32 %7, -1
%9 = add nsw i32 %8, 1
%10 = and i32 %6, %9
%11 = load i32, i32* %2
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %5
%17 = phi i32 [ %14, %5 ], [ 0, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @ccache_ispowerof2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ si475x_set_property(int, int);
void si475xFMRX_mute(unsigned char mute) {
  if (mute)
    si475x_set_property(0x0301, 3);
  else
    si475x_set_property(0x0301, 0);
}


x86 assembly (clang, -O0):
<si475xFMRX_mute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113c <si475xFMRX_mute+0x2c>
mov    $0x301,%edi
mov    $0x3,%esi
call   1030 <si475x_set_property@plt>
jmp    1148 <si475xFMRX_mute+0x38>
mov    $0x301,%edi
xor    %esi,%esi
call   1030 <si475x_set_property@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xFMRX_mute>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    (%rax,%rax,2),%esi
mov    $0x301,%edi
jmp    1030 <si475x_set_property@plt>

LLVM IR (-O0):
define void @si475xFMRX_mute(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @si475x_set_property(i32 769, i32 3)
br label %9
7: ; preds = %1
%8 = call i32 @si475x_set_property(i32 769, i32 0)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @si475xFMRX_mute(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = select i1 %2, i32 0, i32 3
%4 = tail call i32 @si475x_set_property(i32 769, i32 %3)
ret void
}
/* Variables and functions */
unsigned int max(unsigned int, unsigned int);
unsigned int vmaxu2(unsigned int a, unsigned int b) {
  unsigned int r, s;
  unsigned int t, u;
  r = a & 0x0000ffff;
  s = b & 0x0000ffff;
  t = max(r, s);
  r = a & 0xffff0000;
  s = b & 0xffff0000;
  u = max(r, s);
  r = t | u;
  return r;
}


x86 assembly (clang, -O0):
<vmaxu2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <max@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff0000,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <max@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmaxu2>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
movzwl %bp,%edi
movzwl %bx,%esi
call   1030 <max@plt>
mov    %eax,%r14d
and    $0xffff0000,%ebp
and    $0xffff0000,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <max@plt>
or     %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @vmaxu2(i32 %0, i32 %1) {
%3 = and i32 %0, 65535
%4 = and i32 %1, 65535
%5 = tail call i32 @max(i32 %3, i32 %4)
%6 = and i32 %0, -65536
%7 = and i32 %1, -65536
%8 = tail call i32 @max(i32 %6, i32 %7)
%9 = or i32 %8, %5
ret i32 %9
}
/* Type definitions */
struct stack_st_OPENSSL_BLOCK {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_reserve(int /*<<< orphan*/ *, int);
int sk_OPENSSL_BLOCK_reserve(struct stack_st_OPENSSL_BLOCK *sk, int n) {
  return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_BLOCK_reserve>:
jmp    1030 <OPENSSL_sk_reserve@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i32 @sk_OPENSSL_BLOCK_reserve(%struct.stack_st_OPENSSL_BLOCK* %0, i32 %1) {
%3 = alloca %struct.stack_st_OPENSSL_BLOCK*
%4 = alloca i32
store %struct.stack_st_OPENSSL_BLOCK* %0, %struct.stack_st_OPENSSL_BLOCK** %3
store i32 %1, i32* %4
%5 = load %struct.stack_st_OPENSSL_BLOCK*, %struct.stack_st_OPENSSL_BLOCK** %3
%6 = bitcast %struct.stack_st_OPENSSL_BLOCK* %5 to i32*
%7 = load i32, i32* %4
%8 = call i32 @OPENSSL_sk_reserve(i32* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i32 @sk_OPENSSL_BLOCK_reserve(%struct.stack_st_OPENSSL_BLOCK* %0, i32 %1) {
%3 = getelementptr %struct.stack_st_OPENSSL_BLOCK, %struct.stack_st_OPENSSL_BLOCK* %0, i64 0, i32 0
%4 = tail call i32 @OPENSSL_sk_reserve(i32* %3, i32 %1)
ret i32 %4
}
void do_something(void) { return; }


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

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

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

LLVM IR (-O2):
define void @do_something() {
ret void
}
unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = (*str++))) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void infoSetMaxWordLength(void) {
  printf("Sets the maximum word length (default = %d).%s", 20, "\n");
}


x86 assembly (clang, -O0):
<infoSetMaxWordLength>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
lea    0xf08(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<infoSetMaxWordLength>:
lea    0xee9(%rip),%rdi
lea    0xf11(%rip),%rdx
mov    $0x14,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Sets the maximum word length (default = %d).%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetMaxWordLength() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Sets the maximum word length (default = %d).%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @infoSetMaxWordLength() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_alarm;
unsigned int syscall_1(int /*<<< orphan*/, unsigned int);
unsigned int alarm(unsigned int seconds) {
  return syscall_1(SYS_alarm, seconds);
}


x86 assembly (clang, -O0):
<alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall_1@plt>

LLVM IR (-O0):
@SYS_alarm = global i32 0
define i32 @alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_alarm
%4 = load i32, i32* %2
%5 = call i32 @syscall_1(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_alarm = global i32 0
define i32 @alarm(i32 %0) {
%2 = load i32, i32* @SYS_alarm
%3 = tail call i32 @syscall_1(i32 %2, i32 %0)
ret i32 %3
}
void g_DUMMY_menu_enable_item(int menu_id, int item_id, int enable) {
  menu_id = menu_id;
  item_id = item_id;
  enable = enable;
}


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

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

LLVM IR (-O0):
define void @g_DUMMY_menu_enable_item(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
store i32 %7, i32* %4
%8 = load i32, i32* %5
store i32 %8, i32* %5
%9 = load i32, i32* %6
store i32 %9, i32* %6
ret void
}

LLVM IR (-O2):
define void @g_DUMMY_menu_enable_item(i32 %0, i32 %1, i32 %2) {
ret void
}
int Mkfifo(const char *path, int mode) { return -1; }


x86 assembly (clang, -O0):
<Mkfifo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Mkfifo(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int msync(void *addr, size_t len, int flags) { return 0; }


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

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

LLVM IR (-O0):
define i32 @msync(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @msync(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 0
}
I0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    $0x16,%eax
cmp    (%rcx,%rdx,4),%eax
jg     113a <I0RX1+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <I0RX1+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0RX1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpl   $0x16,(%r9,%rcx,4)
setge  %al
ret

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

LLVM IR (-O2):
define i32 @I0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
void port_out(unsigned short port, unsigned char val) {
  __asm__ volatile("outb %0,%1\n" ::"a"(val), "d"(port));
}


x86 assembly (clang, -O0):
<port_out>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    -0x2(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_out>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @port_out(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @port_out(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $0,$1\0A", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i16 %0)
ret void
}
void s3c_i2c2_setname(char *name) {}


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

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

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

LLVM IR (-O2):
define void @s3c_i2c2_setname(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
scalar_t__ teststack();
void *thread_func() {
  if (teststack() != 0) {
    perror("unexpected error: "
           "pthread_attr_setstack"
           " "
           "4-1"
           ": "
           "stack wrong");
    exit(1);
  }
  pthread_exit(0);
  return NULL;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <teststack@plt>
cmp    $0x0,%rax
je     116b <thread_func+0x2b>
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rax
xor    %eax,%eax
call   1060 <teststack@plt>
test   %rax,%rax
jne    1158 <thread_func+0x18>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xea1(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"unexpected error: pthread_attr_setstack 4-1: stack wrong\00"
define i8* @thread_func() {
%1 = call i64 (...) @teststack()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = call i32 @pthread_exit(i32 0)
ret i8* null
}

LLVM IR (-O2):
@.str = [57 x i8] c"unexpected error: pthread_attr_setstack 4-1: stack wrong\00"
define noalias i8* @thread_func() {
%1 = tail call i64 (...) @teststack()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @pthread_exit(i32 0)
ret i8* null
}