xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char,
                           char);
int /*<<< orphan*/ stderr;
void check_chars(char actual, char expected, const char *msg) {
  if (expected == actual) {
    return;
  }
  fprintf(stderr, "FAIL: %s Expected '%c' but was '%c'\n", msg, expected,
          actual);
  exit(1);
}


x86 assembly (clang, -O0):
<check_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movsbl -0x2(%rbp),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <check_chars+0x2e>
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x2(%rbp),%al
lea    0xe9b(%rip),%rsi
movsbl %al,%ecx
movsbl -0x1(%rbp),%r8d
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<check_chars>:
cmp    %dil,%sil
jne    1126 <check_chars+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
movsbl %sil,%ecx
movsbl %dil,%r8d
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"FAIL: %s Expected '%c' but was '%c'\0A\00"
define void @check_chars(i8 signext %0, i8 signext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %8, %10
br i1 %11, label %12, label %13
12: ; preds = %3
ret void
13: ; preds = %3
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %6
%16 = load i8, i8* %5
%17 = load i8, i8* %4
%18 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %15, i8 signext %16, i8 signext %17)
%19 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"FAIL: %s Expected '%c' but was '%c'\0A\00"
define void @check_chars(i8 signext %0, i8 signext %1, i8* %2) {
%4 = icmp eq i8 %1, %0
br i1 %4, label %5, label %6
5: ; preds = %3
ret void
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %2, i8 signext %1, i8 signext %0)
%9 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ syscall(long, char const *, unsigned int);
int syscall_memfd_create(const char *name, unsigned int flags) {
  long nr = 319;
  return (int)syscall(nr, name, flags);
}


