xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void *ensure_memory(void *alloc) {
  if (!alloc)
    fatal("out of memory\n");
  return alloc;
}


x86 assembly (clang, -O0):
<ensure_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <ensure_memory+0x23>
lea    0xed2(%rip),%rdi
call   1030 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_memory>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1125 <ensure_memory+0x15>
lea    0xee0(%rip),%rdi
call   1030 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @ensure_memory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @ensure_memory(i8* readnone returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @fatal(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void write_nl() { printf("\n"); }


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

x86 assembly (clang, -O2):
<write_nl>:
mov    $0xa,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @write_nl() {
%1 = tail call i32 @putchar(i32 10)
ret void
}
void foo_1_2_1_2_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_2_1_1_1_1_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ event_handle_instruction(char *);
int /*<<< orphan*/ event_x_reserved(char);
char *lookup_abbreviation(char);
void event_reserved(char s) {
  char *expansion;
  expansion = lookup_abbreviation(s);
  if (expansion != NULL) {
    event_handle_instruction(expansion);
  } else {
    event_x_reserved(s);
  };
}


x86 assembly (clang, -O0):
<event_reserved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1050 <lookup_abbreviation@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <event_reserved+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <event_handle_instruction@plt>
jmp    116d <event_reserved+0x3d>
movsbl -0x1(%rbp),%edi
call   1040 <event_x_reserved@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_reserved>:
push   %rbx
mov    %edi,%ebx
call   1050 <lookup_abbreviation@plt>
test   %rax,%rax
je     1146 <event_reserved+0x16>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <event_handle_instruction@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1040 <event_x_reserved@plt>

LLVM IR (-O0):
define void @event_reserved(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i8* @lookup_abbreviation(i8 signext %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @event_handle_instruction(i8* %9)
br label %14
11: ; preds = %1
%12 = load i8, i8* %2
%13 = call i32 @event_x_reserved(i8 signext %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
define void @event_reserved(i8 signext %0) {
%2 = tail call i8* @lookup_abbreviation(i8 signext %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @event_handle_instruction(i8* %2)
br label %8
6: ; preds = %1
%7 = tail call i32 @event_x_reserved(i8 signext %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl(char const *s) {
  int len;
  len = 0;
  if (!s)
    return;
  while (s[len])
    len++;
  write(1, s, len);
  write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <ft_putendl+0x23>
jmp    117c <ft_putendl+0x6c>
jmp    1138 <ft_putendl+0x28>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1158 <ft_putendl+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <ft_putendl+0x28>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    $0x1,%edx
lea    0xe8b(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl>:
test   %rdi,%rdi
je     114e <ft_putendl+0x3e>
push   %rax
mov    %rdi,%rsi
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putendl+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xec2(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @ft_putendl(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @write(i32 1, i8* %0, i32 %10)
%12 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %13
13: ; preds = %1, %9
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCSIFADDR;
int wapi_set_addr(int, char const *, int /*<<< orphan*/,
                  struct in_addr const *);
int wapi_set_ip(int sock, const char *ifname, const struct in_addr *addr) {
  return wapi_set_addr(sock, ifname, SIOCSIFADDR, addr);
}


x86 assembly (clang, -O0):
<wapi_set_ip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
call   1030 <wapi_set_addr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wapi_set_ip>:
mov    %rdx,%rcx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
jmp    1030 <wapi_set_addr@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@SIOCSIFADDR = global i32 0
define i32 @wapi_set_ip(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.in_addr*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.in_addr* %2, %struct.in_addr** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* @SIOCSIFADDR
%10 = load %struct.in_addr*, %struct.in_addr** %6
%11 = call i32 @wapi_set_addr(i32 %7, i8* %8, i32 %9, %struct.in_addr* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@SIOCSIFADDR = global i32 0
define i32 @wapi_set_ip(i32 %0, i8* %1, %struct.in_addr* %2) {
%4 = load i32, i32* @SIOCSIFADDR
%5 = tail call i32 @wapi_set_addr(i32 %0, i8* %1, i32 %4, %struct.in_addr* %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ e_inc();
int /*<<< orphan*/ e_writeback();
int /*<<< orphan*/ e_zp();
void e_inc_zp() {
  e_zp();
  e_inc();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_inc_zp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <e_zp@plt>
mov    $0x0,%al
call   1050 <e_inc@plt>
mov    $0x0,%al
call   1030 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_inc_zp>:
push   %rax
xor    %eax,%eax
call   1040 <e_zp@plt>
xor    %eax,%eax
call   1050 <e_inc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_writeback@plt>

LLVM IR (-O0):
define void @e_inc_zp() {
%1 = call i32 (...) @e_zp()
%2 = call i32 (...) @e_inc()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_inc_zp() {
%1 = tail call i32 (...) @e_zp()
%2 = tail call i32 (...) @e_inc()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int ProcessCommand(char *, char *);
int OnkyoReadStatus(char ret[]) {
  int err = ProcessCommand(ret, "status\n");
  return (err);
}


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"status\0A\00"
define i32 @OnkyoReadStatus(i8* %0) {
%2 = tail call i32 @ProcessCommand(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
int dgtpicom_configure() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dgtpicom_configure() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_data_ack_event(int /*<<< orphan*/);
int /*<<< orphan*/ fd_nrf8001_error();
void fd_nrf8001_decode_data_ack_event(uint8_t *buffer, uint32_t length) {
  if (length != 2) {
    fd_nrf8001_error();
    return;
  }
  uint8_t service_pipe_number = buffer[1];
  fd_nrf8001_data_ack_event(service_pipe_number);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
je     1145 <fd_nrf8001_decode_data_ack_event+0x25>
mov    $0x0,%al
call   1030 <fd_nrf8001_error@plt>
jmp    1157 <fd_nrf8001_decode_data_ack_event+0x37>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <fd_nrf8001_data_ack_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x2,%esi
jne    112d <fd_nrf8001_decode_data_ack_event+0xd>
mov    0x4(%rdi),%edi
jmp    1040 <fd_nrf8001_data_ack_event@plt>
xor    %eax,%eax
jmp    1030 <fd_nrf8001_error@plt>

LLVM IR (-O0):
define void @fd_nrf8001_decode_data_ack_event(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @fd_nrf8001_error()
br label %16
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = call i32 @fd_nrf8001_data_ack_event(i32 %14)
br label %16
16: ; preds = %10, %8
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_decode_data_ack_event(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @fd_nrf8001_error()
br label %10
6: ; preds = %2
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @fd_nrf8001_data_ack_event(i32 %8)
br label %10
10: ; preds = %6, %4
ret void
}
/* Variables and functions */
int strlen(char const *);
int endswith(const char *line, char c) {
  int len = strlen(line);
  return (len && line[len - 1] == c);
}


x86 assembly (clang, -O0):
<endswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     115a <endswith+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<endswith>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
je     1130 <endswith+0x20>
movslq %eax,%rcx
xor    %eax,%eax
cmp    %bpl,-0x1(%rcx,%rbx,1)
sete   %al
jmp    1132 <endswith+0x22>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @endswith(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %17, %19
br label %21
21: ; preds = %10, %2
%22 = phi i1 [ false, %2 ], [ %20, %10 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @endswith(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = add nsw i32 %3, -1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %1
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %2
%13 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ getRandArray();
void launchGambling() { getRandArray(); }


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

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

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

LLVM IR (-O2):
define void @launchGambling() {
%1 = tail call i32 (...) @getRandArray()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  FILE *file = fopen("/foo.bar", "r");
  char buffer[1024];
  fscanf(file, "%s", buffer);
  printf("'%s'\n", buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xe97(%rip),%rsi
call   1040 <fscanf@plt>
lea    -0x420(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xec1(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <fopen@plt>
lea    0xeb7(%rip),%rsi
mov    %rsp,%rbx
mov    %rax,%rdi
mov    %rbx,%rdx
call   1040 <fscanf@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/foo.bar\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"'%s'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [1024 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %6
%9 = load i32*, i32** %6
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%11 = call i32 @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/foo.bar\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"'%s'\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
ret i32 0
}
void RTNetIPv6PseudoChecksumBits(void) {}


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

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

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

LLVM IR (-O2):
define void @RTNetIPv6PseudoChecksumBits() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int g(int *f1) {
  f(2);
  return *f1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2,%edi
call   1030 <f@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <f@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @g(i32* nocapture %0) {
%2 = tail call i32 @f(i32 2)
%3 = load i32, i32* %0
ret i32 %3
}
int sizeDeclarations(int type) {
  switch (type) {
  case 1:
    return 4;
    break;
  case 2:
    return 8;
    break;
  case 5:
    return 1;
    break;
  case 3:
    return 1;
    break;
  case 4:
    return 1;
    break;
  }
}


x86 assembly (clang, -O0):
<sizeDeclarations>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     1167 <sizeDeclarations+0x67>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x4(%rbp)
jmp    1167 <sizeDeclarations+0x67>
movl   $0x8,-0x4(%rbp)
jmp    1167 <sizeDeclarations+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <sizeDeclarations+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <sizeDeclarations+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeDeclarations>:
add    $0xfffffffe,%edi
mov    $0x4,%eax
cmp    $0x3,%edi
ja     111a <sizeDeclarations+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @sizeDeclarations(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 5, label %7
i32 3, label %8
i32 4, label %9
]
5: ; preds = %1
store i32 4, i32* %2
br label %10
6: ; preds = %1
store i32 8, i32* %2
br label %10
7: ; preds = %1
store i32 1, i32* %2
br label %10
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 1, i32* %2
br label %10
10: ; preds = %5, %6, %7, %8, %9, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@switch.table.sizeDeclarations = [4 x i32] [i32 8, i32 1, i32 1, i32 1]
define i32 @sizeDeclarations(i32 %0) {
%2 = add i32 %0, -2
%3 = icmp ult i32 %2, 4
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.sizeDeclarations, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 4, %1 ], [ %7, %4 ]
ret i32 %9
}
void vga_switcheroo_unregister_client(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @vga_switcheroo_unregister_client(%struct.pci_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __clear_bit(unsigned long, unsigned long *);
void __clear_bit_string(unsigned long *bitmap, unsigned long i, int len) {
  unsigned long end = i + len;
  while (i < end) {
    __clear_bit(i, bitmap);
    i++;
  }
}


x86 assembly (clang, -O0):
<__clear_bit_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115e <__clear_bit_string+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <__clear_bit@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1132 <__clear_bit_string+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__clear_bit_string>:
push   %r15
push   %r14
push   %rbx
movslq %edx,%r15
lea    (%r15,%rsi,1),%rax
cmp    %rsi,%rax
jbe    1145 <__clear_bit_string+0x35>
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__clear_bit@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <__clear_bit_string+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @__clear_bit_string(i64* %0, i64 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = add i64 %4, %1
%6 = icmp ugt i64 %5, %1
br i1 %6, label %7, label %12
7: ; preds = %3, %7
%8 = phi i64 [ %10, %7 ], [ %1, %3 ]
%9 = tail call i32 @__clear_bit(i64 %8, i64* %0)
%10 = add i64 %8, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %7
12: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ *rdd08sdp_get_b(int /*<<< orphan*/ const *, int);
int rdd08sdp_get_length(int /*<<< orphan*/ const *);
bool rdd08sdp_validate(const uint16_t *p_rdd08) {
  uint8_t i_length = rdd08sdp_get_length(p_rdd08);
  const uint16_t *b = rdd08sdp_get_b(p_rdd08, 5);
  return b <= p_rdd08 + i_length - 4;
}


x86 assembly (clang, -O0):
<rdd08sdp_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <rdd08sdp_get_length@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
call   1030 <rdd08sdp_get_b@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
add    $0xfffffffffffffff0,%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdd08sdp_validate>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <rdd08sdp_get_length@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <rdd08sdp_get_b@plt>
movslq %ebp,%rcx
lea    (%rbx,%rcx,4),%rdx
add    $0xfffffffffffffff0,%rdx
xor    %ecx,%ecx
cmp    %rdx,%rax
setbe  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rdd08sdp_validate(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @rdd08sdp_get_length(i32* %5)
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i32* @rdd08sdp_get_b(i32* %7, i32 5)
store i32* %8, i32** %4
%9 = load i32*, i32** %4
%10 = load i32*, i32** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %10, i64 %12
%14 = getelementptr inbounds i32, i32* %13, i64 -4
%15 = icmp ule i32* %9, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @rdd08sdp_validate(i32* %0) {
%2 = tail call i32 @rdd08sdp_get_length(i32* %0)
%3 = tail call i32* @rdd08sdp_get_b(i32* %0, i32 5)
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 -4
%7 = icmp ule i32* %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ sljit_free_exec(void *);
void sljit_free_code(void *code) { sljit_free_exec(code); }


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

x86 assembly (clang, -O2):
<sljit_free_code>:
jmp    1030 <sljit_free_exec@plt>

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

LLVM IR (-O2):
define void @sljit_free_code(i8* %0) {
%2 = tail call i32 @sljit_free_exec(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void g_world(void) { printf("Goodbye World\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Goodbye World\0A\00"
define void @g_world() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"Goodbye World\00"
define void @g_world() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct _stor_fdelete_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _stor_fdelete_req *);
void stor_fdelete_req_free(struct _stor_fdelete_req *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
%struct._stor_fdelete_req = type { i32 }
define void @stor_fdelete_req_free(%struct._stor_fdelete_req* nocapture %0) {
%2 = tail call i32 @free(%struct._stor_fdelete_req* %0)
ret void
}
int main() {
  int coin;
  coin = 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ global_search(char const *, char const *);
void search_in_wc(const char *what) { global_search(what, what); }


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

x86 assembly (clang, -O2):
<search_in_wc>:
mov    %rdi,%rsi
jmp    1030 <global_search@plt>

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

LLVM IR (-O2):
define void @search_in_wc(i8* %0) {
%2 = tail call i32 @global_search(i8* %0, i8* %0)
ret void
}
int capture_presence(const char *carg, void *pvar) {
  int *pi = pvar;
  *pi = 1;
  return 0;
}


x86 assembly (clang, -O0):
<capture_presence>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_presence>:
movl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @capture_presence(i8* nocapture readnone %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
store i32 1, i32* %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fill_array(char *, int);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *result = malloc(100);
  if (result) {
    fill_array(result, 100);
    printf("%s\n", result);
    free(result);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118f <main+0x4f>
mov    -0x10(%rbp),%rdi
mov    $0x64,%esi
call   1060 <fill_array@plt>
mov    -0x10(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     1177 <main+0x37>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x64,%esi
call   1060 <fill_array@plt>
lea    0xe99(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%2 = icmp eq i8* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @fill_array(i8* %1, i32 100)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @free(i8* %1)
br label %7
7: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int keyboard_getStatus();
void keyboard_inputWait() {
  while (keyboard_getStatus() & 0x02)
    ;
}


x86 assembly (clang, -O0):
<keyboard_inputWait>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <keyboard_inputWait+0x9>
mov    $0x0,%al
call   1030 <keyboard_getStatus@plt>
and    $0x2,%eax
cmp    $0x0,%eax
je     1131 <keyboard_inputWait+0x21>
jmp    1119 <keyboard_inputWait+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_inputWait>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <keyboard_getStatus@plt>
test   $0x2,%al
jne    1120 <keyboard_inputWait+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @keyboard_inputWait() {
br label %1
1: ; preds = %5, %0
%2 = call i32 (...) @keyboard_getStatus()
%3 = and i32 %2, 2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @keyboard_inputWait() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @keyboard_getStatus()
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _color_set_24(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
void vt_color_bg_set_24(uint8_t color_red, uint8_t color_green,
                        uint8_t color_blue) {
  _color_set_24(48, color_red, color_green, color_blue);
}


x86 assembly (clang, -O0):
<vt_color_bg_set_24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x30,%edi
call   1030 <_color_set_24@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_color_bg_set_24>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x30,%edi
jmp    1030 <_color_set_24@plt>

LLVM IR (-O0):
define void @vt_color_bg_set_24(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @_color_set_24(i32 48, i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @vt_color_bg_set_24(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_color_set_24(i32 48, i32 %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int M_PI;
float cos(float);
float ANTweenTimingFunctionSineIn(float time, float begin, float change,
                                  float duration) {
  return -change * cos(time / duration * (M_PI / 2)) + change + begin;
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionSineIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
mov    0x2e94(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm2
movss  -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionSineIn>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm0
call   1030 <cos@plt>
movss  (%rsp),%xmm1
mulss  %xmm1,%xmm0
subss  %xmm0,%xmm1
addss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @ANTweenTimingFunctionSineIn(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = load float, float* %5
%12 = load float, float* %8
%13 = fdiv float %11, %12
%14 = load i32, i32* @M_PI
%15 = sdiv i32 %14, 2
%16 = sitofp i32 %15 to float
%17 = fmul float %13, %16
%18 = call float @cos(float %17)
%19 = load float, float* %7
%20 = call float @llvm.fmuladd.f32(float %10, float %18, float %19)
%21 = load float, float* %6
%22 = fadd float %20, %21
ret float %22
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @ANTweenTimingFunctionSineIn(float %0, float %1, float %2, float %3) {
%5 = fneg float %2
%6 = fdiv float %0, %3
%7 = load i32, i32* @M_PI
%8 = sdiv i32 %7, 2
%9 = sitofp i32 %8 to float
%10 = fmul float %6, %9
%11 = tail call float @cos(float %10)
%12 = tail call float @llvm.fmuladd.f32(float %5, float %11, float %2)
%13 = fadd float %12, %1
ret float %13
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_port;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};
struct sockaddr {
  scalar_t__ sa_family;
};
typedef int /*<<< orphan*/ in_port_t;

/* Variables and functions */
scalar_t__ AF_INET;
in_port_t get_in_port(struct sockaddr *sa) {
  if (sa->sa_family == AF_INET) {
    return (((struct sockaddr_in *)sa)->sin_port);
  }
  return (((struct sockaddr_in6 *)sa)->sin6_port);
}


x86 assembly (clang, -O0):
<get_in_port>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x2ed2(%rip),%rcx
cmp    (%rcx),%rax
jne    112d <get_in_port+0x2d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <get_in_port+0x36>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sockaddr = type { i64 }
%struct.sockaddr_in = type { i32 }
%struct.sockaddr_in6 = type { i32 }
@AF_INET = global i64 0
define i32 @get_in_port(%struct.sockaddr* %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = load i64, i64* @AF_INET
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load %struct.sockaddr*, %struct.sockaddr** %3
%11 = bitcast %struct.sockaddr* %10 to %struct.sockaddr_in*
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %19
14: ; preds = %1
%15 = load %struct.sockaddr*, %struct.sockaddr** %3
%16 = bitcast %struct.sockaddr* %15 to %struct.sockaddr_in6*
%17 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %16, i32 0, i32 0
%18 = load i32, i32* %17
store i32 %18, i32* %2
br label %19
19: ; preds = %14, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.sockaddr = type { i64 }
@AF_INET = global i64 0
define i32 @get_in_port(%struct.sockaddr* nocapture %0) {
%2 = bitcast %struct.sockaddr* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ core3_print(char *, char *, char const *);
void U_EMRSETTEXTCOLOR_print(const char *contents) {
  core3_print("U_EMRSETTEXTCOLOR", "crColor:", contents);
}


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

x86 assembly (clang, -O2):
<U_EMRSETTEXTCOLOR_print>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef1(%rip),%rsi
jmp    1030 <core3_print@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"U_EMRSETTEXTCOLOR\00"
@.str.1 = [9 x i8] c"crColor:\00"
define void @U_EMRSETTEXTCOLOR_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @core3_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"U_EMRSETTEXTCOLOR\00"
@.str.1 = [9 x i8] c"crColor:\00"
define void @U_EMRSETTEXTCOLOR_print(i8* %0) {
%2 = tail call i32 @core3_print(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void dispatcherDefaultLock(struct Dispatcher *dispatcher, void *userData) {}


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

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

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

LLVM IR (-O2):
%struct.Dispatcher = type opaque
define void @dispatcherDefaultLock(%struct.Dispatcher* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_arm_dmb(int);
int /*<<< orphan*/ __builtin_arm_dsb(int);
int /*<<< orphan*/ __builtin_arm_isb(int);
void test_memory_barriers() {
  __builtin_arm_dmb(16);
  __builtin_arm_dsb(17);
  __builtin_arm_isb(18);
}


x86 assembly (clang, -O0):
<test_memory_barriers>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
call   1050 <__builtin_arm_dmb@plt>
mov    $0x11,%edi
call   1040 <__builtin_arm_dsb@plt>
mov    $0x12,%edi
call   1030 <__builtin_arm_isb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_memory_barriers>:
push   %rax
mov    $0x10,%edi
call   1050 <__builtin_arm_dmb@plt>
mov    $0x11,%edi
call   1040 <__builtin_arm_dsb@plt>
mov    $0x12,%edi
pop    %rax
jmp    1030 <__builtin_arm_isb@plt>

LLVM IR (-O0):
define void @test_memory_barriers() {
%1 = call i32 @__builtin_arm_dmb(i32 16)
%2 = call i32 @__builtin_arm_dsb(i32 17)
%3 = call i32 @__builtin_arm_isb(i32 18)
ret void
}

LLVM IR (-O2):
define void @test_memory_barriers() {
%1 = tail call i32 @__builtin_arm_dmb(i32 16)
%2 = tail call i32 @__builtin_arm_dsb(i32 17)
%3 = tail call i32 @__builtin_arm_isb(i32 18)
ret void
}
int wcsutil_all_ival(int nelem, int ival, const int iarr[]) {
  for (int i = 0; i < nelem; i++) {
    if (iarr[i] != ival)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<wcsutil_all_ival>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1154 <wcsutil_all_ival+0x54>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
je     1141 <wcsutil_all_ival+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115b <wcsutil_all_ival+0x5b>
jmp    1146 <wcsutil_all_ival+0x46>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <wcsutil_all_ival+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsutil_all_ival>:
test   %edi,%edi
jle    113a <wcsutil_all_ival+0x3a>
xor    %eax,%eax
cmp    %esi,(%rdx)
jne    1139 <wcsutil_all_ival+0x39>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
cmp    %rax,%rcx
je     1131 <wcsutil_all_ival+0x31>
lea    0x1(%rdi),%rax
cmp    %esi,(%rdx,%rdi,4)
je     1120 <wcsutil_all_ival+0x20>
xor    %eax,%eax
cmp    %rcx,%rdi
setae  %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @wcsutil_all_ival(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %21
5: ; preds = %3
%6 = zext i32 %0 to i64
%7 = zext i32 %0 to i64
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %21
10: ; preds = %5, %13
%11 = phi i64 [ %17, %13 ], [ 1, %5 ]
%12 = icmp eq i64 %11, %7
br i1 %12, label %18, label %13
13: ; preds = %10
%14 = getelementptr inbounds i32, i32* %2, i64 %11
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, %1
%17 = add nuw nsw i64 %11, 1
br i1 %16, label %10, label %18
18: ; preds = %10, %13
%19 = icmp uge i64 %11, %6
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %18, %5, %3
%22 = phi i32 [ 1, %3 ], [ 0, %5 ], [ %20, %18 ]
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ javacall_logging_initialize();
void javacall_os_initialize(void) {
  javacall_logging_initialize();
  return;
}


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

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

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

LLVM IR (-O2):
define void @javacall_os_initialize() {
%1 = tail call i32 (...) @javacall_logging_initialize()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SA1StackRelativeIndirectIndexed(int);
int /*<<< orphan*/ STA16(int /*<<< orphan*/, int);
void Op93M0(void) { STA16(SA1StackRelativeIndirectIndexed(2), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op93M0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1StackRelativeIndirectIndexed@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <STA16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op93M0>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1StackRelativeIndirectIndexed@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <STA16@plt>

LLVM IR (-O0):
define void @Op93M0() {
%1 = call i32 @SA1StackRelativeIndirectIndexed(i32 2)
%2 = call i32 @STA16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op93M0() {
%1 = tail call i32 @SA1StackRelativeIndirectIndexed(i32 2)
%2 = tail call i32 @STA16(i32 %1, i32 16777215)
ret void
}