xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ find_prime(int, int);
int is_prime_number(int n) {
  if (n <= 1)
    return (0);
  if (!(n % 2))
    return (0);
  if (find_prime(n, 3))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_prime_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1131 <is_prime_number+0x21>
movl   $0x0,-0x4(%rbp)
jmp    117b <is_prime_number+0x6b>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1151 <is_prime_number+0x41>
movl   $0x0,-0x4(%rbp)
jmp    117b <is_prime_number+0x6b>
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1030 <find_prime@plt>
cmp    $0x0,%rax
je     1174 <is_prime_number+0x64>
movl   $0x1,-0x4(%rbp)
jmp    117b <is_prime_number+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime_number>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1138 <is_prime_number+0x28>
mov    %edi,%ecx
and    $0x1,%ecx
je     1138 <is_prime_number+0x28>
push   %rax
mov    $0x3,%esi
call   1030 <find_prime@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @is_prime_number(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 2
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %7
store i32 0, i32* %2
br label %18
12: ; preds = %7
%13 = load i32, i32* %3
%14 = call i64 @find_prime(i32 %13, i32 3)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %18
17: ; preds = %12
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16, %11, %6
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_prime_number(i32 %0) {
%2 = icmp slt i32 %0, 2
%3 = and i32 %0, 1
%4 = icmp eq i32 %3, 0
%5 = or i1 %2, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = tail call i64 @find_prime(i32 %0, i32 3)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %1
%11 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %11
}
void lgtd_lifx_gateway_handle_product_info(
    struct lgtd_lifx_gateway *gw, const struct lgtd_lifx_packet_header *hdr,
    const struct lgtd_lifx_packet_product_info *pkt) {
  (void)gw;
  (void)hdr;
  (void)pkt;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_product_info = type opaque
define void @lgtd_lifx_gateway_handle_product_info(%struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_product_info* %2) {
%4 = alloca %struct.lgtd_lifx_gateway*
%5 = alloca %struct.lgtd_lifx_packet_header*
%6 = alloca %struct.lgtd_lifx_packet_product_info*
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %4
store %struct.lgtd_lifx_packet_header* %1, %struct.lgtd_lifx_packet_header** %5
store %struct.lgtd_lifx_packet_product_info* %2, %struct.lgtd_lifx_packet_product_info** %6
%7 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %4
%8 = load %struct.lgtd_lifx_packet_header*, %struct.lgtd_lifx_packet_header** %5
%9 = load %struct.lgtd_lifx_packet_product_info*, %struct.lgtd_lifx_packet_product_info** %6
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
%struct.lgtd_lifx_packet_header = type opaque
%struct.lgtd_lifx_packet_product_info = type opaque
define void @lgtd_lifx_gateway_handle_product_info(%struct.lgtd_lifx_gateway* nocapture %0, %struct.lgtd_lifx_packet_header* nocapture %1, %struct.lgtd_lifx_packet_product_info* nocapture %2) {
ret void
}
/* Variables and functions */
int __rtl_fabs_v1_00(double);
int rtl_fabs(double a) { return __rtl_fabs_v1_00(a); }


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

x86 assembly (clang, -O2):
<rtl_fabs>:
jmp    1030 <__rtl_fabs_v1_00@plt>

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

LLVM IR (-O2):
define i32 @rtl_fabs(double %0) {
%2 = tail call i32 @__rtl_fabs_v1_00(double %0)
ret i32 %2
}
/* Variables and functions */
int lspcon_i2c_spi_write_register(int, int, int);
int lspcon_i2c_spi_reset_mpu_stop(int fd) {
  int ret = 0;
  ret |= lspcon_i2c_spi_write_register(fd, 0xbc, 0xc0);
  ret |= lspcon_i2c_spi_write_register(fd, 0xbc, 0x40);
  return ret;
}


x86 assembly (clang, -O0):
<lspcon_i2c_spi_reset_mpu_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xbc,%esi
mov    $0xc0,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xbc,%esi
mov    $0x40,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lspcon_i2c_spi_reset_mpu_stop>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xbc,%esi
mov    $0xc0,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0xbc,%esi
mov    $0x40,%edx
call   1030 <lspcon_i2c_spi_write_register@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lspcon_i2c_spi_reset_mpu_stop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @lspcon_i2c_spi_write_register(i32 %4, i32 188, i32 192)
%6 = load i32, i32* %3
%7 = or i32 %6, %5
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = call i32 @lspcon_i2c_spi_write_register(i32 %8, i32 188, i32 64)
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @lspcon_i2c_spi_reset_mpu_stop(i32 %0) {
%2 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 188, i32 192)
%3 = tail call i32 @lspcon_i2c_spi_write_register(i32 %0, i32 188, i32 64)
%4 = or i32 %3, %2
ret i32 %4
}
void bar(int *x) {
macro_label:
  *x = 5;
  ;
}


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

x86 assembly (clang, -O2):
<bar>:
movl   $0x5,(%rdi)
ret

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

LLVM IR (-O2):
define void @bar(i32* nocapture writeonly %0) {
store i32 5, i32* %0
ret void
}
int cmp_chars(const void *a, const void *b) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cmp_chars(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ COLS;
scalar_t__ LINES;
int /*<<< orphan*/ move(scalar_t__, scalar_t__);
int /*<<< orphan*/ napms(int);
int /*<<< orphan*/ refresh();
int myrefresh() {
  napms(200);
  move(LINES - 1, COLS - 1);
  refresh();
}


x86 assembly (clang, -O0):
<myrefresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1040 <napms@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%rsi
sub    $0x1,%rsi
call   1050 <move@plt>
mov    $0x0,%al
call   1030 <refresh@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrefresh>:
push   %rax
mov    $0xc8,%edi
call   1040 <napms@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
mov    0x2e90(%rip),%rax
mov    (%rax),%rsi
add    $0xffffffffffffffff,%rsi
call   1050 <move@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <refresh@plt>

LLVM IR (-O0):
@LINES = global i64 0
@COLS = global i64 0
define i32 @myrefresh() {
%1 = alloca i32
%2 = call i32 @napms(i32 200)
%3 = load i64, i64* @LINES
%4 = sub nsw i64 %3, 1
%5 = load i64, i64* @COLS
%6 = sub nsw i64 %5, 1
%7 = call i32 @move(i64 %4, i64 %6)
%8 = call i32 (...) @refresh()
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@LINES = global i64 0
@COLS = global i64 0
define i32 @myrefresh() {
%1 = tail call i32 @napms(i32 200)
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -1
%4 = load i64, i64* @COLS
%5 = add nsw i64 %4, -1
%6 = tail call i32 @move(i64 %3, i64 %5)
%7 = tail call i32 (...) @refresh()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ match(float);
void doFunction() { match('f'); }


x86 assembly (clang, -O0):
<doFunction>:
push   %rbp
mov    %rsp,%rbp
movss  0xee4(%rip),%xmm0
call   1030 <match@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doFunction>:
movss  0xee8(%rip),%xmm0
jmp    1030 <match@plt>

LLVM IR (-O0):
define void @doFunction() {
%1 = call i32 @match(float 1.020000e+02)
ret void
}

LLVM IR (-O2):
define void @doFunction() {
%1 = tail call i32 @match(float 1.020000e+02)
ret void
}
int do_998() { return 998; }


x86 assembly (clang, -O0):
<do_998>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_998>:
mov    $0x3e6,%eax
ret

LLVM IR (-O0):
define i32 @do_998() {
ret i32 998
}

LLVM IR (-O2):
define i32 @do_998() {
ret i32 998
}
/* Variables and functions */
int find_count(int *array) {
  int count = 0;
  if (array != NULL) {
    while (array[count] != (-1)) {
      count++;
    }
  }
  return count;
}


x86 assembly (clang, -O0):
<find_count>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <find_count+0x44>
jmp    111f <find_count+0x1f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     113f <find_count+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <find_count+0x1f>
jmp    1144 <find_count+0x44>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_count>:
test   %rdi,%rdi
je     111d <find_count+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpl   $0xffffffff,(%rdi)
lea    0x4(%rdi),%rdi
jne    1110 <find_count+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @find_count(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, -1
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void ux00ddr_mask_mc_init_complete_interrupt(size_t ahbregaddr) {
  (*(volatile uint32_t *)((136 << 2) + (ahbregaddr))) |= (1 << 8);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x220,%rax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
orl    $0x100,0x220(%rdi)
ret

LLVM IR (-O0):
define void @ux00ddr_mask_mc_init_complete_interrupt(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 544, %3
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 256
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @ux00ddr_mask_mc_init_complete_interrupt(i64 %0) {
%2 = add i64 %0, 544
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 256
store volatile i32 %5, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int epoll_create1(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int setup_epoll() {
  int epollfd;
  if ((epollfd = epoll_create1(0)) == -1) {
    perror("epoll_create1");
    exit(EXIT_FAILURE);
  }
  return epollfd;
}


x86 assembly (clang, -O0):
<setup_epoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <epoll_create1@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xffffffff,%eax
jne    1165 <setup_epoll+0x35>
lea    0xeae(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_epoll>:
push   %rax
xor    %edi,%edi
call   1050 <epoll_create1@plt>
cmp    $0xffffffff,%eax
je     113f <setup_epoll+0xf>
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"epoll_create1\00"
@EXIT_FAILURE = global i32 0
define i32 @setup_epoll() {
%1 = alloca i32
%2 = call i32 @epoll_create1(i32 0)
store i32 %2, i32* %1
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"epoll_create1\00"
@EXIT_FAILURE = global i32 0
define i32 @setup_epoll() {
%1 = tail call i32 @epoll_create1(i32 0)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_misaligned_1();
int /*<<< orphan*/ take_struct_misaligned_1(int /*<<< orphan*/);
void test_struct_misaligned_1() {
  take_struct_misaligned_1(return_struct_misaligned_1());
}


x86 assembly (clang, -O0):
<test_struct_misaligned_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <return_struct_misaligned_1@plt>
mov    %eax,%edi
call   1030 <take_struct_misaligned_1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_misaligned_1>:
push   %rax
xor    %eax,%eax
call   1040 <return_struct_misaligned_1@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <take_struct_misaligned_1@plt>

LLVM IR (-O0):
define void @test_struct_misaligned_1() {
%1 = call i32 (...) @return_struct_misaligned_1()
%2 = call i32 @take_struct_misaligned_1(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_misaligned_1() {
%1 = tail call i32 (...) @return_struct_misaligned_1()
%2 = tail call i32 @take_struct_misaligned_1(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int display(char *input) {
  printf("%s\n", input);
  return 0;
}


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

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @display(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
size_t ra_portable_deserialize_size(char const *, size_t);
size_t roaring_bitmap_portable_deserialize_size(const char *buf,
                                                size_t maxbytes) {
  return ra_portable_deserialize_size(buf, maxbytes);
}


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

x86 assembly (clang, -O2):
<roaring_bitmap_portable_deserialize_size>:
jmp    1030 <ra_portable_deserialize_size@plt>

LLVM IR (-O0):
define i64 @roaring_bitmap_portable_deserialize_size(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 i64 @ra_portable_deserialize_size(i8* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @roaring_bitmap_portable_deserialize_size(i8* %0, i64 %1) {
%3 = tail call i64 @ra_portable_deserialize_size(i8* %0, i64 %1)
ret i64 %3
}
BOOST_AUTO_TEST_CASE(cosh) { TESTCASE1(cosh, 0, 1); }


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <TESTCASE1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
xor    %esi,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <TESTCASE1@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %4, i32 0, i32 1)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE1 to i32 (i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1)
ret i32 undef
}
void spiAssertCs(void) {}


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

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

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

LLVM IR (-O2):
define void @spiAssertCs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int test4(int i) {
  bar();
  foo();
  foo();
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @bar()
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ _my_log(char *, int, char *, char *, int, char const *);
void log_err(const char *errstr) {
  do {
    _my_log("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/migrate_ATHLETICS.c",
            347, "[ ERROR ] at %s:%d ,err info: %s\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/"
            "master/migrate/migrate_ATHLETICS.c",
            347, errstr);
  } while (0);
}


x86 assembly (clang, -O0):
<log_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r9
lea    0xed9(%rip),%rcx
mov    $0x15b,%r8d
lea    0xf6f(%rip),%rdx
mov    %rcx,%rdi
mov    %r8d,%esi
call   1030 <_my_log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_err>:
mov    %rdi,%r9
lea    0xf89(%rip),%rdx
lea    0xedf(%rip),%rcx
mov    %rcx,%rdi
mov    $0x15b,%esi
mov    $0x15b,%r8d
jmp    1030 <_my_log@plt>

LLVM IR (-O0):
@.str = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/migrate_ATHLETICS.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = load i8*, i8** %2
%5 = call i32 @_my_log(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 347, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 347, i8* %4)
br label %6
6: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str = [163 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/zhongliangkang/twemproxy41/refs/heads/master/migrate/migrate_ATHLETICS.c\00"
@.str.1 = [34 x i8] c"[ ERROR ] at %s:%d ,err info: %s\0A\00"
define void @log_err(i8* %0) {
%2 = tail call i32 @_my_log(i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 347, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([163 x i8], [163 x i8]* @.str, i64 0, i64 0), i32 347, i8* %0)
ret void
}
/* Variables and functions */
int pow(float, int);
float f2l(float x) { return 12 * x - (1 / pow(x, 2)); }


x86 assembly (clang, -O0):
<f2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movss  -0x8(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
movss  0xea2(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2l>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
cvtsi2ss %edx,%xmm1
movss  0x4(%rsp),%xmm0
mulss  0xec2(%rip),%xmm0
subss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f2l(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i32 @pow(float %4, i32 2)
%6 = sdiv i32 1, %5
%7 = sitofp i32 %6 to float
%8 = fneg float %7
%9 = call float @llvm.fmuladd.f32(float 1.200000e+01, float %3, float %8)
ret float %9
}

LLVM IR (-O2):
define float @f2l(float %0) {
%2 = tail call i32 @pow(float %0, i32 2)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to float
%7 = fneg float %6
%8 = tail call float @llvm.fmuladd.f32(float %0, float 1.200000e+01, float %7)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ drv_Sample_send(char *, int);
int drv_Sample_contrast(int contrast) {
  char cmd[2];
  if (contrast < 0)
    contrast = 0;
  if (contrast > 255)
    contrast = 255;
  cmd[0] = 0x04;
  cmd[1] = contrast;
  drv_Sample_send(cmd, 2);
  return contrast;
}


x86 assembly (clang, -O0):
<drv_Sample_contrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <drv_Sample_contrast+0x1c>
movl   $0x0,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    1140 <drv_Sample_contrast+0x30>
movl   $0xff,-0x4(%rbp)
movb   $0x4,-0x6(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rdi
mov    $0x2,%esi
call   1030 <drv_Sample_send@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_Sample_contrast>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
test   %edi,%edi
cmovns %edi,%eax
cmp    $0xff,%eax
mov    $0xff,%ebx
cmovb  %eax,%ebx
movb   $0x4,0xe(%rsp)
mov    %bl,0xf(%rsp)
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
call   1030 <drv_Sample_send@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @drv_Sample_contrast(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 255
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 255, i32* %2
br label %11
11: ; preds = %10, %7
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 4, i8* %12
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %14, i8* %15
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%17 = call i32 @drv_Sample_send(i8* %16, i32 2)
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @drv_Sample_contrast(i32 %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i32 %0, 0
%5 = select i1 %4, i32 %0, i32 0
%6 = icmp ult i32 %5, 255
%7 = select i1 %6, i32 %5, i32 255
store i8 4, i8* %3
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
store i8 %8, i8* %9
%10 = call i32 @drv_Sample_send(i8* %3, i32 2)
ret i32 %7
}
/* Type definitions */
struct redfish_client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ redfish_unlink_tree(struct redfish_client *, char *);
void rename_test1_cleanup(struct redfish_client *cli) {
  redfish_unlink_tree(cli, "/rename1sd");
  redfish_unlink_tree(cli, "/rename1dd");
  redfish_unlink_tree(cli, "/rename1sf");
}


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

x86 assembly (clang, -O2):
<rename_test1_cleanup>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <redfish_unlink_tree@plt>
lea    0xee4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <redfish_unlink_tree@plt>
lea    0xee0(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <redfish_unlink_tree@plt>

LLVM IR (-O0):
%struct.redfish_client = type { i32 }
@.str = [11 x i8] c"/rename1sd\00"
@.str.1 = [11 x i8] c"/rename1dd\00"
@.str.2 = [11 x i8] c"/rename1sf\00"
define void @rename_test1_cleanup(%struct.redfish_client* %0) {
%2 = alloca %struct.redfish_client*
store %struct.redfish_client* %0, %struct.redfish_client** %2
%3 = load %struct.redfish_client*, %struct.redfish_client** %2
%4 = call i32 @redfish_unlink_tree(%struct.redfish_client* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.redfish_client*, %struct.redfish_client** %2
%6 = call i32 @redfish_unlink_tree(%struct.redfish_client* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%7 = load %struct.redfish_client*, %struct.redfish_client** %2
%8 = call i32 @redfish_unlink_tree(%struct.redfish_client* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.redfish_client = type { i32 }
@.str = [11 x i8] c"/rename1sd\00"
@.str.1 = [11 x i8] c"/rename1dd\00"
@.str.2 = [11 x i8] c"/rename1sf\00"
define void @rename_test1_cleanup(%struct.redfish_client* %0) {
%2 = tail call i32 @redfish_unlink_tree(%struct.redfish_client* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @redfish_unlink_tree(%struct.redfish_client* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @redfish_unlink_tree(%struct.redfish_client* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
double sqrt(double);
double my_sqrt(double x) {
  assert(x >= 0.0);
  return sqrt(x);
}


x86 assembly (clang, -O0):
<my_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sqrt>:
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
xor    %edi,%edi
ucomisd %xmm1,%xmm0
setae  %dil
call   1030 <assert@plt>
movsd  (%rsp),%xmm0
ucomisd 0xeba(%rip),%xmm0
jb     114e <my_sqrt+0x2e>
sqrtsd %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @my_sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oge double %3, 0.000000e+00
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load double, double* %2
%8 = call double @sqrt(double %7)
ret double %8
}

LLVM IR (-O2):
define double @my_sqrt(double %0) {
%2 = fcmp oge double %0, 0.000000e+00
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call double @sqrt(double %0)
ret double %5
}
double f4() {
  double x, y;
  asm("" : "=r"(x), "=r"(y) : "0"(x), "r"(0));
  return x;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
xor    %ecx,%ecx
movq   %rcx,%xmm0
movq   %rax,%xmm1
movsd  %xmm1,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
xor    %eax,%eax
movq   %rax,%xmm0
ret

LLVM IR (-O0):
define double @f4() {
%1 = alloca double
%2 = alloca double
%3 = load double, double* %1
%4 = call { double, double } asm "", "=r,=r,0,r,~{dirflag},~{fpsr},~{flags}"(double %3, i32 0)
%5 = extractvalue { double, double } %4, 0
%6 = extractvalue { double, double } %4, 1
store double %5, double* %1
store double %6, double* %2
%7 = load double, double* %1
ret double %7
}

LLVM IR (-O2):
define double @f4() {
%1 = tail call { double, double } asm "", "=r,=r,0,r,~{dirflag},~{fpsr},~{flags}"(double undef, i32 0)
%2 = extractvalue { double, double } %1, 0
ret double %2
}
void HAL_RTC_Reset_SS(void) {}


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

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

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

LLVM IR (-O2):
define void @HAL_RTC_Reset_SS() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Welcome Rpi2\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Welcome Rpi2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
char *strstr(char *, char *);
size_t pos(char *haystack, char *needle) {
  char *needle_position;
  size_t found_length, haystack_length;
  needle_position = strstr(haystack, needle);
  if (needle_position) {
    found_length = strlen(needle_position);
    haystack_length = strlen(haystack);
    return haystack_length - found_length;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1177 <pos+0x57>
mov    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117f <pos+0x5f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pos>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <strstr@plt>
test   %rax,%rax
je     1149 <pos+0x29>
mov    %rax,%rdi
call   1030 <strlen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
sub    %r14,%rax
jmp    1150 <pos+0x30>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @pos(i8* %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i8* @strstr(i8* %9, i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %22
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = call i64 @strlen(i8* %15)
store i64 %16, i64* %7
%17 = load i8*, i8** %4
%18 = call i64 @strlen(i8* %17)
store i64 %18, i64* %8
%19 = load i64, i64* %8
%20 = load i64, i64* %7
%21 = sub i64 %19, %20
store i64 %21, i64* %3
br label %23
22: ; preds = %2
store i64 -1, i64* %3
br label %23
23: ; preds = %22, %14
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @pos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strlen(i8* %3)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%8 = sub i64 %7, %6
br label %9
9: ; preds = %2, %5
%10 = phi i64 [ %8, %5 ], [ -1, %2 ]
ret i64 %10
}
/* Type definitions */
struct sock_fprog {
  int dummy;
};

/* Variables and functions */
int __bpf_l4v4_hash(struct sock_fprog *, int);
int bpf_novlan_l4v4_hash(struct sock_fprog *fprog) {
  return __bpf_l4v4_hash(fprog, false);
}


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

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

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

LLVM IR (-O2):
%struct.sock_fprog = type { i32 }
define i32 @bpf_novlan_l4v4_hash(%struct.sock_fprog* %0) {
%2 = tail call i32 @__bpf_l4v4_hash(%struct.sock_fprog* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void foo(int x) { printf("sizeof is %d\n", x); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"sizeof is %d\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
size_t pool_get_num_free_blocks(void *free_list) {
  size_t num_free = 0;
  void *block;
  for (block = free_list; block != NULL; block = *(void **)block)
    num_free++;
  return num_free;
}


x86 assembly (clang, -O0):
<pool_get_num_free_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     113f <pool_get_num_free_blocks+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <pool_get_num_free_blocks+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_get_num_free_blocks>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <pool_get_num_free_blocks+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    (%rdi),%rdi
test   %rdi,%rdi
jne    1110 <pool_get_num_free_blocks+0x10>
ret

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

LLVM IR (-O2):
define i64 @pool_get_num_free_blocks(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %6, %3 ], [ 0, %1 ]
%6 = add i64 %5, 1
%7 = bitcast i8* %4 to i8**
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %11
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t u32_max(uint32_t x, uint32_t y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<u32_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <u32_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <u32_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @u32_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_write_standard_Laurent_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(121, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_standard_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x79,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_standard_Laurent_system>:
mov    $0x79,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_write_standard_Laurent_system() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 121, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_write_standard_Laurent_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 121, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ nc_addch(char);
int /*<<< orphan*/ nc_set_yx(int /*<<< orphan*/, int);
void ui_draw_vline(int x, int y, int h) {
  while (h-- > 0) {
    nc_set_yx(y++, x);
    nc_addch('|');
  }
}


x86 assembly (clang, -O0):
<ui_draw_vline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1167 <ui_draw_vline+0x47>
mov    -0x8(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%esi
call   1040 <nc_set_yx@plt>
mov    $0x7c,%edi
call   1030 <nc_addch@plt>
jmp    1131 <ui_draw_vline+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ui_draw_vline>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1151 <ui_draw_vline+0x31>
mov    %edx,%ebx
mov    %edi,%r14d
add    $0x1,%ebx
lea    0x1(%rsi),%ebp
mov    %esi,%edi
mov    %r14d,%esi
call   1040 <nc_set_yx@plt>
mov    $0x7c,%edi
call   1030 <nc_addch@plt>
add    $0xffffffff,%ebx
mov    %ebp,%esi
cmp    $0x1,%ebx
ja     1130 <ui_draw_vline+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ui_draw_vline(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
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %6
%9 = add nsw i32 %8, -1
store i32 %9, i32* %6
%10 = icmp sgt i32 %8, 0
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @nc_set_yx(i32 %12, i32 %14)
%16 = call i32 @nc_addch(i8 signext 124)
br label %7
17: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @ui_draw_vline(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %2, %3 ]
%7 = phi i32 [ %9, %5 ], [ %1, %3 ]
%8 = add nsw i32 %6, -1
%9 = add nsw i32 %7, 1
%10 = tail call i32 @nc_set_yx(i32 %7, i32 %0)
%11 = tail call i32 @nc_addch(i8 signext 124)
%12 = icmp ugt i32 %6, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ show_result(int, int, char *);
int one_try(int offset, int len, char *msg) {
  if (offset > 0 && offset < 26)
    show_result(offset, len, msg);
  else
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<one_try>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114a <one_try+0x3a>
cmpl   $0x1a,-0x8(%rbp)
jge    114a <one_try+0x3a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <show_result@plt>
jmp    1156 <one_try+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <one_try+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_try>:
lea    -0x1(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0x18,%ecx
ja     1129 <one_try+0x19>
push   %rax
call   1030 <show_result@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @one_try(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 26
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = load i8*, i8** %7
%17 = call i32 @show_result(i32 %14, i32 %15, i8* %16)
br label %19
18: ; preds = %10, %3
store i32 -1, i32* %4
br label %20
19: ; preds = %13
store i32 0, i32* %4
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @one_try(i32 %0, i32 %1, i8* %2) {
%4 = add i32 %0, -1
%5 = icmp ult i32 %4, 25
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @show_result(i32 %0, i32 %1, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 0, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
struct path_info {
  int dummy;
};
struct http_request {
  int dummy;
};
struct config {
  int dummy;
};
struct client {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uh_file_request(struct client *, struct http_request *,
                                   struct path_info *);
void uh_dispatch_request(struct client *cl, struct http_request *req,
                         struct path_info *pin, struct config *conf) {
  uh_file_request(cl, req, pin);
}


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

x86 assembly (clang, -O2):
<uh_dispatch_request>:
jmp    1030 <uh_file_request@plt>

LLVM IR (-O0):
%struct.client = type { i32 }
%struct.http_request = type { i32 }
%struct.path_info = type { i32 }
%struct.config = type { i32 }
define void @uh_dispatch_request(%struct.client* %0, %struct.http_request* %1, %struct.path_info* %2, %struct.config* %3) {
%5 = alloca %struct.client*
%6 = alloca %struct.http_request*
%7 = alloca %struct.path_info*
%8 = alloca %struct.config*
store %struct.client* %0, %struct.client** %5
store %struct.http_request* %1, %struct.http_request** %6
store %struct.path_info* %2, %struct.path_info** %7
store %struct.config* %3, %struct.config** %8
%9 = load %struct.client*, %struct.client** %5
%10 = load %struct.http_request*, %struct.http_request** %6
%11 = load %struct.path_info*, %struct.path_info** %7
%12 = call i32 @uh_file_request(%struct.client* %9, %struct.http_request* %10, %struct.path_info* %11)
ret void
}

LLVM IR (-O2):
%struct.client = type { i32 }
%struct.http_request = type { i32 }
%struct.path_info = type { i32 }
%struct.config = type { i32 }
define void @uh_dispatch_request(%struct.client* %0, %struct.http_request* %1, %struct.path_info* %2, %struct.config* nocapture readnone %3) {
%5 = tail call i32 @uh_file_request(%struct.client* %0, %struct.http_request* %1, %struct.path_info* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printxyd(int, int, void *);
void printxyd_P(int y, int x, void *s) { printxyd(y, x, s); }


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

x86 assembly (clang, -O2):
<printxyd_P>:
jmp    1030 <printxyd@plt>

LLVM IR (-O0):
define void @printxyd_P(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @printxyd(i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @printxyd_P(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @printxyd(i32 %0, i32 %1, i8* %2)
ret void
}