x86 assembly (clang, -O0):
<syscall_memfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x13f,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x13f,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @syscall_memfd_create(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
store i64 319, i64* %5
%6 = load i64, i64* %5
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i64 @syscall(i64 %6, i8* %7, i32 %8)
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscall_memfd_create(i8* %0, i32 %1) {
%3 = tail call i64 @syscall(i64 319, i8* %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ error(char *, char *);
void check_file_exists(char *file_path) {
  if (access(file_path, F_OK) != 0)
    error("File path invalid='%s'\n", file_path);
}


x86 assembly (clang, -O0):
<check_file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
je     1158 <check_file_exists+0x38>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_file_exists>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
test   %rax,%rax
je     1147 <check_file_exists+0x27>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <error@plt>
pop    %rbx
ret

LLVM IR (-O0):
@F_OK = global i32 0
@.str = [24 x i8] c"File path invalid='%s'\0A\00"
define void @check_file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %10
10: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@F_OK = global i32 0
@.str = [24 x i8] c"File path invalid='%s'\0A\00"
define void @check_file_exists(i8* %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct s_reader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ICC_Async_Close(struct s_reader *);
void cardreader_close(struct s_reader *reader) { ICC_Async_Close(reader); }


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

x86 assembly (clang, -O2):
<cardreader_close>:
jmp    1030 <ICC_Async_Close@plt>

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

LLVM IR (-O2):
%struct.s_reader = type { i32 }
define void @cardreader_close(%struct.s_reader* %0) {
%2 = tail call i32 @ICC_Async_Close(%struct.s_reader* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int no = 0;
  printf("Please input an interger: ");
  scanf("%d", &no);
  printf("Your input is: %d\n", no);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please input an interger: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Your input is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please input an interger: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [19 x i8] c"Your input is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int f85(int *);
int f86(int *p) { return f85(p); }


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

x86 assembly (clang, -O2):
<f86>:
jmp    1030 <f85@plt>

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

LLVM IR (-O2):
define i32 @f86(i32* %0) {
%2 = tail call i32 @f85(i32* %0)
ret i32 %2
}
int freeInt(int *ptr) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @freeInt(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GN_GPS_Update();
void GPS_Task() {
  GN_GPS_Update();
  return;
}


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

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

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

LLVM IR (-O2):
define void @GPS_Task() {
%1 = tail call i32 (...) @GN_GPS_Update()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ epoll_loop();
int main(int argc, char **argv) {
  epoll_loop();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @epoll_loop()
ret i32 0
}
void RTLockValidatorRecSharedSetSubClass(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int);
void wl_data_offer_finish(struct wl_data_offer *wl_data_offer) {
  wl_proxy_marshal((struct wl_proxy *)wl_data_offer, 3);
}


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

x86 assembly (clang, -O2):
<wl_data_offer_finish>:
mov    $0x3,%esi
jmp    1030 <wl_proxy_marshal@plt>

LLVM IR (-O0):
%struct.wl_data_offer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_offer_finish(%struct.wl_data_offer* %0) {
%2 = alloca %struct.wl_data_offer*
store %struct.wl_data_offer* %0, %struct.wl_data_offer** %2
%3 = load %struct.wl_data_offer*, %struct.wl_data_offer** %2
%4 = bitcast %struct.wl_data_offer* %3 to %struct.wl_proxy*
%5 = call i32 @wl_proxy_marshal(%struct.wl_proxy* %4, i32 3)
ret void
}

LLVM IR (-O2):
%struct.wl_data_offer = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_data_offer_finish(%struct.wl_data_offer* %0) {
%2 = bitcast %struct.wl_data_offer* %0 to %struct.wl_proxy*
%3 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %2, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rul__msg_print(char *, char *);
void rul__clear(void) {
  rul__msg_print("OBSOLFEAT W Obsolete feature %s",
                 "OPS_CLEAR, replace with RUL_REMOVE_INSTANCE");
}


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

x86 assembly (clang, -O2):
<rul__clear>:
lea    0xee9(%rip),%rdi
lea    0xf02(%rip),%rsi
jmp    1030 <rul__msg_print@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"OBSOLFEAT W Obsolete feature %s\00"
@.str.1 = [44 x i8] c"OPS_CLEAR, replace with RUL_REMOVE_INSTANCE\00"
define void @rul__clear() {
%1 = call i32 @rul__msg_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"OBSOLFEAT W Obsolete feature %s\00"
@.str.1 = [44 x i8] c"OPS_CLEAR, replace with RUL_REMOVE_INSTANCE\00"
define void @rul__clear() {
%1 = tail call i32 @rul__msg_print(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void eink_delay(int us) { (void)us; }


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

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

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

LLVM IR (-O2):
define void @eink_delay(i32 %0) {
ret void
}
int climbStairs(int n) {
  int a = 1, b = 1;
  while (n--)
    a = (b += a) - a;
  return a;
}


x86 assembly (clang, -O0):
<climbStairs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113d <climbStairs+0x3d>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <climbStairs+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<climbStairs>:
test   %edi,%edi
je     111d <climbStairs+0x1d>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    1123 <climbStairs+0x23>
mov    $0x1,%edx
mov    $0x1,%esi
jmp    1145 <climbStairs+0x45>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%edx
mov    $0x1,%esi
add    %edx,%esi
add    %esi,%edx
add    %edx,%esi
add    %esi,%edx
add    %edx,%esi
add    %esi,%edx
add    %edx,%esi
add    %esi,%edx
add    $0xfffffff8,%edi
jne    1130 <climbStairs+0x30>
mov    %esi,%eax
test   %ecx,%ecx
je     115d <climbStairs+0x5d>
nopl   0x0(%rax,%rax,1)
mov    %edx,%eax
add    %edx,%esi
mov    %esi,%edx
mov    %eax,%esi
add    $0xffffffff,%ecx
jne    1150 <climbStairs+0x50>
ret

LLVM IR (-O0):
define i32 @climbStairs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @climbStairs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %35, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %23, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %20, %9 ]
%11 = phi i32 [ 1, %7 ], [ %19, %9 ]
%12 = phi i32 [ 0, %7 ], [ %21, %9 ]
%13 = add nsw i32 %10, %11
%14 = add nsw i32 %13, %10
%15 = add nsw i32 %14, %13
%16 = add nsw i32 %15, %14
%17 = add nsw i32 %16, %15
%18 = add nsw i32 %17, %16
%19 = add nsw i32 %18, %17
%20 = add nsw i32 %19, %18
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %8
br i1 %22, label %23, label %9
23: ; preds = %9, %3
%24 = phi i32 [ undef, %3 ], [ %19, %9 ]
%25 = phi i32 [ 1, %3 ], [ %20, %9 ]
%26 = phi i32 [ 1, %3 ], [ %19, %9 ]
%27 = icmp eq i32 %5, 0
br i1 %27, label %35, label %28
28: ; preds = %23, %28
%29 = phi i32 [ %32, %28 ], [ %25, %23 ]
%30 = phi i32 [ %29, %28 ], [ %26, %23 ]
%31 = phi i32 [ %33, %28 ], [ 0, %23 ]
%32 = add nsw i32 %29, %30
%33 = add i32 %31, 1
%34 = icmp eq i32 %33, %5
br i1 %34, label %35, label %28
35: ; preds = %23, %28, %1
%36 = phi i32 [ 1, %1 ], [ %24, %23 ], [ %29, %28 ]
ret i32 %36
}
/* Variables and functions */
double gsl_ran_gamma_pdf(double, double, int);
double pdf_Gamma(double a, double x) { return gsl_ran_gamma_pdf(x, a, 1); }


x86 assembly (clang, -O0):
<pdf_Gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mov    $0x1,%edi
call   1030 <gsl_ran_gamma_pdf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pdf_Gamma>:
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
mov    $0x1,%edi
jmp    1030 <gsl_ran_gamma_pdf@plt>

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

LLVM IR (-O2):
define double @pdf_Gamma(double %0, double %1) {
%3 = tail call double @gsl_ran_gamma_pdf(double %1, double %0, i32 1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int /*<<< orphan*/ vlc_demux_process_memory(int /*<<< orphan*/,
                                            int /*<<< orphan*/ const *, size_t);
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  vlc_demux_process_memory(getenv("VLC_DEMUX"), data, size);
  return 0;
}


x86 assembly (clang, -O0):
<LLVMFuzzerTestOneInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <vlc_demux_process_memory@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LLVMFuzzerTestOneInput>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <vlc_demux_process_memory@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"VLC_DEMUX\00"
define i32 @LLVMFuzzerTestOneInput(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = call i32 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = load i32*, i32** %3
%7 = load i64, i64* %4
%8 = call i32 @vlc_demux_process_memory(i32 %5, i32* %6, i64 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"VLC_DEMUX\00"
define i32 @LLVMFuzzerTestOneInput(i32* %0, i64 %1) {
%3 = tail call i32 @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @vlc_demux_process_memory(i32 %3, i32* %0, i64 %1)
ret i32 0
}
IR0IR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ (*p0) = (*p1); }


x86 assembly (clang, -O0):
<IR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0IR1>:
mov    (%r9),%eax
mov    %eax,(%r8)
ret

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

LLVM IR (-O2):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture %5) {
%7 = load i32, i32* %5
store i32 %7, i32* %4
ret i32 undef
}
/* Variables and functions */
char *get_app_name(char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, char *);
void show_usage(char *path) {
  printf(
      "Usage: %s %s\n%s\n%s\n%s\n", get_app_name(path), "str [1-25]",
      "Try to decode a message by brute forcing or one try with the offset "
      "defined.",
      "str is the message",
      "offset is optional. If specified it will only check for this offset.");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_app_name@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rdx
lea    0xed5(%rip),%rcx
lea    0xf1b(%rip),%r8
lea    0xf27(%rip),%r9
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %rax
call   1040 <get_app_name@plt>
lea    0xed3(%rip),%rdi
lea    0xee3(%rip),%rdx
lea    0xee7(%rip),%rcx
lea    0xf2d(%rip),%r8
lea    0xf39(%rip),%r9
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s %s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [11 x i8] c"str [1-25]\00"
@.str.2 = [77 x i8] c"Try to decode a message by brute forcing or one try with the offset defined.\00"
@.str.3 = [19 x i8] c"str is the message\00"
@.str.4 = [69 x i8] c"offset is optional. If specified it will only check for this offset.\00"
define void @show_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @get_app_name(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s %s\0A%s\0A%s\0A%s\0A\00"
@.str.1 = [11 x i8] c"str [1-25]\00"
@.str.2 = [77 x i8] c"Try to decode a message by brute forcing or one try with the offset defined.\00"
@.str.3 = [19 x i8] c"str is the message\00"
@.str.4 = [69 x i8] c"offset is optional. If specified it will only check for this offset.\00"
define void @show_usage(i8* %0) {
%2 = tail call i8* @get_app_name(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, __attribute__((unused)) char *argv[argc + 1]) {
  int i = 3;
  switch (i) {
  case 1:
  i_is_1:
    printf("i is 1\n");
    return 0;
    break;
  case 3:
    printf("i is 3\n");
    break;
  default:
    printf("i don't know\n");
    break;
  }
  goto i_is_1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0x1,%eax
je     1152 <main+0x42>
jmp    1141 <main+0x31>
mov    -0x18(%rbp),%eax
sub    $0x3,%eax
je     116b <main+0x5b>
jmp    117c <main+0x6c>
jmp    1157 <main+0x47>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x78>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <main+0x47>

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

LLVM IR (-O0):
@.str = [8 x i8] c"i is 1\0A\00"
@.str.1 = [8 x i8] c"i is 3\0A\00"
@.str.2 = [14 x i8] c"i don't know\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
store i32 3, i32* %6
%10 = load i32, i32* %6
switch i32 %10, label %16 [
i32 1, label %11
i32 3, label %14
]
11: ; preds = %2
br label %12
12: ; preds = %18, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %18
16: ; preds = %2
%17 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
br label %12
}

LLVM IR (-O2):
@str = [7 x i8] c"i is 3\00"
@str.3 = [7 x i8] c"i is 1\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void CRYPTO_mem_ctrl(void) {}


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

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

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

LLVM IR (-O2):
define void @CRYPTO_mem_ctrl() {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int mask;

/* Variables and functions */
void smpte_fec_set_mask(uint8_t *p_fec, uint32_t mask) {
  p_fec[5] = (mask >> 16) & 0xff;
  p_fec[6] = (mask >> 8) & 0xff;
  p_fec[7] = (mask)&0xff;
}


x86 assembly (clang, -O0):
<smpte_fec_set_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_set_mask>:
mov    %esi,%eax
movzbl %ah,%ecx
movzbl %al,%edx
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,0x14(%rdi)
mov    %ecx,0x18(%rdi)
mov    %edx,0x1c(%rdi)
ret

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

LLVM IR (-O2):
define void @smpte_fec_set_mask(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %4, i32* %5
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %7, i32* %8
%9 = and i32 %1, 255
%10 = getelementptr inbounds i32, i32* %0, i64 7
store i32 %9, i32* %10
ret void
}
int i(int x) {
  x += 0x7fffffff;
  x += 0x7fffffff;
  return x;
}


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

x86 assembly (clang, -O2):
<i>:
lea    -0x2(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @i(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2147483647
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 2147483647
store i32 %6, i32* %2
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @i(i32 %0) {
%2 = add i32 %0, -2
ret i32 %2
}
int condition_atTheRate(char c) { return c == '@'; }


x86 assembly (clang, -O0):
<condition_atTheRate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x40,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_atTheRate>:
xor    %eax,%eax
cmp    $0x40,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_atTheRate(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 64
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_atTheRate(i8 signext %0) {
%2 = icmp eq i8 %0, 64
%3 = zext i1 %2 to i32
ret i32 %3
}
void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


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

x86 assembly (clang, -O2):
<SteamAPI_ISteamMatchmakingServers_CancelServerQuery>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmakingServers_CancelServerQuery = [52 x i8] c"SteamAPI_ISteamMatchmakingServers_CancelServerQuery\00"
define void @SteamAPI_ISteamMatchmakingServers_CancelServerQuery(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @__func__.SteamAPI_ISteamMatchmakingServers_CancelServerQuery, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_ISteamMatchmakingServers_CancelServerQuery = [52 x i8] c"SteamAPI_ISteamMatchmakingServers_CancelServerQuery\00"
define void @SteamAPI_ISteamMatchmakingServers_CancelServerQuery(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @__func__.SteamAPI_ISteamMatchmakingServers_CancelServerQuery, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int listen(int, int);
int /*<<< orphan*/ perror(char *);
int sock_listen(int sockfd, int backlog) {
  int ret;
  ret = listen(sockfd, backlog);
  if (ret == -1) {
    perror("listen");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sock_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <listen@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    115e <sock_listen+0x3e>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <sock_listen+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_listen>:
push   %rax
call   1030 <listen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <sock_listen+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"listen\00"
define i32 @sock_listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @listen(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %12
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [7 x i8] c"listen\00"
define i32 @sock_listen(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ -1, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void check_retval(int retval, const char *str) {
  if (retval != 0) {
    perror(str);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_retval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114c <check_retval+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_retval>:
test   %edi,%edi
jne    1125 <check_retval+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @check_retval(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ at_init();
int /*<<< orphan*/ ide_init();
int /*<<< orphan*/ opti495_init();
void at_opti495_init() {
  at_init();
  ide_init();
  opti495_init();
}


x86 assembly (clang, -O0):
<at_opti495_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <at_init@plt>
mov    $0x0,%al
call   1050 <ide_init@plt>
mov    $0x0,%al
call   1040 <opti495_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_opti495_init>:
push   %rax
xor    %eax,%eax
call   1030 <at_init@plt>
xor    %eax,%eax
call   1050 <ide_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <opti495_init@plt>

LLVM IR (-O0):
define void @at_opti495_init() {
%1 = call i32 (...) @at_init()
%2 = call i32 (...) @ide_init()
%3 = call i32 (...) @opti495_init()
ret void
}

LLVM IR (-O2):
define void @at_opti495_init() {
%1 = tail call i32 (...) @at_init()
%2 = tail call i32 (...) @ide_init()
%3 = tail call i32 (...) @opti495_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void packetize_free(char *payload) {
  if (!payload)
    return;
  free(payload);
}


x86 assembly (clang, -O0):
<packetize_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <packetize_free+0x1c>
jmp    1135 <packetize_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packetize_free>:
test   %rdi,%rdi
je     111a <packetize_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @packetize_free(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 %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @packetize_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
scalar_t__ LDBL_EPSILON;
scalar_t__ fabsl(long double);
bool cutils_fcmp_long_double_compare(long double a, long double b) {
  return fabsl(a - b) < LDBL_EPSILON;
}


x86 assembly (clang, -O0):
<cutils_fcmp_long_double_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fsubrp %st,%st(1)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <fabsl@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_fcmp_long_double_compare>:
sub    $0x18,%rsp
fldt   0x30(%rsp)
fldt   0x20(%rsp)
fsubp  %st,%st(1)
fstpt  (%rsp)
call   1030 <fabsl@plt>
mov    0x2eab(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setl   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@LDBL_EPSILON = global i64 0
define i32 @cutils_fcmp_long_double_compare(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fsub x86_fp80 %5, %6
%8 = call i64 @fabsl(x86_fp80 %7)
%9 = load i64, i64* @LDBL_EPSILON
%10 = icmp slt i64 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@LDBL_EPSILON = global i64 0
define i32 @cutils_fcmp_long_double_compare(x86_fp80 %0, x86_fp80 %1) {
%3 = fsub x86_fp80 %0, %1
%4 = tail call i64 @fabsl(x86_fp80 %3)
%5 = load i64, i64* @LDBL_EPSILON
%6 = icmp slt i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char);
void p(unsigned char a, unsigned char b, unsigned char v) {
  if (v)
    printf("\t%d / %d = %d\r\n", a, b, v);
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
cmpb   $0x0,-0x3(%rbp)
je     114f <p+0x3f>
mov    -0x1(%rbp),%cl
mov    -0x2(%rbp),%al
lea    0xec0(%rip),%rdi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x3(%rbp),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
test   %edx,%edx
je     1130 <p+0x20>
movzbl %dil,%eax
movzbl %sil,%r8d
movzbl %dl,%ecx
lea    0xeda(%rip),%rdi
mov    %eax,%esi
mov    %r8d,%edx
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"\09%d / %d = %d\0D\0A\00"
define void @p(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 zeroext %0, i8 zeroext %1, i8 zeroext %2)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
double _hex_to_int(char *);
double intake_pressure(char *data) { return _hex_to_int(data) / 0.14504; }


x86 assembly (clang, -O0):
<intake_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_hex_to_int@plt>
movsd  0xed3(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intake_pressure>:
push   %rax
call   1030 <_hex_to_int@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @intake_pressure(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @_hex_to_int(i8* %3)
%5 = fdiv double %4, 1.450400e-01
ret double %5
}

LLVM IR (-O2):
define double @intake_pressure(i8* %0) {
%2 = tail call double @_hex_to_int(i8* %0)
%3 = fdiv double %2, 1.450400e-01
ret double %3
}
/* Variables and functions */
scalar_t__ second_smallest(int /*<<< orphan*/ *, int /*<<< orphan*/);
int test_empty_input() { return second_smallest(NULL, 0) == 0; }


x86 assembly (clang, -O0):
<test_empty_input>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <second_smallest@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_empty_input>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <second_smallest@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_empty_input() {
%1 = call i64 @second_smallest(i32* null, i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_empty_input() {
%1 = tail call i64 @second_smallest(i32* null, i32 0)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", fact(4));
  return 0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @g9() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ border_width;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
int get_XWindowChanges_border_width(void *_p) {
  return (int)((XWindowChanges *)_p)->border_width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowChanges_border_width(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowChanges_border_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int pskb_expand_head(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pskb_expand_head() {
ret i32 0
}
int setb(int num) {
  int count = 0;
  while (num) {
    if (num & 1)
      count++;
    num = num / 10;
  }
  return count;
}


x86 assembly (clang, -O0):
<setb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <setb+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <setb+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <setb+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setb>:
xor    %eax,%eax
test   %edi,%edi
je     1134 <setb+0x34>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
and    $0x1,%edi
add    %edi,%eax
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <setb+0x10>
ret

LLVM IR (-O0):
define i32 @setb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, 1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %7
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @setb(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = sdiv i32 %5, 10
%9 = add i32 %5, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int print_unbalanced(int count, char name[]) {
  if (count) {
    printf("%s are unbalanced.\n", name);
  }
  return count;
}


x86 assembly (clang, -O0):
<print_unbalanced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1139 <print_unbalanced+0x29>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_unbalanced>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
je     1123 <print_unbalanced+0x13>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"%s are unbalanced.\0A\00"
define i32 @print_unbalanced(i32 returned %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %6
6: ; preds = %4, %2
ret i32 %0
}