xunge/DecIR huggingface dataset:
g(int x) {
  short buf[x];
  return sizeof(long[x + 1]) + sizeof buf;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
shl    $0x1,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    (%rdi,%rdi,4),%eax
add    %eax,%eax
add    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i16, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = mul nuw i64 8, %11
%13 = mul nuw i64 2, %6
%14 = add i64 %12, %13
%15 = trunc i64 %14 to i32
%16 = load i8*, i8** %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = mul i32 %0, 10
%3 = add i32 %2, 8
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: pamei label command [args ..]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Usage: pamei label command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [38 x i8] c"Usage: pamei label command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
const char *pig_get_name() { return "i am pig"; }


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

x86 assembly (clang, -O2):
<pig_get_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"i am pig\00"
define i8* @pig_get_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"i am pig\00"
define i8* @pig_get_name() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
unsigned int f7(unsigned int x, int y) { return x & ((1 << y) - 1); }


x86 assembly (clang, -O0):
<f7>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f7>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f7(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 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f7(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ test_sockopt_value_ext(char *, int, void *,
                                          int /*<<< orphan*/, void *,
                                          int /*<<< orphan*/);
void test_sockopt_value(char *test_name, int optname, void *optval,
                        socklen_t optlen) {
  test_sockopt_value_ext(test_name, optname, optval, optlen, optval, optlen);
}


x86 assembly (clang, -O0):
<test_sockopt_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
call   1030 <test_sockopt_value_ext@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sockopt_value>:
mov    %rdx,%r8
mov    %ecx,%r9d
jmp    1030 <test_sockopt_value_ext@plt>

LLVM IR (-O0):
define void @test_sockopt_value(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @test_sockopt_value_ext(i8* %9, i32 %10, i8* %11, i32 %12, i8* %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @test_sockopt_value(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @test_sockopt_value_ext(i8* %0, i32 %1, i8* %2, i32 %3, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close_serial_port();
int /*<<< orphan*/ sci_init(int /*<<< orphan*/);
void sci_clear(void) {
  close_serial_port();
  sci_init(0);
}


x86 assembly (clang, -O0):
<sci_clear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <close_serial_port@plt>
xor    %edi,%edi
call   1030 <sci_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sci_clear>:
push   %rax
xor    %eax,%eax
call   1040 <close_serial_port@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <sci_init@plt>

LLVM IR (-O0):
define void @sci_clear() {
%1 = call i32 (...) @close_serial_port()
%2 = call i32 @sci_init(i32 0)
ret void
}

LLVM IR (-O2):
define void @sci_clear() {
%1 = tail call i32 (...) @close_serial_port()
%2 = tail call i32 @sci_init(i32 0)
ret void
}
unsigned char __atomic_exchange_1(volatile void *atom, unsigned char value,
                                  int memorder) {
  unsigned char xchg;
  unsigned char cmp;
  __atomic_load((unsigned char *)atom, (unsigned char *)&cmp, 0);
  do {
    xchg = (value);
  } while (
      !__atomic_compare_exchange((unsigned char *)atom, &cmp, &xchg, 1, 5, 5));
  return cmp;
}


x86 assembly (clang, -O0):
<__atomic_exchange_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x12(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x12(%rbp),%al
mov    -0x11(%rbp),%dl
lock cmpxchg %dl,(%rcx)
mov    %al,%cl
sete   %al
mov    %al,-0x15(%rbp)
mov    %cl,-0x14(%rbp)
test   $0x1,%al
jne    1147 <__atomic_exchange_1+0x47>
mov    -0x14(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    111a <__atomic_exchange_1+0x1a>
movzbl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__atomic_exchange_1>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
lock cmpxchg %sil,(%rdi)
jne    1110 <__atomic_exchange_1+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @__atomic_exchange_1(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load atomic i8, i8* %10 monotonic
store i8 %11, i8* %8
br label %12
12: ; preds = %22, %3
%13 = load i8, i8* %5
store i8 %13, i8* %7
br label %14
14: ; preds = %12
%15 = load i8*, i8** %4
%16 = load i8, i8* %8
%17 = load i8, i8* %7
%18 = cmpxchg weak i8* %15, i8 %16, i8 %17 seq_cst seq_cst
%19 = extractvalue { i8, i1 } %18, 0
%20 = extractvalue { i8, i1 } %18, 1
br i1 %20, label %22, label %21
21: ; preds = %14
store i8 %19, i8* %8
br label %22
22: ; preds = %21, %14
%23 = zext i1 %20 to i8
store i8 %23, i8* %9
%24 = load i8, i8* %9
%25 = trunc i8 %24 to i1
%26 = xor i1 %25, true
br i1 %26, label %12, label %27
27: ; preds = %22
%28 = load i8, i8* %8
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @__atomic_exchange_1(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = load atomic i8, i8* %0 monotonic
br label %5
5: ; preds = %5, %3
%6 = phi i8 [ %4, %3 ], [ %9, %5 ]
%7 = cmpxchg weak i8* %0, i8 %6, i8 %1 seq_cst seq_cst
%8 = extractvalue { i8, i1 } %7, 1
%9 = extractvalue { i8, i1 } %7, 0
br i1 %8, label %10, label %5
10: ; preds = %5
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int /*<<< orphan*/);
void TOSH_MAKE_YELLOW_LED_INPUT() { clear_io_bit(0x36, 0); }


x86 assembly (clang, -O0):
<TOSH_MAKE_YELLOW_LED_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x36,%edi
xor    %esi,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_YELLOW_LED_INPUT>:
mov    $0x36,%edi
xor    %esi,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_YELLOW_LED_INPUT() {
%1 = call i32 @clear_io_bit(i32 54, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_YELLOW_LED_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 54, i32 0)
ret void
}
/* Type definitions */
struct struct_automata {
  int dummy;
};

/* Variables and functions */
int *_func_in_cond_stat(struct struct_automata *, int *, int);
int *func_in_cond_stat(struct struct_automata *p, int *stat_p, int mode) {
  return _func_in_cond_stat(p, stat_p, mode);
}


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

x86 assembly (clang, -O2):
<func_in_cond_stat>:
jmp    1030 <_func_in_cond_stat@plt>

LLVM IR (-O0):
%struct.struct_automata = type { i32 }
define i32* @func_in_cond_stat(%struct.struct_automata* %0, i32* %1, i32 %2) {
%4 = alloca %struct.struct_automata*
%5 = alloca i32*
%6 = alloca i32
store %struct.struct_automata* %0, %struct.struct_automata** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load %struct.struct_automata*, %struct.struct_automata** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = call i32* @_func_in_cond_stat(%struct.struct_automata* %7, i32* %8, i32 %9)
ret i32* %10
}

LLVM IR (-O2):
%struct.struct_automata = type { i32 }
define i32* @func_in_cond_stat(%struct.struct_automata* %0, i32* %1, i32 %2) {
%4 = tail call i32* @_func_in_cond_stat(%struct.struct_automata* %0, i32* %1, i32 %2)
ret i32* %4
}
int axp_set_pekoffen(int pek) {
  int ret = 0;
  return ret;
}


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

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

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

LLVM IR (-O2):
define i32 @axp_set_pekoffen(i32 %0) {
ret i32 0
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = input[0UL] + 0xffffffffff660b45UL;
    local1 = 0UL;
    while (local1 < 0UL) {
      state[local1] += state[local1];
      local1 += 2UL;
    }
    local1 = 0UL;
    while (local1 < 0UL) {
      local1++;
    }
    output[0UL] = state[0UL] + 316086328UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffff660b45,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rcx
mov    -0x20(%rbp),%rax
add    -0x18(%rbp,%rax,8),%rcx
mov    %rcx,-0x18(%rbp,%rax,8)
mov    -0x20(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
jmp    1125 <RandomFunc+0x25>
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jae    117c <RandomFunc+0x7c>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1160 <RandomFunc+0x60>
mov    -0x18(%rbp),%rcx
add    $0x12d71838,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0x123d237d,%eax
add    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
%6 = alloca i64
store i64* %0, i64** %3
store i64* %1, i64** %4
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = add i64 %9, -10089659
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
store i64 0, i64* %6
br label %12
12: ; preds = %15, %2
%13 = load i64, i64* %6
%14 = icmp ult i64 %13, 0
br i1 %14, label %15, label %25
15: ; preds = %12
%16 = load i64, i64* %6
%17 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = load i64, i64* %6
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = add i64 %21, %18
store i64 %22, i64* %20
%23 = load i64, i64* %6
%24 = add i64 %23, 2
store i64 %24, i64* %6
br label %12
25: ; preds = %12
store i64 0, i64* %6
br label %26
26: ; preds = %29, %25
%27 = load i64, i64* %6
%28 = icmp ult i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = load i64, i64* %6
%31 = add i64 %30, 1
store i64 %31, i64* %6
br label %26
32: ; preds = %26
%33 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%34 = load i64, i64* %33
%35 = add i64 %34, 316086328
%36 = load i64*, i64** %4
%37 = getelementptr inbounds i64, i64* %36, i64 0
store i64 %35, i64* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = add i64 %3, 305996669
store i64 %4, i64* %1
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int clock_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
clock_t times(struct tms *buf) {
  errno = EINVAL;
  return (-1);
}


x86 assembly (clang, -O0):
<times>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec8(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<times>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @times(%struct.tms* %0) {
%2 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %2
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @times(%struct.tms* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int ls_cost_nm9_f0(double const **, double **, int *, double *, int);
int ls_cost_nm9(const double **arg, double **res, int *iw, double *w, int mem) {
  return ls_cost_nm9_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<ls_cost_nm9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <ls_cost_nm9_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm9>:
jmp    1030 <ls_cost_nm9_f0@plt>

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

LLVM IR (-O2):
define i32 @ls_cost_nm9(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_cost_nm9_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int syscall(int, int);
int my_epoll_create(int size) { return syscall(254, size); }


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

x86 assembly (clang, -O2):
<my_epoll_create>:
mov    %edi,%esi
mov    $0xfe,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @my_epoll_create(i32 %0) {
%2 = tail call i32 @syscall(i32 254, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ test_bfpp_comment();
int /*<<< orphan*/ test_bfpp_comment_entities();
void all_bfpp_tests() {
  test_bfpp_comment();
  test_bfpp_comment_entities();
}


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

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

LLVM IR (-O0):
define void @all_bfpp_tests() {
%1 = call i32 (...) @test_bfpp_comment()
%2 = call i32 (...) @test_bfpp_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_bfpp_tests() {
%1 = tail call i32 (...) @test_bfpp_comment()
%2 = tail call i32 (...) @test_bfpp_comment_entities()
ret void
}
char *langRomTypeSuperPierrot() { return "Super Pierrot"; }


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

x86 assembly (clang, -O2):
<langRomTypeSuperPierrot>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Super Pierrot\00"
define i8* @langRomTypeSuperPierrot() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"Super Pierrot\00"
define i8* @langRomTypeSuperPierrot() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x3a() {
  Assert_real((isascii(58)),
              "/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_isascii.c",
              295, ("isascii should be 1 for :"));
}


x86 assembly (clang, -O0):
<t_isascii_0x3a>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3a,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x127,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x3a>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x127,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for :\00"
define void @t_isascii_0x3a() {
%1 = call i32 @isascii(i32 58)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for :\00"
define void @t_isascii_0x3a() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 295, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void watchdog_reboot(void) {}


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

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

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

LLVM IR (-O2):
define void @watchdog_reboot() {
ret void
}
/* Variables and functions */
scalar_t__ FileProxy_AccessFile(char *);
int remove(char *);
int FileProxy_RemoveFile(char *filename) {
  int ret = 1;
  if (0 == FileProxy_AccessFile(filename)) {
    ret = remove(filename);
  }
  return (ret);
}


x86 assembly (clang, -O0):
<FileProxy_RemoveFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <FileProxy_AccessFile@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1156 <FileProxy_RemoveFile+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileProxy_RemoveFile>:
push   %rbx
mov    %rdi,%rbx
call   1040 <FileProxy_AccessFile@plt>
test   %rax,%rax
je     1135 <FileProxy_RemoveFile+0x15>
mov    $0x1,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <remove@plt>

LLVM IR (-O0):
define i32 @FileProxy_RemoveFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @FileProxy_AccessFile(i8* %4)
%6 = icmp eq i64 0, %5
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @remove(i8* %8)
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @FileProxy_RemoveFile(i8* %0) {
%2 = tail call i64 @FileProxy_AccessFile(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @remove(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = phi i32 [ %5, %4 ], [ 1, %1 ]
ret i32 %7
}
void RGBAToYJRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @RGBAToYJRow_Any_SSSE3() {
ret void
}
int compare(const void *a, const void *b) {
  int wa = ((const int *)a)[0];
  int wb = ((const int *)b)[0];
  int ha = ((const int *)a)[1];
  int hb = ((const int *)b)[1];
  return wa == wb ? hb - ha : wa - wb;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    114c <compare+0x4c>
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1155 <compare+0x55>
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
sub    (%rsi),%eax
jne    110c <compare+0xc>
mov    0x4(%rsi),%eax
sub    0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %1, i64 4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = getelementptr inbounds i8, i8* %0, i64 4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = sub nsw i32 %11, %14
br label %18
16: ; preds = %2
%17 = sub nsw i32 %4, %6
br label %18
18: ; preds = %16, %8
%19 = phi i32 [ %15, %8 ], [ %17, %16 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ backwords();
int /*<<< orphan*/ printf(char *);
int main() {
  backwords();
  printf("\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <backwords@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @backwords()
%2 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
struct tval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tval *);
void destroy_tval(struct tval *t) { free(t); }


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

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

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

LLVM IR (-O2):
%struct.tval = type { i32 }
define void @destroy_tval(%struct.tval* nocapture %0) {
%2 = tail call i32 @free(%struct.tval* %0)
ret void
}
int test_imm_F2int8_reg(signed char val) {
  return ((val) & (-0xF2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F2int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff0e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F2int8_reg>:
test   $0xffffff0e,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F2int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -242
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ n32016_reset_addr(int);
void n32016_reset() { n32016_reset_addr(0xF00000); }


x86 assembly (clang, -O0):
<n32016_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf00000,%edi
call   1030 <n32016_reset_addr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<n32016_reset>:
mov    $0xf00000,%edi
jmp    1030 <n32016_reset_addr@plt>

LLVM IR (-O0):
define void @n32016_reset() {
%1 = call i32 @n32016_reset_addr(i32 15728640)
ret void
}

LLVM IR (-O2):
define void @n32016_reset() {
%1 = tail call i32 @n32016_reset_addr(i32 15728640)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SDCard_DisableRxInt();
int /*<<< orphan*/ SDCard_DisableTxInt();
void SDCard_DisableInt(void) {
  SDCard_DisableTxInt();
  SDCard_DisableRxInt();
}


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

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

LLVM IR (-O0):
define void @SDCard_DisableInt() {
%1 = call i32 (...) @SDCard_DisableTxInt()
%2 = call i32 (...) @SDCard_DisableRxInt()
ret void
}

LLVM IR (-O2):
define void @SDCard_DisableInt() {
%1 = tail call i32 (...) @SDCard_DisableTxInt()
%2 = tail call i32 (...) @SDCard_DisableRxInt()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_rt_sigqueueinfo;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int, int /*<<< orphan*/ *);
int sys_rt_sigqueueinfo(pid_t tgid, int sig, siginfo_t *uinfo) {
  return syscall(SYS_rt_sigqueueinfo, tgid, sig, uinfo);
}


x86 assembly (clang, -O0):
<sys_rt_sigqueueinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_rt_sigqueueinfo>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_rt_sigqueueinfo = global i32 0
define i32 @sys_rt_sigqueueinfo(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* @SYS_rt_sigqueueinfo
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = call i32 @syscall(i32 %7, i32 %8, i32 %9, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
@SYS_rt_sigqueueinfo = global i32 0
define i32 @sys_rt_sigqueueinfo(i32 %0, i32 %1, i32* %2) {
%4 = load i32, i32* @SYS_rt_sigqueueinfo
%5 = tail call i32 @syscall(i32 %4, i32 %0, i32 %1, i32* %2)
ret i32 %5
}
/* Variables and functions */
void *malloc(size_t);
void *mem_alloc(void *data, size_t size) {
  (void)data;
  return malloc(size);
}


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

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

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

LLVM IR (-O2):
define noalias i8* @mem_alloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ f(int, float *);
void g(int c, float *d) { f(c, d); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @g(i32 %0, float* %1) {
%3 = tail call i32 @f(i32 %0, float* %1)
ret void
}
unsigned f(unsigned i) { return (3 / i ? i + 1 : i); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x3,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
cmp    $0x0,%eax
je     1128 <f+0x28>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <f+0x2e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
cmp    $0x4,%edi
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 3, %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = add i32 %7, 1
br label %11
9: ; preds = %1
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %6
%12 = phi i32 [ %8, %6 ], [ %10, %9 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ult i32 %0, 4
%3 = zext i1 %2 to i32
%4 = add i32 %3, %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ drand48();
double log(scalar_t__);
double poisson_wait(double interval) {
  return interval * -log(1.0 - drand48());
}


x86 assembly (clang, -O0):
<poisson_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <drand48@plt>
cvtsi2sd %rax,%xmm1
movsd  0xeb5(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poisson_wait>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <drand48@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xec3(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
call   1030 <log@plt>
xorpd  0xebd(%rip),%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @poisson_wait(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 (...) @drand48()
%5 = sitofp i64 %4 to double
%6 = fsub double 1.000000e+00, %5
%7 = fptosi double %6 to i64
%8 = call double @log(i64 %7)
%9 = fneg double %8
%10 = fmul double %3, %9
ret double %10
}

LLVM IR (-O2):
define double @poisson_wait(double %0) {
%2 = tail call i64 (...) @drand48()
%3 = sitofp i64 %2 to double
%4 = fsub double 1.000000e+00, %3
%5 = fptosi double %4 to i64
%6 = tail call double @log(i64 %5)
%7 = fneg double %6
%8 = fmul double %7, %0
ret double %8
}
extern void pcibios_penalize_isa_irq(int irq, int active) {}


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

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

LLVM IR (-O0):
define void @pcibios_penalize_isa_irq(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @pcibios_penalize_isa_irq(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addrfam(int const);
int /*<<< orphan*/ addrip(int const, struct sockaddr const *const);
int /*<<< orphan*/ addrlen(int const);
int /*<<< orphan*/ warnx(char *, char const *const, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void sa_pmsg(const char *const prefix, const int fam,
             const struct sockaddr *const sa) {
  warnx("%s: %s %.*s", prefix, addrfam(fam), addrlen(fam), addrip(fam, sa));
}


x86 assembly (clang, -O0):
<sa_pmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <addrfam@plt>
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <addrlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <addrip@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    %eax,%r8d
lea    0xe6f(%rip),%rdi
call   1050 <warnx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sa_pmsg>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r12
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1060 <addrfam@plt>
mov    %eax,%r15d
mov    %ebp,%edi
call   1030 <addrlen@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r12,%rsi
call   1040 <addrip@plt>
lea    0xe8c(%rip),%rdi
mov    %r14,%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <warnx@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"%s: %s %.*s\00"
define void @sa_pmsg(i8* %0, i32 %1, %struct.sockaddr* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.sockaddr*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.sockaddr* %2, %struct.sockaddr** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = call i32 @addrfam(i32 %8)
%10 = load i32, i32* %5
%11 = call i32 @addrlen(i32 %10)
%12 = load i32, i32* %5
%13 = load %struct.sockaddr*, %struct.sockaddr** %6
%14 = call i32 @addrip(i32 %12, %struct.sockaddr* %13)
%15 = call i32 @warnx(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9, i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"%s: %s %.*s\00"
define void @sa_pmsg(i8* %0, i32 %1, %struct.sockaddr* %2) {
%4 = tail call i32 @addrfam(i32 %1)
%5 = tail call i32 @addrlen(i32 %1)
%6 = tail call i32 @addrip(i32 %1, %struct.sockaddr* %2)
%7 = tail call i32 @warnx(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %5, i32 %6)
ret void
}
int iemgui_clip_font(int size) {
  if (size < 4)
    size = 4;
  return (size);
}


x86 assembly (clang, -O0):
<iemgui_clip_font>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1118 <iemgui_clip_font+0x18>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iemgui_clip_font>:
cmp    $0x5,%edi
mov    $0x4,%eax
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @iemgui_clip_font(i32 %0) {
%2 = icmp sgt i32 %0, 4
%3 = select i1 %2, i32 %0, i32 4
ret i32 %3
}
void null_metric(cd, disp) struct cell_display *cd;
struct display *disp;
{
}


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

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

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

LLVM IR (-O2):
%struct.cell_display = type opaque
%struct.display = type opaque
define void @null_metric(%struct.cell_display* nocapture %0, %struct.display* nocapture %1) {
ret void
}
/* Type definitions */
struct hostent {
  scalar_t__ *h_addr_list;
};

/* Variables and functions */
int /*<<< orphan*/ bcopy(char *, char *, int);
scalar_t__ malloc(int);
struct hostent *proxy_gethostbyname(char *);
unsigned int *get_address(char *hostname) {
  struct hostent *hp;
  unsigned int *sin = NULL;
  if ((hp = proxy_gethostbyname(hostname))) {
    sin = (unsigned int *)malloc(sizeof(unsigned int));
    bcopy((char *)(*(hp->h_addr_list)), (char *)sin, sizeof(hp->h_addr_list));
  }
  return sin;
}


x86 assembly (clang, -O0):
<get_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <proxy_gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1181 <get_address+0x51>
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <bcopy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_address>:
push   %rbx
call   1040 <proxy_gethostbyname@plt>
test   %rax,%rax
je     1146 <get_address+0x26>
mov    %rax,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    (%rbx),%rcx
mov    (%rcx),%rcx
mov    (%rcx),%rcx
mov    %rcx,(%rax)
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hostent = type { i64* }
define i32* @get_address(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
%4 = alloca i32*
store i8* %0, i8** %2
store i32* null, i32** %4
%5 = load i8*, i8** %2
%6 = call %struct.hostent* @proxy_gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %3
%7 = icmp ne %struct.hostent* %6, null
br i1 %7, label %8, label %19
8: ; preds = %1
%9 = call i64 @malloc(i32 4)
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %4
%11 = load %struct.hostent*, %struct.hostent** %3
%12 = getelementptr inbounds %struct.hostent, %struct.hostent* %11, i32 0, i32 0
%13 = load i64*, i64** %12
%14 = load i64, i64* %13
%15 = inttoptr i64 %14 to i8*
%16 = load i32*, i32** %4
%17 = bitcast i32* %16 to i8*
%18 = call i32 @bcopy(i8* %15, i8* %17, i32 8)
br label %19
19: ; preds = %8, %1
%20 = load i32*, i32** %4
ret i32* %20
}

LLVM IR (-O2):
%struct.hostent = type { i64* }
define i32* @get_address(i8* %0) {
%2 = tail call %struct.hostent* @proxy_gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1
%5 = tail call i64 @malloc(i32 4)
%6 = inttoptr i64 %5 to i32*
%7 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%8 = load i64*, i64** %7
%9 = load i64, i64* %8
%10 = inttoptr i64 %9 to i64*
%11 = inttoptr i64 %5 to i64*
%12 = load i64, i64* %10
store i64 %12, i64* %11
br label %13
13: ; preds = %4, %1
%14 = phi i32* [ %6, %4 ], [ null, %1 ]
ret i32* %14
}
void make_empty() { int top = 0; }


x86 assembly (clang, -O0):
<make_empty>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @make_empty() {
ret void
}
int ccstrcmp(char *a, char *b) {
  int r;
  do {
    r = *a - *b;
    if (r != 0)
      break;
  } while (*(a++) != 0 && *(b++) != 0);
  return r;
}


x86 assembly (clang, -O0):
<ccstrcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     112e <ccstrcmp+0x2e>
jmp    1179 <ccstrcmp+0x79>
jmp    1133 <ccstrcmp+0x33>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
je     116e <ccstrcmp+0x6e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    110c <ccstrcmp+0xc>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccstrcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi,%rcx,1),%edx
movsbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    112d <ccstrcmp+0x2d>
test   %dl,%dl
je     112d <ccstrcmp+0x2d>
add    $0x1,%rcx
test   %r8b,%r8b
jne    1110 <ccstrcmp+0x10>
ret

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

LLVM IR (-O2):
define i32 @ccstrcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %15, %3 ]
%5 = phi i8* [ %0, %2 ], [ %14, %3 ]
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %7, %9
%11 = icmp ne i32 %10, 0
%12 = icmp eq i8 %6, 0
%13 = select i1 %11, i1 true, i1 %12
%14 = getelementptr inbounds i8, i8* %5, i64 1
%15 = getelementptr inbounds i8, i8* %4, i64 1
%16 = icmp eq i8 %8, 0
%17 = select i1 %13, i1 true, i1 %16
br i1 %17, label %18, label %3
18: ; preds = %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xcflMemoryFree(void *pBuffer) { free(pBuffer); }


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

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

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

LLVM IR (-O2):
define void @xcflMemoryFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *argv0) {
  printf(
      "Usage: %s [--coreid | -C COREID] [--row|-r ROW] [--col|-c COL] FILE\n",
      argv0);
}


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

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

LLVM IR (-O0):
@.str = [69 x i8] c"Usage: %s [--coreid | -C COREID] [--row|-r ROW] [--col|-c COL] FILE\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c"Usage: %s [--coreid | -C COREID] [--row|-r ROW] [--col|-c COL] FILE\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}