xunge/DecIR huggingface dataset:
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int get_terminal_height() {
  struct winsize wsize;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &wsize);
  return wsize.ws_row;
}


x86 assembly (clang, -O0):
<get_terminal_height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_terminal_height>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_terminal_height() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @get_terminal_height() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};
struct wl_array {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/,
                                          struct wl_resource *,
                                          struct wl_array *);
void wl_keyboard_send_enter(struct wl_resource *resource_, uint32_t serial,
                            struct wl_resource *surface,
                            struct wl_array *keys) {
  wl_resource_post_event(resource_, 1, serial, surface, keys);
}


x86 assembly (clang, -O0):
<wl_keyboard_send_enter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%esi
call   1030 <wl_resource_post_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_keyboard_send_enter>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
%struct.wl_array = type { i32 }
define void @wl_keyboard_send_enter(%struct.wl_resource* %0, i32 %1, %struct.wl_resource* %2, %struct.wl_array* %3) {
%5 = alloca %struct.wl_resource*
%6 = alloca i32
%7 = alloca %struct.wl_resource*
%8 = alloca %struct.wl_array*
store %struct.wl_resource* %0, %struct.wl_resource** %5
store i32 %1, i32* %6
store %struct.wl_resource* %2, %struct.wl_resource** %7
store %struct.wl_array* %3, %struct.wl_array** %8
%9 = load %struct.wl_resource*, %struct.wl_resource** %5
%10 = load i32, i32* %6
%11 = load %struct.wl_resource*, %struct.wl_resource** %7
%12 = load %struct.wl_array*, %struct.wl_array** %8
%13 = call i32 @wl_resource_post_event(%struct.wl_resource* %9, i32 1, i32 %10, %struct.wl_resource* %11, %struct.wl_array* %12)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
%struct.wl_array = type { i32 }
define void @wl_keyboard_send_enter(%struct.wl_resource* %0, i32 %1, %struct.wl_resource* %2, %struct.wl_array* %3) {
%5 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 1, i32 %1, %struct.wl_resource* %2, %struct.wl_array* %3)
ret void
}
unsigned int getSquareIdxWithId(unsigned int ID) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getSquareIdxWithId(i32 %0) {
ret i32 0
}
/* Variables and functions */
bool GAOptionExists(int argc, char **argv) {
  while (argc--)
    if ((*argv++)[0] == '-')
      return true;
  return false;
}


x86 assembly (clang, -O0):
<GAOptionExists>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     114e <GAOptionExists+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1149 <GAOptionExists+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1155 <GAOptionExists+0x55>
jmp    110b <GAOptionExists+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GAOptionExists>:
mov    %edi,%ecx
xor    %eax,%eax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
cmp    %edx,%ecx
je     1126 <GAOptionExists+0x26>
mov    (%rsi,%rdx,8),%rdi
add    $0x1,%rdx
cmpb   $0x2d,(%rdi)
jne    1110 <GAOptionExists+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @GAOptionExists(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %0, %2 ], [ %8, %7 ]
%5 = phi i8** [ %1, %2 ], [ %9, %7 ]
%6 = icmp eq i32 %4, 0
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = getelementptr inbounds i8*, i8** %5, i64 1
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 45
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %14
}
int compar(const void *a, const void *b) {
  int *aa = (int *)a;
  int *bb = (int *)b;
  return *aa - *bb;
}


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

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

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

LLVM IR (-O2):
define i32 @compar(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int cmp(int, int);
numcmp(const void *a, const void *b) { return cmp(*(int *)a, *(int *)b); }


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

x86 assembly (clang, -O2):
<numcmp>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <cmp@plt>

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

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @cmp(i32 %4, i32 %6)
ret i32 %7
}
short zig_addw_short(short lhs, short rhs, short min, short max) {
  return (short)(((unsigned short)lhs) + ((unsigned short)rhs));
}


