xunge/DecIR huggingface dataset:
void ____build_time_check_for_reserved_bits(void) {
  (void)(sizeof(
      int[(((((1ULL << 0) | (1ULL << 1) | (1ULL << 2) | (1ULL << 3) |
              (1ULL << 4) | (1ULL << 5) | (1ULL << 6) | (1ULL << 7) |
              (1ULL << 8) | (1ULL << 9) | (1ULL << 10) | (1ULL << 11) |
              (1ULL << 12) | (1ULL << 13) | (1ULL << 14) | (1ULL << 16) |
              (1ULL << 15) | (1ULL << 17) | (1ULL << 18) | (1ULL << 19) |
              (1ULL << 20) | (1ULL << 21) | (1ULL << 22) | (1ULL << 23) |
              (1ULL << 24) | (1ULL << 25) | (1ULL << 26) | (1ULL << 27) |
              (1ULL << 28) | (1ULL << 29) | (1ULL << 30) | (1ULL << 31) |
              (1ULL << 32) | (1ULL << 33) | (1ULL << 34) | (1ULL << 35) |
              (1ULL << 36) | (1ULL << 37) | (1ULL << 38) | (1ULL << 39) |
              (1ULL << 40) | (1ULL << 41) | (1ULL << 41) | (1ULL << 42) |
              (1ULL << 43) | (1ULL << 44) | (1ULL << 45) | (1ULL << 46) |
              (1ULL << 46) | (1ULL << 46) | (1ULL << 46) | (1ULL << 47) |
              0ULL) &
             ((1ULL << 62) | (1ULL << 61) | (1ULL << 63))) == 0) == 0)
              ? -1
              : 0]));
}


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

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

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

LLVM IR (-O2):
define void @____build_time_check_for_reserved_bits() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ tty_close();
void sig_catch(int sig) {
  tty_close();
  exit(0);
}


