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

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
int vsprintf(char *string, const char *fmt, va_list ap) {
  return vsnprintf(string, 0xffffffff, fmt, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0xffffffff,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0xffffffff,%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 -1, i8* %1, i32 %2)
ret i32 %4
}
int test15(int a, int b, int c, int d, int e, int f) {
  int x = a != b;
  int y = c == 0;
  int z = d == e;
  return x == y || x == z;
}


x86 assembly (clang, -O0):
<test15>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
je     1166 <test15+0x66>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
sete   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test15>:
cmp    %esi,%edi
setne  %al
test   %edx,%edx
setne  %dl
cmp    %r8d,%ecx
setne  %cl
xor    %al,%dl
xor    %al,%cl
or     %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test15(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
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = icmp ne i32 %16, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %13
%20 = load i32, i32* %9
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
store i32 %22, i32* %14
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
store i32 %26, i32* %15
%27 = load i32, i32* %13
%28 = load i32, i32* %14
%29 = icmp eq i32 %27, %28
br i1 %29, label %34, label %30
30: ; preds = %6
%31 = load i32, i32* %13
%32 = load i32, i32* %15
%33 = icmp eq i32 %31, %32
br label %34
34: ; preds = %30, %6
%35 = phi i1 [ true, %6 ], [ %33, %30 ]
%36 = zext i1 %35 to i32
ret i32 %36
}