x86 assembly (clang, -O0):
<zig_addw_short>:
push   %rbp
mov    %rsp,%rbp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
movzwl -0x4(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_addw_short>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define signext i16 @zig_addw_short(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = load i16, i16* %6
%12 = zext i16 %11 to i32
%13 = add nsw i32 %10, %12
%14 = trunc i32 %13 to i16
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @zig_addw_short(i16 signext %0, i16 signext %1, i16 signext %2, i16 signext %3) {
%5 = add i16 %1, %0
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void user_error(char *msg) { printf("APPLICATION ERROR: %s\n", msg); }


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

x86 assembly (clang, -O2):
<user_error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"APPLICATION ERROR: %s\0A\00"
define void @user_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
char *ZLIB_VERSION;
char *icl_zlib_version(void) { return ZLIB_VERSION; }


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

x86 assembly (clang, -O2):
<icl_zlib_version>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@ZLIB_VERSION = global i8* null
define i8* @icl_zlib_version() {
%1 = load i8*, i8** @ZLIB_VERSION
ret i8* %1
}

LLVM IR (-O2):
@ZLIB_VERSION = global i8* null
define i8* @icl_zlib_version() {
%1 = load i8*, i8** @ZLIB_VERSION
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ depth_update();
int /*<<< orphan*/ msleep(int);
int /*<<< orphan*/ printf(char *);
void pullDepthImage() {
  printf("Pulling a depth image\n");
  while (!depth_update()) {
    msleep(2000);
  }
}


x86 assembly (clang, -O0):
<pullDepthImage>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <depth_update@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    115c <pullDepthImage+0x2c>
jmp    116b <pullDepthImage+0x3b>
mov    $0x7d0,%edi
call   1040 <msleep@plt>
jmp    1140 <pullDepthImage+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pullDepthImage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
nopl   (%rax)
xor    %eax,%eax
call   1030 <depth_update@plt>
test   %eax,%eax
jne    1157 <pullDepthImage+0x27>
mov    $0x7d0,%edi
call   1050 <msleep@plt>
jmp    1140 <pullDepthImage+0x10>
pop    %rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Pulling a depth image\0A\00"
define void @pullDepthImage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @depth_update()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @msleep(i32 2000)
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Pulling a depth image\00"
define void @pullDepthImage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @depth_update()
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0, %4
%5 = tail call i32 @msleep(i32 2000)
%6 = tail call i32 (...) @depth_update()
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_le16(const uint8_t *p) { return (((uint16_t)p[1]) << 8) | p[0]; }


x86 assembly (clang, -O0):
<get_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_le16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_le16(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %0
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ clear();
scalar_t__ getpid();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ raw();
int /*<<< orphan*/ srand(scalar_t__);
void Initialize() {
  srand(getpid() + 13);
  initscr();
  raw();
  noecho();
  clear();
}


x86 assembly (clang, -O0):
<Initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,%rdi
add    $0xd,%rdi
call   1060 <srand@plt>
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1050 <raw@plt>
mov    $0x0,%al
call   1070 <noecho@plt>
mov    $0x0,%al
call   1080 <clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Initialize>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xd(%rax),%rdi
call   1060 <srand@plt>
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1050 <raw@plt>
xor    %eax,%eax
call   1070 <noecho@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <clear@plt>

LLVM IR (-O0):
define void @Initialize() {
%1 = call i64 (...) @getpid()
%2 = add nsw i64 %1, 13
%3 = call i32 @srand(i64 %2)
%4 = call i32 (...) @initscr()
%5 = call i32 (...) @raw()
%6 = call i32 (...) @noecho()
%7 = call i32 (...) @clear()
ret void
}

LLVM IR (-O2):
define void @Initialize() {
%1 = tail call i64 (...) @getpid()
%2 = add nsw i64 %1, 13
%3 = tail call i32 @srand(i64 %2)
%4 = tail call i32 (...) @initscr()
%5 = tail call i32 (...) @raw()
%6 = tail call i32 (...) @noecho()
%7 = tail call i32 (...) @clear()
ret void
}
void set(int size, char *arr, int a, int b, int v) {
  arr[size * a + b] = v;
  arr[size * b + a] = v;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
mov    %edx,%eax
imul   %edi,%eax
add    %ecx,%eax
cltq
mov    %r8b,(%rsi,%rax,1)
imul   %edi,%ecx
add    %edx,%ecx
movslq %ecx,%rax
mov    %r8b,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @set(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %7
%14 = load i32, i32* %6
%15 = load i32, i32* %8
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %9
%18 = add nsw i32 %16, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %13, i64 %19
store i8 %12, i8* %20
%21 = load i32, i32* %10
%22 = trunc i32 %21 to i8
%23 = load i8*, i8** %7
%24 = load i32, i32* %6
%25 = load i32, i32* %9
%26 = mul nsw i32 %24, %25
%27 = load i32, i32* %8
%28 = add nsw i32 %26, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %23, i64 %29
store i8 %22, i8* %30
ret void
}

LLVM IR (-O2):
define void @set(i32 %0, i8* nocapture writeonly %1, i32 %2, i32 %3, i32 %4) {
%6 = trunc i32 %4 to i8
%7 = mul nsw i32 %2, %0
%8 = add nsw i32 %7, %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
store i8 %6, i8* %10
%11 = mul nsw i32 %3, %0
%12 = add nsw i32 %11, %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %1, i64 %13
store i8 %6, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: HXFmerge [INPUT_DIR] [FW]\n\n");
  fprintf(stderr, "Example: HXFmerge VX747_extracted/ VX747.HXF\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xeea(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef4(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: HXFmerge [INPUT_DIR] [FW]\0A\0A\00"
@.str.1 = [47 x i8] c"Example: HXFmerge VX747_extracted/ VX747.HXF\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage: HXFmerge [INPUT_DIR] [FW]\0A\0A\00"
@.str.1 = [47 x i8] c"Example: HXFmerge VX747_extracted/ VX747.HXF\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drv_Sample_send(char *, int);
void drv_Sample_clear(void) {
  char cmd[1];
  cmd[0] = 0x01;
  drv_Sample_send(cmd, 1);
}


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

x86 assembly (clang, -O2):
<drv_Sample_clear>:
push   %rax
movb   $0x1,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <drv_Sample_send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @drv_Sample_clear() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 1, i8* %2
%3 = call i32 @drv_Sample_send(i8* %2, i32 1)
ret void
}
unsigned int byte_swap_4(unsigned int v) {
  v = ((v & 0x0000FFFFU) << 16) | (v >> 16);
  return ((v & 0x00FF00FFU) << 8) | ((v & 0xFF00FF00U) >> 8);
}


x86 assembly (clang, -O0):
<byte_swap_4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @byte_swap_4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65535
%5 = shl i32 %4, 16
%6 = load i32, i32* %2
%7 = lshr i32 %6, 16
%8 = or i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 16711935
%11 = shl i32 %10, 8
%12 = load i32, i32* %2
%13 = and i32 %12, -16711936
%14 = lshr i32 %13, 8
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @byte_swap_4(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world from t2 Main!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Hello world from t2 Main!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [26 x i8] c"Hello world from t2 Main!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int linit_tasks_test_bool(int n) { return (n != 0); }


x86 assembly (clang, -O0):
<linit_tasks_test_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linit_tasks_test_bool>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @linit_tasks_test_bool(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @linit_tasks_test_bool(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ b(int);
int /*<<< orphan*/ printf(char *, int);
void a(int c) {
  printf("a(%i)\n", c);
  if (!c)
    return;
  b(c - 1);
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1149 <a+0x29>
jmp    1154 <a+0x34>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
test   %ebx,%ebx
je     1140 <a+0x20>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <b@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"a(%i)\0A\00"
define void @a(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @b(i32 %5)
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printX(const char *x) { printf("%s\n", x); }


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

x86 assembly (clang, -O2):
<printX>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printX(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ChkArcCtxLen(unsigned long len) { return len != (259) ? (0) : (1); }


x86 assembly (clang, -O0):
<ChkArcCtxLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x103,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkArcCtxLen>:
xor    %eax,%eax
cmp    $0x103,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @ChkArcCtxLen(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 259
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 0, i32 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @ChkArcCtxLen(i64 %0) {
%2 = icmp eq i64 %0, 259
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ opt_usage();
int /*<<< orphan*/ short_usage();
void long_usage(void) {
  short_usage();
  opt_usage();
}


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

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

LLVM IR (-O0):
define void @long_usage() {
%1 = call i32 (...) @short_usage()
%2 = call i32 (...) @opt_usage()
ret void
}

LLVM IR (-O2):
define void @long_usage() {
%1 = tail call i32 (...) @short_usage()
%2 = tail call i32 (...) @opt_usage()
ret void
}
/* Variables and functions */
void *malloc(int);
void *my_malloc(void *opaque, int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<my_malloc>:
mov    %esi,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @my_malloc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t PeResolveSymbols(uint64_t base, char **functions,
                          uint64_t nFunctions) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @PeResolveSymbols(i32 %0, i8** nocapture readnone %1, i32 %2) {
ret i32 0
}
void rtvOEM_PowerOn(int on) {
  if (on) {
    ((void)0);
  } else {
    ((void)0);
  }
}


x86 assembly (clang, -O0):
<rtvOEM_PowerOn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <rtvOEM_PowerOn+0x16>
jmp    111b <rtvOEM_PowerOn+0x1b>
jmp    111b <rtvOEM_PowerOn+0x1b>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rtvOEM_PowerOn(i32 %0) {
ret void
}
int test_imm_31uint16_reg(unsigned short val) {
  return ((val) & (0x31 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_31uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x31,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_31uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 49
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ closelog_intern(int /*<<< orphan*/);
void sigpipe_handler(int sig) { closelog_intern(0); }


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

x86 assembly (clang, -O2):
<sigpipe_handler>:
xor    %edi,%edi
jmp    1030 <closelog_intern@plt>

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

LLVM IR (-O2):
define void @sigpipe_handler(i32 %0) {
%2 = tail call i32 @closelog_intern(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *, unsigned int, char const *);
void check_fail(const char *assertion, const char *file, unsigned int line) {
  printf("%s:%d: Check (%s) failed.", file, line, assertion);
  exit(1);
}


x86 assembly (clang, -O0):
<check_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [26 x i8] c"%s:%d: Check (%s) failed.\00"
define void @check_fail(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** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8, i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s:%d: Check (%s) failed.\00"
define void @check_fail(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
const char *ofc_hashmap__item_key(const char *item) { return item; }


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

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

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

LLVM IR (-O2):
define i8* @ofc_hashmap__item_key(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_RemoveCommand(char *);
void Key_Shutdown(void) { Cmd_RemoveCommand("bind"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"bind\00"
define void @Key_Shutdown() {
%1 = tail call i32 @Cmd_RemoveCommand(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int rsn_preauth_iface_init(struct hostapd_data *hapd) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define i32 @rsn_preauth_iface_init(%struct.hostapd_data* nocapture readnone %0) {
ret i32 0
}
unsigned xrop3_11_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_11_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_11_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_11_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
ret i32 %33
}

LLVM IR (-O2):
define i32 @xrop3_11_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void __attribute__((destructor)) sandbox_fini(void) {
  fprintf(stderr, "%s", "Interpose_FSLib_end()\n");
}


x86 assembly (clang, -O0):
<sandbox_fini>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xed8(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_fini>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xedc(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [23 x i8] c"Interpose_FSLib_end()\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @sandbox_fini, i8* null }]
define void @sandbox_fini() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [23 x i8] c"Interpose_FSLib_end()\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @sandbox_fini, i8* null }]
define void @sandbox_fini() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int nixtrace(char *cp, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nixtrace(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bad_eof();
char *read_token();
char *read_token_no_eof(void) {
  char *token = read_token();
  if (token == NULL)
    bad_eof();
  return token;
}


x86 assembly (clang, -O0):
<read_token_no_eof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <read_token@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <read_token_no_eof+0x25>
mov    $0x0,%al
call   1030 <bad_eof@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_token_no_eof>:
push   %rbx
xor    %eax,%eax
call   1040 <read_token@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1137 <read_token_no_eof+0x17>
xor    %eax,%eax
call   1030 <bad_eof@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @read_token_no_eof() {
%1 = alloca i8*
%2 = call i8* (...) @read_token()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bad_eof()
br label %7
7: ; preds = %5, %0
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
define i8* @read_token_no_eof() {
%1 = tail call i8* (...) @read_token()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bad_eof()
br label %5
5: ; preds = %3, %0
ret i8* %1
}
/* Type definitions */
typedef unsigned long long uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
void mark(uint64_t *set, unsigned long long pos) {
  uint8_t setbit = pos % (sizeof(uint64_t) * 8);
  unsigned long long int offset = pos / (sizeof(uint64_t) * 8);
  set[offset] |= 1ULL << setbit;
  return;
}


x86 assembly (clang, -O0):
<mark>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3f,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark>:
mov    %rsi,%rcx
mov    %rsi,%rax
mov    $0x1,%edx
shl    %cl,%rdx
shr    $0x6,%rax
or     %rdx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @mark(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = urem i64 %7, 64
store i64 %8, i64* %5
%9 = load i64, i64* %4
%10 = udiv i64 %9, 64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = shl i64 1, %11
%13 = load i64*, i64** %3
%14 = load i64, i64* %6
%15 = getelementptr inbounds i64, i64* %13, i64 %14
%16 = load i64, i64* %15
%17 = or i64 %16, %12
store i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @mark(i64* nocapture %0, i64 %1) {
%3 = and i64 %1, 63
%4 = lshr i64 %1, 6
%5 = shl nuw i64 1, %3
%6 = getelementptr inbounds i64, i64* %0, i64 %4
%7 = load i64, i64* %6
%8 = or i64 %7, %5
store i64 %8, i64* %6
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFMT;
int S_IFREG;
scalar_t__ stat(char const *, struct stat *);
int fd_isreg(const char *filename) {
  struct stat st;
  if (stat(filename, &st))
    return -1;
  return (st.st_mode & S_IFMT) == S_IFREG ? 0 : -1;
}


x86 assembly (clang, -O0):
<fd_isreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <fd_isreg+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <fd_isreg+0x53>
mov    -0x18(%rbp),%edx
mov    0x2e8f(%rip),%rax
and    (%rax),%edx
mov    0x2e96(%rip),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_isreg>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1128 <fd_isreg+0x18>
pop    %rcx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
and    (%rsp),%ecx
mov    0x2ead(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
setne  %al
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFMT = global i32 0
@S_IFREG = global i32 0
define i32 @fd_isreg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %18
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = load i32, i32* @S_IFMT
%13 = and i32 %11, %12
%14 = load i32, i32* @S_IFREG
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 -1
store i32 %17, i32* %2
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFMT = global i32 0
@S_IFREG = global i32 0
define i32 @fd_isreg(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFMT
%10 = and i32 %9, %8
%11 = load i32, i32* @S_IFREG
%12 = icmp ne i32 %10, %11
%13 = sext i1 %12 to i32
br label %14
14: ; preds = %1, %6
%15 = phi i32 [ %13, %6 ], [ -1, %1 ]
ret i32 %15
}
void wakeup_source_gpio_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @wakeup_source_gpio_cleanup() {
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
double clocks_to_seconds(clock_t start, clock_t end) {
  return (double)(end - start) / CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<clocks_to_seconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2ec8(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clocks_to_seconds>:
sub    %rdi,%rsi
cvtsi2sd %rsi,%xmm0
mov    0x2ed9(%rip),%rax
divsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @clocks_to_seconds(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
%9 = load double, double* @CLOCKS_PER_SEC
%10 = fdiv double %8, %9
ret double %10
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @clocks_to_seconds(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = sitofp i64 %3 to double
%5 = load double, double* @CLOCKS_PER_SEC
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ StaticFunc();
void Test(void) { StaticFunc(); }


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

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

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

LLVM IR (-O2):
define void @Test() {
%1 = tail call i32 (...) @StaticFunc()
ret void
}
/* Variables and functions */
float __ocml_i1_f32(float);
float cyl_bessel_i1f(float x) { return __ocml_i1_f32(x); }


x86 assembly (clang, -O0):
<cyl_bessel_i1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_i1_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cyl_bessel_i1f>:
jmp    1030 <__ocml_i1_f32@plt>

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

LLVM IR (-O2):
define float @cyl_bessel_i1f(float %0) {
%2 = tail call float @__ocml_i1_f32(float %0)
ret float %2
}