x86 assembly (clang, -O0):
<sig_catch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <tty_close@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_catch>:
push   %rax
xor    %eax,%eax
call   1030 <tty_close@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sig_catch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @tty_close()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sig_catch(i32 %0) {
%2 = tail call i32 (...) @tty_close()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int backwords() {
  char c;
  char op;
  scanf("%c", &c);
  if (c != 10)
    backwords();
  printf("%c", c);
}


x86 assembly (clang, -O0):
<backwords>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     115a <backwords+0x2a>
call   1050 <backwords@plt>
lea    0xe9f(%rip),%rdi
movsbl -0x5(%rbp),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backwords>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xa,%al
cmpb   $0xa,0x7(%rsp)
je     1154 <backwords+0x24>
call   1050 <backwords@plt>
mov    0x7(%rsp),%al
movsbl %al,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @backwords() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 10
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = call i32 @backwords()
%7 = load i8, i8* %1
br label %8
8: ; preds = %5, %0
%9 = phi i8 [ %7, %5 ], [ 10, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x93() {
  Assert_real((isspace(147) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              740, ("isspace should be 0 for 0x93"));
}


x86 assembly (clang, -O0):
<t_isspace_0x93>:
push   %rbp
mov    %rsp,%rbp
mov    $0x93,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2e4,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x93\00"
define void @t_isspace_0x93() {
%1 = call i64 @isspace(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x93\00"
define void @t_isspace_0x93() {
%1 = tail call i64 @isspace(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
long get_num(char *, char *);
char *long2str(char *, long);
long tt_deleteTable(int);
char *macttDelete(char *arg) {
  long tmp = get_num("ttDelete", arg);
  tmp = tt_deleteTable((int)tmp);
  return long2str(arg, tmp);
}


x86 assembly (clang, -O0):
<macttDelete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <tt_deleteTable@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <long2str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttDelete>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %eax,%edi
call   1040 <tt_deleteTable@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1050 <long2str@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ttDelete\00"
define i8* @macttDelete(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @get_num(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = call i64 @tt_deleteTable(i32 %7)
store i64 %8, i64* %3
%9 = load i8*, i8** %2
%10 = load i64, i64* %3
%11 = call i8* @long2str(i8* %9, i64 %10)
ret i8* %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"ttDelete\00"
define i8* @macttDelete(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = trunc i64 %2 to i32
%4 = tail call i64 @tt_deleteTable(i32 %3)
%5 = tail call i8* @long2str(i8* %0, i64 %4)
ret i8* %5
}
void drv_base_init_vbar() {}


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

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

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

LLVM IR (-O2):
define void @drv_base_init_vbar() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned long);
void mov_reg32_preg32(unsigned long reg1, unsigned long reg2) {
  put8(0x8B);
  put8((reg1 << 3) | reg2);
}


x86 assembly (clang, -O0):
<mov_reg32_preg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
shl    $0x3,%rdi
or     -0x10(%rbp),%rdi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg32_preg32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x8b,%edi
call   1030 <put8@plt>
shl    $0x3,%rbx
or     %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_reg32_preg32(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 @put8(i64 139)
%6 = load i64, i64* %3
%7 = shl i64 %6, 3
%8 = load i64, i64* %4
%9 = or i64 %7, %8
%10 = call i32 @put8(i64 %9)
ret void
}

LLVM IR (-O2):
define void @mov_reg32_preg32(i64 %0, i64 %1) {
%3 = tail call i32 @put8(i64 139)
%4 = shl i64 %0, 3
%5 = or i64 %4, %1
%6 = tail call i32 @put8(i64 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int closedir(int /*<<< orphan*/ *);
int outside_closedir(DIR *dir) { return closedir(dir); }


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

x86 assembly (clang, -O2):
<outside_closedir>:
jmp    1030 <closedir@plt>

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

LLVM IR (-O2):
define i32 @outside_closedir(i32* nocapture %0) {
%2 = tail call i32 @closedir(i32* %0)
ret i32 %2
}
/* Variables and functions */
int dag_stop_stream(int, int /*<<< orphan*/);
int dag_stop(int dagfd) { return dag_stop_stream(dagfd, 0); }


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

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

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

LLVM IR (-O2):
define i32 @dag_stop(i32 %0) {
%2 = tail call i32 @dag_stop_stream(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void clearLine() { printf("\r%.80s", ""); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\0D%.80s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @clearLine() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0D%.80s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @clearLine() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void handle_55(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_55(i32 %0) {
ret void
}
void ScaleRowDown2Box_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown2Box_NEON() {
ret void
}
void INT_Excep_RSPI1_SPTI1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RSPI1_SPTI1() {
ret void
}
void DLLTest() {}


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

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

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

LLVM IR (-O2):
define void @DLLTest() {
ret void
}
const char *ghw_get_dir(int is_downto) { return is_downto ? "downto" : "to"; }


x86 assembly (clang, -O0):
<ghw_get_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xef3(%rip),%rax
lea    0xee8(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ghw_get_dir>:
test   %edi,%edi
lea    0xefb(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"downto\00"
@.str.1 = [3 x i8] c"to\00"
define i8* @ghw_get_dir(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 i64
%6 = select i1 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
ret i8* %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"downto\00"
@.str.1 = [3 x i8] c"to\00"
define i8* @ghw_get_dir(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct ev_loop {
  int dummy;
};

/* Variables and functions */
unsigned int ev_depth(struct ev_loop *);
unsigned int __attribute__((unused)) ev_loop_depth(struct ev_loop *loop) {
  return ev_depth(loop);
}


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

x86 assembly (clang, -O2):
<ev_loop_depth>:
jmp    1030 <ev_depth@plt>

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

LLVM IR (-O2):
%struct.ev_loop = type { i32 }
define i32 @ev_loop_depth(%struct.ev_loop* %0) {
%2 = tail call i32 @ev_depth(%struct.ev_loop* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ _jwObj(char *);
int /*<<< orphan*/ jwPutraw(char *);
void jwObj_raw(char *key, char *rawtext) {
  if (_jwObj(key) == 0)
    jwPutraw(rawtext);
}


x86 assembly (clang, -O0):
<jwObj_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <_jwObj@plt>
cmp    $0x0,%rax
jne    114c <jwObj_raw+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <jwPutraw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jwObj_raw>:
push   %rbx
mov    %rsi,%rbx
call   1040 <_jwObj@plt>
test   %rax,%rax
je     1130 <jwObj_raw+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <jwPutraw@plt>

LLVM IR (-O0):
define void @jwObj_raw(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 = call i64 @_jwObj(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i32 @jwPutraw(i8* %9)
br label %11
11: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
define void @jwObj_raw(i8* %0, i8* %1) {
%3 = tail call i64 @_jwObj(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @jwPutraw(i8* %1)
br label %7
7: ; preds = %5, %2
ret void
}
void _watchdog() { printf("Exception: %s\n", __FUNCTION__); }


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

x86 assembly (clang, -O2):
<_watchdog>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._watchdog = [10 x i8] c"_watchdog\00"
define void @_watchdog() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__._watchdog, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ASN1_put_eoc(unsigned char **pp) {
  unsigned char *p = *pp;
  *p++ = 0;
  *p++ = 0;
  *pp = p;
  return 2;
}


x86 assembly (clang, -O0):
<ASN1_put_eoc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_put_eoc>:
mov    (%rdi),%rax
movw   $0x0,(%rax)
add    $0x2,%rax
mov    %rax,(%rdi)
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @ASN1_put_eoc(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 0, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 2
store i8 0, i8* %3
store i8* %4, i8** %0
ret i32 2
}
unsigned xrop3_41_1_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;
  unsigned stk4;
  stk4 = T & S;
  stk3 = D | stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_41_1_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    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_41_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%edx
shl    $0x8,%edx
lea    (%rsi,%rdx,1),%eax
and    %ecx,%edx
or     %edi,%ecx
or     $0xff,%edx
xor    %ecx,%eax
xor    %edx,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_41_1_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
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = and i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %5
%28 = load i32, i32* %11
%29 = or i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %6
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
%37 = xor i32 %36, -1
store i32 %37, i32* %8
%38 = load i32, i32* %8
%39 = load i32, i32* %6
%40 = xor i32 %39, -1
%41 = and i32 %38, %40
%42 = load i32, i32* %5
%43 = load i32, i32* %6
%44 = and i32 %42, %43
%45 = or i32 %41, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_41_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = and i32 %7, %4
%10 = or i32 %9, 255
%11 = xor i32 %8, %5
%12 = xor i32 %11, %10
%13 = or i32 %12, %5
%14 = xor i32 %13, -1
%15 = or i32 %14, %3
ret i32 %15
}
void OPENSSL_isservice(void) {}


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

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

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

LLVM IR (-O2):
define void @OPENSSL_isservice() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RAND_seed(void const *, int);
void mongoc_rand_seed(const void *buf, int num) { RAND_seed(buf, num); }


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

x86 assembly (clang, -O2):
<mongoc_rand_seed>:
jmp    1030 <RAND_seed@plt>

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

LLVM IR (-O2):
define void @mongoc_rand_seed(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_seed(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void int_range(void) {
  unsigned int max = -1;
  signed int min = (max - 1) / 2 + 1;
  printf("\tint:\n");
  printf("\t\tSigned minimum = %d\n", min);
  printf("\t\tUnsigned maximum = %u\n", max);
}


x86 assembly (clang, -O0):
<int_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
shr    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_range>:
push   %rax
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x80000000,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\09int:\0A\00"
@.str.1 = [23 x i8] c"\09\09Signed minimum = %d\0A\00"
@.str.2 = [25 x i8] c"\09\09Unsigned maximum = %u\0A\00"
define void @int_range() {
%1 = alloca i32
%2 = alloca i32
store i32 -1, i32* %1
%3 = load i32, i32* %1
%4 = sub i32 %3, 1
%5 = udiv i32 %4, 2
%6 = add i32 %5, 1
store i32 %6, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"\09\09Signed minimum = %d\0A\00"
@.str.2 = [25 x i8] c"\09\09Unsigned maximum = %u\0A\00"
@str = [6 x i8] c"\09int:\00"
define void @int_range() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 -2147483648)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 -1)
ret void
}
/* Variables and functions */
int gpi_exif_get_lilend(char *, int);
int gpi_tagnum(char *data, int tagind) {
  return (gpi_exif_get_lilend(data + tagind * 12 + 2, 2));
}


x86 assembly (clang, -O0):
<gpi_tagnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0xc,-0xc(%rbp),%eax
cltq
add    %rax,%rdi
add    $0x2,%rdi
mov    $0x2,%esi
call   1030 <gpi_exif_get_lilend@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpi_tagnum>:
shl    $0x2,%esi
lea    (%rsi,%rsi,2),%eax
cltq
add    %rax,%rdi
add    $0x2,%rdi
mov    $0x2,%esi
jmp    1030 <gpi_exif_get_lilend@plt>

LLVM IR (-O0):
define i32 @gpi_tagnum(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 12
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = call i32 @gpi_exif_get_lilend(i8* %10, i32 2)
ret i32 %11
}

LLVM IR (-O2):
define i32 @gpi_tagnum(i8* %0, i32 %1) {
%3 = mul nsw i32 %1, 12
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = tail call i32 @gpi_exif_get_lilend(i8* %6, i32 2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ coloration(char *, char *);
int /*<<< orphan*/ systemePoints(int /*<<< orphan*/, int /*<<< orphan*/, int);
void defaiteMastermindSolo(int modeDeJeux) {
  coloration("Dommage ! Vous avez perdu.\n", "31");
  systemePoints(0, 0, modeDeJeux);
}


x86 assembly (clang, -O0):
<defaiteMastermindSolo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <coloration@plt>
mov    -0x4(%rbp),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <systemePoints@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaiteMastermindSolo>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <coloration@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <systemePoints@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Dommage ! Vous avez perdu.\0A\00"
@.str.1 = [3 x i8] c"31\00"
define void @defaiteMastermindSolo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @coloration(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @systemePoints(i32 0, i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Dommage ! Vous avez perdu.\0A\00"
@.str.1 = [3 x i8] c"31\00"
define void @defaiteMastermindSolo(i32 %0) {
%2 = tail call i32 @coloration(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @systemePoints(i32 0, i32 0, i32 %0)
ret void
}
int test_imm_5Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x5C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Cint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x5c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Cint64_highword_reg>:
movabs $0x5c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Cint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 92
%6 = icmp ne i64 %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_5Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 395136991232
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
void xfree(void *memory) {
  assert(memory != NULL);
  if (memory != NULL) {
    free(memory);
    memory = NULL;
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
je     115a <xfree+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
test   %rbx,%rbx
je     1140 <xfree+0x20>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @xfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
store i8* null, i8** %2
br label %12
12: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br i1 %2, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @free(i8* %0)
br label %7
7: ; preds = %5, %1
ret void
}
int sum(int x, int y) { return x + y + 100; }


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

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
add    $0x64,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1) {
%3 = add i32 %0, 100
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
double sqrt(double);
double pythagorean(double x, double y) { return sqrt((x * x) + (y * y)); }


x86 assembly (clang, -O0):
<pythagorean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pythagorean>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <pythagorean+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @pythagorean(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @pythagorean(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
int yas_l3g4200d_unlock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @yas_l3g4200d_unlock() {
ret i32 0
}
int cut_field(char *str) {
  int res = 0;
  for (; *str != '\t'; str++) {
    if (*str == '\0') {
      res = 1;
      break;
    }
  }
  *str = '\0';
  return res;
}


x86 assembly (clang, -O0):
<cut_field>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     1151 <cut_field+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113b <cut_field+0x3b>
movl   $0x1,-0xc(%rbp)
jmp    1151 <cut_field+0x51>
jmp    1140 <cut_field+0x40>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <cut_field+0xf>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cut_field>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <cut_field+0x11>
cmp    $0x9,%al
je     111a <cut_field+0x1a>
add    $0x1,%rdi
jmp    1100 <cut_field>
mov    $0x1,%eax
movb   $0x0,(%rdi)
ret
xor    %eax,%eax
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @cut_field(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 9, label %7
i8 0, label %8
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ 1, %2 ]
store i8 0, i8* %3
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void mtol_f(uint8_t *out, const float in) {
  uint8_t *fp = (uint8_t *)&in;
  out[0] = fp[0];
  out[1] = fp[1];
  out[2] = fp[2];
  out[3] = fp[3];
}


x86 assembly (clang, -O0):
<mtol_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtol_f>:
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @mtol_f(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
%5 = alloca i32*
store i32* %0, i32** %3
store float %1, float* %4
%6 = bitcast float* %4 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32*, i32** %5
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 %14, i32* %16
%17 = load i32*, i32** %5
%18 = getelementptr inbounds i32, i32* %17, i64 2
%19 = load i32, i32* %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
store i32 %19, i32* %21
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 3
%24 = load i32, i32* %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 3
store i32 %24, i32* %26
ret void
}

LLVM IR (-O2):
define void @mtol_f(i32* nocapture writeonly %0, float %1) {
%3 = bitcast i32* %0 to float*
store float %1, float* %3
ret void
}
/* Type definitions */
struct MIDIPort {
  int dummy;
};

/* Variables and functions */
int MIDIPortDisconnect(struct MIDIPort *, struct MIDIPort *);
int _port_apply_disconnect(void *item, void *info) {
  struct MIDIPort *port = item;
  struct MIDIPort *source = info;
  return MIDIPortDisconnect(source, port);
}


x86 assembly (clang, -O0):
<_port_apply_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
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    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <MIDIPortDisconnect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_port_apply_disconnect>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <MIDIPortDisconnect@plt>

LLVM IR (-O0):
%struct.MIDIPort = type { i32 }
define i32 @_port_apply_disconnect(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.MIDIPort*
%6 = alloca %struct.MIDIPort*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.MIDIPort*
store %struct.MIDIPort* %8, %struct.MIDIPort** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.MIDIPort*
store %struct.MIDIPort* %10, %struct.MIDIPort** %6
%11 = load %struct.MIDIPort*, %struct.MIDIPort** %6
%12 = load %struct.MIDIPort*, %struct.MIDIPort** %5
%13 = call i32 @MIDIPortDisconnect(%struct.MIDIPort* %11, %struct.MIDIPort* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.MIDIPort = type { i32 }
define i32 @_port_apply_disconnect(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.MIDIPort*
%4 = bitcast i8* %1 to %struct.MIDIPort*
%5 = tail call i32 @MIDIPortDisconnect(%struct.MIDIPort* %4, %struct.MIDIPort* %3)
ret i32 %5
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int sancus_time_is_zero(const struct timespec *a) {
  return (a->tv_sec == 0) && (a->tv_nsec == 0);
}


x86 assembly (clang, -O0):
<sancus_time_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
mov    %al,-0x9(%rbp)
jne    112a <sancus_time_is_zero+0x2a>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x8(%rax)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_time_is_zero>:
xor    %eax,%eax
cmpq   $0x0,(%rdi)
je     1109 <sancus_time_is_zero+0x9>
ret
xor    %eax,%eax
cmpq   $0x0,0x8(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @sancus_time_is_zero(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @sancus_time_is_zero(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage:\n");
  printf("linkdump <.html file> <.txt file>\n");
  printf("Make sure these files really exists\n");
}


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

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef9(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [35 x i8] c"linkdump <.html file> <.txt file>\0A\00"
@.str.2 = [37 x i8] c"Make sure these files really exists\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.3 = [34 x i8] c"linkdump <.html file> <.txt file>\00"
@str.4 = [36 x i8] c"Make sure these files really exists\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
main() {
  if (strcmp("s", "foo") == 0)
    printf("-DOldStrs");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <main+0x38>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed4(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1155 <main+0x25>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"s\00"
@.str.1 = [4 x i8] c"foo\00"
@.str.2 = [10 x i8] c"-DOldStrs\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"s\00"
@.str.1 = [4 x i8] c"foo\00"
@.str.2 = [10 x i8] c"-DOldStrs\00"
define i32 @main() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ benchmark();
int /*<<< orphan*/ initialise_board();
int /*<<< orphan*/ start_trigger();
int /*<<< orphan*/ stop_trigger();
main(void) {
  int i;
  initialise_board();
  start_trigger();
  for (i = 0; i < (4096 >> 0); i++)
    benchmark();
  stop_trigger();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <initialise_board@plt>
mov    $0x0,%al
call   1030 <start_trigger@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1000,-0x8(%rbp)
jge    1186 <main+0x46>
mov    $0x0,%al
call   1050 <benchmark@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1040 <stop_trigger@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <initialise_board@plt>
xor    %eax,%eax
call   1030 <start_trigger@plt>
mov    $0x1000,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <benchmark@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
call   1040 <stop_trigger@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialise_board()
%2 = tail call i32 (...) @start_trigger()
br label %3
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %6, %3 ]
%5 = tail call i32 (...) @benchmark()
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 4096
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 (...) @stop_trigger()
ret i32 0
}