LLVM IR (-O2):
define i32 @test15(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp ne i32 %0, %1
%8 = icmp ne i32 %2, 0
%9 = icmp ne i32 %3, %4
%10 = xor i1 %7, %8
%11 = xor i1 %7, %9
%12 = or i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ nl_item;

/* Variables and functions */
char *nl_langinfo_l(int /*<<< orphan*/, int /*<<< orphan*/);
char *nl_langinfo(nl_item item) { return nl_langinfo_l(item, 0); }


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

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

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

LLVM IR (-O2):
define i8* @nl_langinfo(i32 %0) {
%2 = tail call i8* @nl_langinfo_l(i32 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_version() {
  char *VERSION = "2.0";
  printf("LWFQZip %s\n", VERSION);
}


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

x86 assembly (clang, -O2):
<print_version>:
lea    0xeed(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"2.0\00"
@.str.1 = [12 x i8] c"LWFQZip %s\0A\00"
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
int seq_utils_clock_pqq_to_divisor(int ppq) {
  switch (ppq) {
  case 1:
    return (96 / 1);
  case 2:
    return (96 / 2);
  case 3:
    return (96 / 3);
  case 4:
    return (96 / 4);
  case 5:
    return (96 / 6);
  case 6:
    return (96 / 8);
  case 7:
    return (96 / 12);
  case 8:
    return (96 / 24);
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<seq_utils_clock_pqq_to_divisor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1190 <seq_utils_clock_pqq_to_divisor+0x90>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x60,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x30,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x20,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x18,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x10,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0xc,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x8,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x4,-0x4(%rbp)
jmp    1197 <seq_utils_clock_pqq_to_divisor+0x97>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_utils_clock_pqq_to_divisor>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1117 <seq_utils_clock_pqq_to_divisor+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @seq_utils_clock_pqq_to_divisor(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
i32 8, label %12
]
5: ; preds = %1
store i32 96, i32* %2
br label %14
6: ; preds = %1
store i32 48, i32* %2
br label %14
7: ; preds = %1
store i32 32, i32* %2
br label %14
8: ; preds = %1
store i32 24, i32* %2
br label %14
9: ; preds = %1
store i32 16, i32* %2
br label %14
10: ; preds = %1
store i32 12, i32* %2
br label %14
11: ; preds = %1
store i32 8, i32* %2
br label %14
12: ; preds = %1
store i32 4, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@switch.table.seq_utils_clock_pqq_to_divisor = [8 x i32] [i32 96, i32 48, i32 32, i32 24, i32 16, i32 12, i32 8, i32 4]
define i32 @seq_utils_clock_pqq_to_divisor(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.seq_utils_clock_pqq_to_divisor, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ar1010_main();
int /*<<< orphan*/ i2c1_init();
int /*<<< orphan*/ uart_init();
int notmain(unsigned int earlypc) {
  uart_init();
  i2c1_init();
  ar1010_main();
  while (1)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<notmain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <uart_init@plt>
mov    $0x0,%al
call   1050 <i2c1_init@plt>
mov    $0x0,%al
call   1040 <ar1010_main@plt>
jmp    1150 <notmain+0x20>

x86 assembly (clang, -O2):
<notmain>:
push   %rax
xor    %eax,%eax
call   1030 <uart_init@plt>
xor    %eax,%eax
call   1050 <i2c1_init@plt>
xor    %eax,%eax
call   1040 <ar1010_main@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <notmain+0x20>

LLVM IR (-O0):
define i32 @notmain(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @uart_init()
%4 = call i32 (...) @i2c1_init()
%5 = call i32 (...) @ar1010_main()
br label %6
6: ; preds = %1, %6
br label %6
}

LLVM IR (-O2):
define i32 @notmain(i32 %0) {
%2 = tail call i32 (...) @uart_init()
%3 = tail call i32 (...) @i2c1_init()
%4 = tail call i32 (...) @ar1010_main()
br label %5
5: ; preds = %1, %5
br label %5
}
/* Variables and functions */
int listen(int, int);
int ab_listen(int sockfd, int backlog) { return listen(sockfd, backlog); }


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

x86 assembly (clang, -O2):
<ab_listen>:
jmp    1030 <listen@plt>

LLVM IR (-O0):
define i32 @ab_listen(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 = call i32 @listen(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ab_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int arm32_read_p15_c1();
int /*<<< orphan*/ arm32_write_p15_c1(int);
void arm32_dcache_disable(void) {
  uint32_t value = arm32_read_p15_c1();
  arm32_write_p15_c1(value & ~(1 << 2));
}


x86 assembly (clang, -O0):
<arm32_dcache_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <arm32_read_p15_c1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
and    $0xfffffffb,%edi
call   1040 <arm32_write_p15_c1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm32_dcache_disable>:
push   %rax
xor    %eax,%eax
call   1030 <arm32_read_p15_c1@plt>
and    $0xfffffffb,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <arm32_write_p15_c1@plt>

LLVM IR (-O0):
define void @arm32_dcache_disable() {
%1 = alloca i32
%2 = call i32 (...) @arm32_read_p15_c1()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -5
%5 = call i32 @arm32_write_p15_c1(i32 %4)
ret void
}

LLVM IR (-O2):
define void @arm32_dcache_disable() {
%1 = tail call i32 (...) @arm32_read_p15_c1()
%2 = and i32 %1, -5
%3 = tail call i32 @arm32_write_p15_c1(i32 %2)
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IP_DROP_MEMBERSHIP;
int /*<<< orphan*/ assert(struct in_addr const *);
scalar_t__ close(int);
scalar_t__ set_multicast(int, struct in_addr const *, int /*<<< orphan*/);
void close_mcast_listener(int msockfd, const struct in_addr *mifaddr) {
  assert(mifaddr);
  if (msockfd <= 0)
    return;
  (void)set_multicast(msockfd, mifaddr, IP_DROP_MEMBERSHIP);
  (void)close(msockfd);
  ((void)0);
  return;
}


x86 assembly (clang, -O0):
<close_mcast_listener>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
cmpl   $0x0,-0x4(%rbp)
jg     1157 <close_mcast_listener+0x27>
jmp    1174 <close_mcast_listener+0x44>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
call   1050 <set_multicast@plt>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_mcast_listener>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rsi,%rdi
call   1040 <assert@plt>
test   %ebx,%ebx
jle    1166 <close_mcast_listener+0x36>
mov    0x2e94(%rip),%rax
mov    (%rax),%edx
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <set_multicast@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <close@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@IP_DROP_MEMBERSHIP = global i32 0
define void @close_mcast_listener(i32 %0, %struct.in_addr* %1) {
%3 = alloca i32
%4 = alloca %struct.in_addr*
store i32 %0, i32* %3
store %struct.in_addr* %1, %struct.in_addr** %4
%5 = load %struct.in_addr*, %struct.in_addr** %4
%6 = call i32 @assert(%struct.in_addr* %5)
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %17
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load %struct.in_addr*, %struct.in_addr** %4
%13 = load i32, i32* @IP_DROP_MEMBERSHIP
%14 = call i64 @set_multicast(i32 %11, %struct.in_addr* %12, i32 %13)
%15 = load i32, i32* %3
%16 = call i64 @close(i32 %15)
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@IP_DROP_MEMBERSHIP = global i32 0
define void @close_mcast_listener(i32 %0, %struct.in_addr* %1) {
%3 = tail call i32 @assert(%struct.in_addr* %1)
%4 = icmp slt i32 %0, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @IP_DROP_MEMBERSHIP
%7 = tail call i64 @set_multicast(i32 %0, %struct.in_addr* %1, i32 %6)
%8 = tail call i64 @close(i32 %0)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUGF(int /*<<< orphan*/, char *);
int s_socket_pipe_listen(int s, int backlog) {
  DEBUGF(0, "enter");
  DEBUGF(0, "leave");
  return 0;
}


x86 assembly (clang, -O0):
<s_socket_pipe_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
lea    0xed9(%rip),%rsi
call   1030 <DEBUGF@plt>
xor    %edi,%edi
lea    0xed1(%rip),%rsi
call   1030 <DEBUGF@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_socket_pipe_listen>:
push   %rax
lea    0xee8(%rip),%rsi
xor    %edi,%edi
call   1030 <DEBUGF@plt>
lea    0xee0(%rip),%rsi
xor    %edi,%edi
call   1030 <DEBUGF@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"enter\00"
@.str.1 = [6 x i8] c"leave\00"
define i32 @s_socket_pipe_listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @DEBUGF(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @DEBUGF(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"enter\00"
@.str.1 = [6 x i8] c"leave\00"
define i32 @s_socket_pipe_listen(i32 %0, i32 %1) {
%3 = tail call i32 @DEBUGF(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @DEBUGF(i32 0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int errno;
int listen(int, int);
int __sulong_posix_listen(int socket, int backlog) {
  {
    int native_errno = errno;
    int result = listen(socket, backlog);
    if (result == (int)-1) {
      result = (int)(long)-errno;
    }
    errno = native_errno;
    return result;
  };
}


x86 assembly (clang, -O0):
<__sulong_posix_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1152 <__sulong_posix_listen+0x42>
xor    %eax,%eax
mov    0x2e95(%rip),%rcx
sub    (%rcx),%eax
cltq
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e84(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__sulong_posix_listen>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <listen@plt>
xor    %ecx,%ecx
sub    (%rbx),%ecx
cmp    $0xffffffff,%eax
cmove  %ecx,%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @__sulong_posix_listen(i32 %0, i32 %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @listen(i32 %0, i32 %1)
%5 = icmp eq i32 %4, -1
%6 = load i32, i32* @errno
%7 = sub nsw i32 0, %6
%8 = select i1 %5, i32 %7, i32 %4
store i32 %3, i32* @errno
ret i32 %8
}
void stress_parent_died_alarm(void) {}


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

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

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

LLVM IR (-O2):
define void @stress_parent_died_alarm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("sizeof short int %d\n", sizeof(short int));
  printf("sizeof float %d\n", sizeof(float));
  printf("sizeof double %d\n", sizeof(double));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"sizeof short int %d\0A\00"
@.str.1 = [17 x i8] c"sizeof float %d\0A\00"
@.str.2 = [18 x i8] c"sizeof double %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"sizeof short int %d\0A\00"
@.str.1 = [17 x i8] c"sizeof float %d\0A\00"
@.str.2 = [18 x i8] c"sizeof double %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
void lruCacheInit(int capacity) {}


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

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

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

LLVM IR (-O2):
define void @lruCacheInit(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sequence_unload_signal(void *signal) { free(signal); }


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

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

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

LLVM IR (-O2):
define void @sequence_unload_signal(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_read;
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void *, size_t);
ssize_t read(int fd, void *buf, size_t size) {
  memset(buf, 0, size);
  return syscall(SYS_read, fd, buf, size);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <syscall@plt>

LLVM IR (-O0):
@SYS_read = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = call i32 @memset(i8* %7, i32 0, i64 %8)
%10 = load i32, i32* @SYS_read
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @syscall(i32 %10, i32 %11, i8* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
@SYS_read = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @memset(i8* %1, i32 0, i64 %2)
%5 = load i32, i32* @SYS_read
%6 = tail call i32 @syscall(i32 %5, i32 %0, i8* %1, i64 %2)
ret i32 %6
}
/* Variables and functions */
scalar_t__ getpid();
unsigned long __mp_processid(void) { return (unsigned long)getpid(); }


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

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

LLVM IR (-O0):
define i64 @__mp_processid() {
%1 = call i64 (...) @getpid()
ret i64 %1
}

LLVM IR (-O2):
define i64 @__mp_processid() {
%1 = tail call i64 (...) @getpid()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc7(void) {
  printf("Executing exitfunc7.\n");
  exit(0);
}


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

x86 assembly (clang, -O2):
<exitfunc7>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc7.\00"
define void @exitfunc7() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void ff_hevc_put_hevc_bi_qpel_h32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_qpel_h32_8_sse4() {
ret void
}
/* Type definitions */
struct country_st {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ display_country_info(struct country_st *, char *);
void display_country_added(struct country_st *country) {
  display_country_info(country, "added");
}


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

x86 assembly (clang, -O2):
<display_country_added>:
lea    0xee9(%rip),%rsi
jmp    1030 <display_country_info@plt>

LLVM IR (-O0):
%struct.country_st = type { i32 }
@.str = [6 x i8] c"added\00"
define void @display_country_added(%struct.country_st* %0) {
%2 = alloca %struct.country_st*
store %struct.country_st* %0, %struct.country_st** %2
%3 = load %struct.country_st*, %struct.country_st** %2
%4 = call i32 @display_country_info(%struct.country_st* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.country_st = type { i32 }
@.str = [6 x i8] c"added\00"
define void @display_country_added(%struct.country_st* %0) {
%2 = tail call i32 @display_country_info(%struct.country_st* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int innerlib();
int main() { return innerlib(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @innerlib()
ret i32 %2
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @innerlib()
ret i32 %1
}
/* Type definitions */
struct metric_struct {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ _propagate_statistics(struct metric_struct *,
                                         int /*<<< orphan*/, int /*<<< orphan*/,
                                         int);
void propagate_statistics(struct metric_struct *m, int64_t tolcomp,
                          int64_t min_stats) {
  _propagate_statistics(m, tolcomp, min_stats, -1);
  _propagate_statistics(m, tolcomp, min_stats, 1);
}


x86 assembly (clang, -O0):
<propagate_statistics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%ecx
call   1030 <_propagate_statistics@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%ecx
call   1030 <_propagate_statistics@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<propagate_statistics>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0xffffffff,%ecx
call   1030 <_propagate_statistics@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    $0x1,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_propagate_statistics@plt>

LLVM IR (-O0):
%struct.metric_struct = type { i32 }
define void @propagate_statistics(%struct.metric_struct* %0, i32 %1, i32 %2) {
%4 = alloca %struct.metric_struct*
%5 = alloca i32
%6 = alloca i32
store %struct.metric_struct* %0, %struct.metric_struct** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.metric_struct*, %struct.metric_struct** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_propagate_statistics(%struct.metric_struct* %7, i32 %8, i32 %9, i32 -1)
%11 = load %struct.metric_struct*, %struct.metric_struct** %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = call i32 @_propagate_statistics(%struct.metric_struct* %11, i32 %12, i32 %13, i32 1)
ret void
}

LLVM IR (-O2):
%struct.metric_struct = type { i32 }
define void @propagate_statistics(%struct.metric_struct* %0, i32 %1, i32 %2) {
%4 = tail call i32 @_propagate_statistics(%struct.metric_struct* %0, i32 %1, i32 %2, i32 -1)
%5 = tail call i32 @_propagate_statistics(%struct.metric_struct* %0, i32 %1, i32 %2, i32 1)
ret void
}
void reverse(int *array) {
  int idx;
  for (idx = 0; idx < 5 / 2; idx++) {
    int temp = array[idx];
    array[idx] = array[5 - 1 - idx];
    array[5 - 1 - idx] = temp;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1167 <reverse+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
sub    -0xc(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <reverse+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
mov    (%rdi),%rax
mov    0xc(%rdi),%rcx
rol    $0x20,%rax
rol    $0x20,%rcx
mov    %rcx,(%rdi)
mov    %rax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @reverse(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
store i32 %4, i32* %0
store i32 %2, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
store i32 %8, i32* %5
store i32 %6, i32* %7
ret void
}
int test_imm_32int32_reg(int val) { return ((val) & (0x32 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_32int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x32,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_32int32_reg(i32 %0) {
%2 = and i32 %0, 50
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char and (char one, char two) { return (one == '1' && two == '1') ? '1' : '0'; }


x86 assembly (clang, -O0):
<and>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x31,%ecx
mov    %al,-0x3(%rbp)
jne    112f <and+0x2f>
movsbl -0x2(%rbp),%eax
cmp    $0x31,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%dl
mov    $0x30,%eax
mov    $0x31,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<and>:
xor    $0x31,%dil
xor    $0x31,%sil
or     %dil,%sil
sete   %al
or     $0x30,%al
ret

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

LLVM IR (-O2):
define signext i8 @and(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 49
%4 = icmp eq i8 %1, 49
%5 = and i1 %3, %4
%6 = select i1 %5, i8 49, i8 48
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ SonarAltitudeHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void SonarAltitudeUpdated() { UAVObjUpdated(SonarAltitudeHandle()); }


x86 assembly (clang, -O0):
<SonarAltitudeUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SonarAltitudeHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SonarAltitudeUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <SonarAltitudeHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @SonarAltitudeUpdated() {
%1 = call i32 (...) @SonarAltitudeHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SonarAltitudeUpdated() {
%1 = tail call i32 (...) @SonarAltitudeHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
unsigned char cl255(float f) {
  if (f < 0)
    return 0;
  if (f > 255)
    return 255;
  return (unsigned char)f;
}


x86 assembly (clang, -O0):
<cl255>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    111f <cl255+0x1f>
movb   $0x0,-0x1(%rbp)
jmp    1146 <cl255+0x46>
movss  -0x8(%rbp),%xmm0
movss  0xed4(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    113e <cl255+0x3e>
movb   $0xff,-0x1(%rbp)
jmp    1146 <cl255+0x46>
cvttss2si -0x8(%rbp),%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl255>:
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    110b <cl255+0xb>
xor    %eax,%eax
ret
mov    $0xff,%al
ucomiss 0xeec(%rip),%xmm0
ja     111a <cl255+0x1a>
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define zeroext i8 @cl255(float %0) {
%2 = alloca i8
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 0, i8* %2
br label %14
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp ogt float %8, 2.550000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 -1, i8* %2
br label %14
11: ; preds = %7
%12 = load float, float* %3
%13 = fptoui float %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @cl255(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp ogt float %0, 2.550000e+02
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fptoui float %0 to i8
br label %7
7: ; preds = %3, %1, %5
%8 = phi i8 [ %6, %5 ], [ 0, %1 ], [ -1, %3 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ changeVars(int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 2;
  int y = 5;
  printf("Before changeVars(): x:%d y:%d\n", x, y);
  changeVars(&x, y);
  printf("After changeVars(): x:%d y:%d\n", x, y);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0xed0(%rip),%rdi
mov    $0x2,%esi
mov    $0x5,%edx
call   1040 <printf@plt>
lea    0x4(%rsp),%rdi
mov    $0x5,%esi
call   1030 <changeVars@plt>
mov    0x4(%rsp),%esi
lea    0xec7(%rip),%rdi
mov    $0x5,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"Before changeVars(): x:%d y:%d\0A\00"
@.str.1 = [31 x i8] c"After changeVars(): x:%d y:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 2, i32 5)
%4 = call i32 @changeVars(i32* %1, i32 5)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printFigure();
int main() {
  printFigure();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @printFigure()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printFigure()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void assertTrue(int predicate, char *message) {
  printf("%s: ", message);
  if (predicate)
    printf("PASSED\n");
  else
    printf("FAILED\n");
}


x86 assembly (clang, -O0):
<assertTrue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     114e <assertTrue+0x3e>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115c <assertTrue+0x4c>
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertTrue>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
lea    0xecb(%rip),%rax
lea    0xecb(%rip),%rdi
cmove  %rax,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@.str.1 = [8 x i8] c"PASSED\0A\00"
@.str.2 = [8 x i8] c"FAILED\0A\00"
define void @assertTrue(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@str = [7 x i8] c"FAILED\00"
@str.3 = [7 x i8] c"PASSED\00"
define void @assertTrue(i32 %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0)
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
ret void
}
void burnstack(int len) { (void)len; }


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

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

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

LLVM IR (-O2):
define void @burnstack(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printer_set_positioning_relative();
int G91_f(char *s) {
  printer_set_positioning_relative();
  return 1;
}


x86 assembly (clang, -O0):
<G91_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <printer_set_positioning_relative@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G91_f>:
push   %rax
xor    %eax,%eax
call   1030 <printer_set_positioning_relative@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @G91_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @printer_set_positioning_relative()
ret i32 1
}

LLVM IR (-O2):
define i32 @G91_f(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @printer_set_positioning_relative()
ret i32 1
}
/* Variables and functions */
int add_list(char const *, char);
char *getenv(char *);
int add_from_env(char *env_var, char sep) {
  const char *p = getenv(env_var);
  if (!p) {
    return 0;
  }
  return add_list(p, sep);
}


x86 assembly (clang, -O0):
<add_from_env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1156 <add_from_env+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1166 <add_from_env+0x46>
mov    -0x20(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1040 <add_list@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_from_env>:
push   %rbx
mov    %esi,%ebx
call   1030 <getenv@plt>
test   %rax,%rax
je     1139 <add_from_env+0x19>
movsbl %bl,%esi
mov    %rax,%rdi
pop    %rbx
jmp    1040 <add_list@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @add_from_env(i8* %0, i8 signext %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 = call i8* @getenv(i8* %7)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 0, i32* %3
br label %16
12: ; preds = %2
%13 = load i8*, i8** %6
%14 = load i8, i8* %5
%15 = call i32 @add_list(i8* %13, i8 signext %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @add_from_env(i8* nocapture %0, i8 signext %1) {
%3 = tail call i8* @getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @add_list(i8* %3, i8 signext %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
int bar1(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @bar1(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct delta_index {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct delta_index *);
void free_delta_index(struct delta_index *index) { free(index); }


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

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

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

LLVM IR (-O2):
%struct.delta_index = type { i32 }
define void @free_delta_index(%struct.delta_index* nocapture %0) {
%2 = tail call i32 @free(%struct.delta_index* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_default_sink() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_default_sink"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [44 x i8] c"NOT IMPLEMENTED:pa_context_set_default_sink\00"
define i32 @pa_context_set_default_sink() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
double metresToKm(double metres) { return metres / 1000.0; }


x86 assembly (clang, -O0):
<metresToKm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<metresToKm>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @metresToKm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+03
ret double %4
}

LLVM IR (-O2):
define double @metresToKm(double %0) {
%2 = fdiv double %0, 1.000000e+03
ret double %2
}