xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ state;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
unsigned get_XMotionEvent_state(void *_p) {
  return (unsigned)((XMotionEvent *)_p)->state;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XMotionEvent_state(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *reverse_string(char *);
int main() {
  char s[] = "asdf";
  char *newString = reverse_string(s);
  printf("%s\n", newString);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <reverse_string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"asdf\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca i8*
%3 = bitcast [5 x i8]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i8* @reverse_string(i8* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [5 x i8] c"asdf\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i8* @reverse_string(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
}
/* Variables and functions */
int /*<<< orphan*/ extern_c_2_func();
int main(void) {
  extern_c_2_func();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @extern_c_2_func()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @extern_c_2_func()
ret i32 0
}
/* Variables and functions */
void *check_nonnull(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(size_t);
void *checked_malloc(size_t size) {
  return check_nonnull(malloc(size ? size : 1));
}


x86 assembly (clang, -O0):
<checked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <checked_malloc+0x24>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <checked_malloc+0x32>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    1152 <checked_malloc+0x32>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
call   1030 <check_nonnull@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_malloc>:
push   %rax
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <check_nonnull@plt>

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

LLVM IR (-O2):
define i8* @checked_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i32 @malloc(i64 %3)
%5 = tail call i8* @check_nonnull(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ kotlinclib_print_long(long long);
int /*<<< orphan*/ kotlinclib_println();
void kotlinclib_println_long(long long message) {
  kotlinclib_print_long(message);
  kotlinclib_println();
}


x86 assembly (clang, -O0):
<kotlinclib_println_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <kotlinclib_print_long@plt>
mov    $0x0,%al
call   1030 <kotlinclib_println@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @kotlinclib_println_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @kotlinclib_print_long(i64 %3)
%5 = call i32 (...) @kotlinclib_println()
ret void
}

LLVM IR (-O2):
define void @kotlinclib_println_long(i64 %0) {
%2 = tail call i32 @kotlinclib_print_long(i64 %0)
%3 = tail call i32 (...) @kotlinclib_println()
ret void
}
void f(void) {
#pragma css finish
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
extern __attribute__((gnu_)) char *strerror(int errnum) { return "error_str"; }


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"error_str\00"
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"error_str\00"
define i8* @strerror(i32 %0) {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRD3_get(void) { return U_WMRCORENONE_get("U_WMRD3"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD3\00"
define i32 @U_WMRD3_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD3\00"
define i32 @U_WMRD3_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_test_reset_current_memory(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_test_reset_current_memory() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_test_reset_current_memory() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ Prt(char *, int, int);
int /*<<< orphan*/ c__display_gold();
int /*<<< orphan*/ clear_rc(int, int);
void bj__display_bj() {
  clear_rc(21, 1);
  c__display_gold();
  Prt(("You may:"), (22) - 1, (2) - 1);
  Prt((" p) place a bet.                         v) view the rules"), (23) - 1,
      (2) - 1);
  Prt(("^R) Redraw the screen.                 Esc) Exit from building."),
      (24) - 1, (2) - 1);
}


x86 assembly (clang, -O0):
<bj__display_bj>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
mov    $0x1,%esi
call   1050 <clear_rc@plt>
mov    $0x0,%al
call   1030 <c__display_gold@plt>
lea    0xeaf(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
call   1040 <Prt@plt>
lea    0xea2(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
call   1040 <Prt@plt>
lea    0xec7(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
call   1040 <Prt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bj__display_bj>:
push   %rax
mov    $0x15,%edi
mov    $0x1,%esi
call   1050 <clear_rc@plt>
xor    %eax,%eax
call   1030 <c__display_gold@plt>
lea    0xeb2(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
call   1040 <Prt@plt>
lea    0xea5(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
call   1040 <Prt@plt>
lea    0xeca(%rip),%rdi
mov    $0x17,%esi
mov    $0x1,%edx
pop    %rax
jmp    1040 <Prt@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"You may:\00"
@.str.1 = [59 x i8] c" p) place a bet. v) view the rules\00"
@.str.2 = [64 x i8] c"^R) Redraw the screen. Esc) Exit from building.\00"
define void @bj__display_bj() {
%1 = call i32 @clear_rc(i32 21, i32 1)
%2 = call i32 (...) @c__display_gold()
%3 = call i32 @Prt(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 21, i32 1)
%4 = call i32 @Prt(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i32 22, i32 1)
%5 = call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 23, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"You may:\00"
@.str.1 = [59 x i8] c" p) place a bet. v) view the rules\00"
@.str.2 = [64 x i8] c"^R) Redraw the screen. Esc) Exit from building.\00"
define void @bj__display_bj() {
%1 = tail call i32 @clear_rc(i32 21, i32 1)
%2 = tail call i32 (...) @c__display_gold()
%3 = tail call i32 @Prt(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 21, i32 1)
%4 = tail call i32 @Prt(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0), i32 22, i32 1)
%5 = tail call i32 @Prt(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0), i32 23, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("Hola mundo!!! \n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Hola mundo!!! \0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Hola mundo!!! \00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void f(void) {
  int i, j, k;
  int **a;
#pragma hlt interchange permutation(2, 1)
  for (i = 0; i < 100; i++) {
    for (j = 0; j < 200; j++) {
      a[i][j] = i + j;
    }
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1163 <f+0x63>
movl   $0x0,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jge    1150 <f+0x50>
mov    -0x4(%rbp),%edx
add    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <f+0x1c>
jmp    1155 <f+0x55>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <f+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @f() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32**
store i32 0, i32* %1
br label %5
5: ; preds = %28, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %31
8: ; preds = %5
store i32 0, i32* %2
br label %9
9: ; preds = %24, %8
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 200
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = add nsw i32 %13, %14
%16 = load i32**, i32*** %4
%17 = load i32, i32* %1
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32*, i32** %16, i64 %18
%20 = load i32*, i32** %19
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
store i32 %15, i32* %23
br label %24
24: ; preds = %12
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 1
store i32 %26, i32* %2
br label %9
27: ; preds = %9
br label %28
28: ; preds = %27
%29 = load i32, i32* %1
%30 = add nsw i32 %29, 1
store i32 %30, i32* %1
br label %5
31: ; preds = %5
ret void
}

LLVM IR (-O2):
void gpio_i2c_hs_active(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_i2c_hs_active() {
ret void
}
/* Variables and functions */
float hypotf(float, float);
float c_abs__(float z[2]) { return (hypotf(z[0], z[1])); }


x86 assembly (clang, -O0):
<c_abs__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
call   1030 <hypotf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_abs__>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
jmp    1030 <hypotf@plt>

LLVM IR (-O0):
define float @c_abs__(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 1
%8 = load float, float* %7
%9 = call float @hypotf(float %5, float %8)
ret float %9
}

LLVM IR (-O2):
define float @c_abs__(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = tail call float @hypotf(float %2, float %4)
ret float %5
}
int maiusculo_ou_minusculo(char c) {
  if (('A' <= c) && (c <= 'Z'))
    return 1;
  if (('a' <= c) && (c <= 'z'))
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<maiusculo_ou_minusculo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     1134 <maiusculo_ou_minusculo+0x34>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1134 <maiusculo_ou_minusculo+0x34>
movl   $0x1,-0x4(%rbp)
jmp    1165 <maiusculo_ou_minusculo+0x65>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     115e <maiusculo_ou_minusculo+0x5e>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     115e <maiusculo_ou_minusculo+0x5e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <maiusculo_ou_minusculo+0x65>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maiusculo_ou_minusculo>:
lea    -0x41(%rdi),%eax
add    $0x85,%dil
cmp    $0xe6,%dil
sbb    %ecx,%ecx
cmp    $0x1a,%al
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @maiusculo_ou_minusculo(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 65, %5
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %22
12: ; preds = %7, %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sle i32 97, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 122
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %2
br label %22
21: ; preds = %16, %12
store i32 -1, i32* %2
br label %22
22: ; preds = %21, %20, %11
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @maiusculo_ou_minusculo(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -123
%5 = icmp ult i8 %4, -26
%6 = sext i1 %5 to i32
%7 = select i1 %3, i32 1, i32 %6
ret i32 %7
}
int set_memory_rw_nx(unsigned long addr, int numpages) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @set_memory_rw_nx(i64 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int stringcompare(void *a, void *b) {
  return strcmp((char *)a, (char *)b) == 0;
}


x86 assembly (clang, -O0):
<stringcompare>:
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 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @stringcompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @stringcompare(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int unhash_elem(int h) { return h + 'A'; }


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

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

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

LLVM IR (-O2):
define i32 @unhash_elem(i32 %0) {
%2 = add nsw i32 %0, 65
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void moveable_function(void) {
  fprintf(stdout, "Hello from lib1_moveable.c\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<moveable_function>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveable_function>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [28 x i8] c"Hello from lib1_moveable.c\0A\00"
define void @moveable_function() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [28 x i8] c"Hello from lib1_moveable.c\0A\00"
define void @moveable_function() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
int col_byte_normal(int col) { return 0x21 + col; }


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

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

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

LLVM IR (-O2):
define i32 @col_byte_normal(i32 %0) {
%2 = add nsw i32 %0, 33
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
main() {
  f();
  g();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f()
%3 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @g()
ret i32 0
}
void evalShaCommand(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               67, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<evalShaCommand>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x43,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<evalShaCommand>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x43,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.evalShaCommand = [15 x i8] c"evalShaCommand\00"
define void @evalShaCommand() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.evalShaCommand, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.evalShaCommand = [15 x i8] c"evalShaCommand\00"
define void @evalShaCommand() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 67, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.evalShaCommand, i64 0, i64 0))
ret void
}
int g_DUMMY_menu_create_popup(int win_id) {
  win_id = win_id;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_menu_create_popup(i32 %0) {
ret i32 -1
}
OP(fd, f6) {
  illegal_1();
  op_f6();
}


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_f6()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f6()
ret i32 undef
}
/* Type definitions */
struct hashtable_string {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cjet_free(struct hashtable_string *);
void hashtable_delete_element_table(struct hashtable_string *table) {
  cjet_free(table);
  return;
}


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

x86 assembly (clang, -O2):
<hashtable_delete_element_table>:
jmp    1030 <cjet_free@plt>

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

LLVM IR (-O2):
%struct.hashtable_string = type { i32 }
define void @hashtable_delete_element_table(%struct.hashtable_string* %0) {
%2 = tail call i32 @cjet_free(%struct.hashtable_string* %0)
ret void
}
void w15(void *x, long long y) { *(long long *)(x + 32753) = y; }


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

x86 assembly (clang, -O2):
<w15>:
mov    %rsi,0x7ff1(%rdi)
ret

LLVM IR (-O0):
define void @w15(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32753
%8 = bitcast i8* %7 to i64*
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @w15(i8* nocapture writeonly %0, i64 %1) {
%3 = getelementptr i8, i8* %0, i64 32753
%4 = bitcast i8* %3 to i64*
store i64 %1, i64* %4
ret void
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
int /*<<< orphan*/ endpwent();
struct passwd *getpwent();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ setpwent();
int main(void) {
  struct passwd *swan;
  setpwent();
  while ((swan = getpwent()) != NULL) {
    printf("system user: %s\n", swan->pw_name);
  }
  endpwent();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <setpwent@plt>
mov    $0x0,%al
call   1050 <getpwent@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1183 <main+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    1156 <main+0x16>
mov    $0x0,%al
call   1060 <endpwent@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <setpwent@plt>
xor    %eax,%eax
call   1050 <getpwent@plt>
test   %rax,%rax
je     1177 <main+0x37>
lea    0xea5(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rax),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <getpwent@plt>
test   %rax,%rax
jne    1160 <main+0x20>
xor    %eax,%eax
call   1060 <endpwent@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [17 x i8] c"system user: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.passwd*
store i32 0, i32* %1
%3 = call i32 (...) @setpwent()
br label %4
4: ; preds = %7, %0
%5 = call %struct.passwd* (...) @getpwent()
store %struct.passwd* %5, %struct.passwd** %2
%6 = icmp ne %struct.passwd* %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load %struct.passwd*, %struct.passwd** %2
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %8, i32 0, i32 0
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %4
12: ; preds = %4
%13 = call i32 (...) @endpwent()
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [17 x i8] c"system user: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @setpwent()
%2 = tail call %struct.passwd* (...) @getpwent()
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi %struct.passwd* [ %9, %4 ], [ %2, %0 ]
%6 = getelementptr inbounds %struct.passwd, %struct.passwd* %5, i64 0, i32 0
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call %struct.passwd* (...) @getpwent()
%10 = icmp eq %struct.passwd* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = tail call i32 (...) @endpwent()
ret i32 0
}
void create_boolean_false() {}


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

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

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

LLVM IR (-O2):
define void @create_boolean_false() {
ret void
}
/* Variables and functions */
int touch(char *);
int main(int argc, char **argv) {
  int x, errs = 0;
  for (x = 1; x < argc; ++x) {
    errs |= touch(argv[x]);
  }
  return (errs);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1165 <main+0x55>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <touch@plt>
or     -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1144 <main+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebp,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <touch@plt>
or     %eax,%ebp
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %13, %6 ]
%8 = phi i32 [ 0, %4 ], [ %12, %6 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @touch(i8* %10)
%12 = or i32 %11, %8
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %16
}
/* Variables and functions */
double atan(double const);
double const tan(double const);
double geodetic_to_geocentric_hwr(const double gd_lat) {
  const double cos_ae = 0.9966349016452;
  const double cos2_ae = cos_ae * cos_ae;
  const double gdr = gd_lat * 3.14159265358979323846 / 180.0;
  return atan(cos2_ae * tan(gdr)) * 180.0 / 3.14159265358979323846;
}


x86 assembly (clang, -O0):
<geodetic_to_geocentric_hwr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeac(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <tan@plt>
movaps %xmm0,%xmm1
movsd  0xe96(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <atan@plt>
movsd  0xe7d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe69(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<geodetic_to_geocentric_hwr>:
push   %rax
mulsd  0xed7(%rip),%xmm0
divsd  0xed7(%rip),%xmm0
call   1040 <tan@plt>
mulsd  0xed2(%rip),%xmm0
call   1030 <atan@plt>
mulsd  0xebd(%rip),%xmm0
divsd  0xead(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @geodetic_to_geocentric_hwr(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
store double 0x3FEFE46EE093C933, double* %3
store double 0x3FEFC8F5809EBDE6, double* %4
%6 = load double, double* %2
%7 = fmul double %6, 0x400921FB54442D18
%8 = fdiv double %7, 1.800000e+02
store double %8, double* %5
%9 = load double, double* %5
%10 = call double @tan(double %9)
%11 = fmul double 0x3FEFC8F5809EBDE6, %10
%12 = call double @atan(double %11)
%13 = fmul double %12, 1.800000e+02
%14 = fdiv double %13, 0x400921FB54442D18
ret double %14
}

LLVM IR (-O2):
define double @geodetic_to_geocentric_hwr(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fdiv double %2, 1.800000e+02
%4 = tail call double @tan(double %3)
%5 = fmul double %4, 0x3FEFC8F5809EBDE6
%6 = tail call double @atan(double %5)
%7 = fmul double %6, 1.800000e+02
%8 = fdiv double %7, 0x400921FB54442D18
ret double %8
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  int y = __VERIFIER_nondet_int();
  if ((x < y + 2) && (x > y - 1)) {
    if ((x - 1 < y) == 1) {
      if ((x == y) != 1) {
      ERROR:
        return -1;
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    11a1 <main+0x91>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jle    11a1 <main+0x91>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    -0xc(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
jne    119c <main+0x8c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
je     1197 <main+0x87>
jmp    118b <main+0x7b>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a1 <main+0x91>
jmp    119c <main+0x8c>
jmp    11a1 <main+0x91>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 2
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %32
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = icmp sgt i32 %11, %13
br i1 %14, label %15, label %32
15: ; preds = %10
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %3
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %31
22: ; preds = %15
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
%27 = icmp ne i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %22
br label %29
29: ; preds = %28
store i32 -1, i32* %1
br label %32
30: ; preds = %22
br label %31
31: ; preds = %30, %15
br label %32
32: ; preds = %29, %31, %10, %0
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc6(void) {
  printf("Executing exitfunc6.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc6>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc6>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc6.\0A\00"
define void @exitfunc6() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc6.\00"
define void @exitfunc6() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bar();
void recFunc(int n) {
  if (!n) {
    bar();
    return;
  }
  recFunc(n - 1);
}


x86 assembly (clang, -O0):
<recFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1141 <recFunc+0x21>
mov    $0x0,%al
call   1030 <bar@plt>
jmp    114c <recFunc+0x2c>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <recFunc@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @recFunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (...) @bar()
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @recFunc(i32 %0) {
%2 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xce() {
  Assert_real((isascii(206) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              1035, ("isascii should be 0 for 0xce"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xce\00"
define void @t_isascii_0xce() {
%1 = tail call i64 @isascii(i32 206)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1035, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void disable_interrupts(void) { __asm__ __volatile__("cli"); }


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

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

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

LLVM IR (-O2):
define void @disable_interrupts() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
__attribute__((always_)) void *get_current() {
  unsigned long curr;
  __asm__ __volatile__("movq %%gs:(0), %0" : "=r"(curr));
  return (void *)curr;
}


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

x86 assembly (clang, -O2):
<get_current>:
mov    %gs:0x0,%rax
ret

LLVM IR (-O0):
define i8* @get_current() {
%1 = alloca i64
%2 = call i64 asm sideeffect "movq %gs:(0), $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @get_current() {
%1 = tail call i64 asm sideeffect "movq %gs:(0), $0", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int isalnum(int /*<<< orphan*/);
int iswalnum(wint_t wc) { return isalnum(wc); }


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

x86 assembly (clang, -O2):
<iswalnum>:
jmp    1030 <isalnum@plt>

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

LLVM IR (-O2):
define i32 @iswalnum(i32 %0) {
%2 = tail call i32 @isalnum(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ silc_mime_free(void *);
void silc_mime_assemble_dest(void *key, void *context, void *user_context) {
  silc_mime_free(context);
}


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

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

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

LLVM IR (-O2):
define void @silc_mime_assemble_dest(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @silc_mime_free(i8* %1)
ret void
}
/* Variables and functions */
int ENODEV;
int sandbox_sdl_sound_init(int rate, int channels) { return -ENODEV; }


x86 assembly (clang, -O0):
<sandbox_sdl_sound_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecd(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sandbox_sdl_sound_init>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
define i32 @sandbox_sdl_sound_init(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENODEV
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENODEV = global i32 0
define i32 @sandbox_sdl_sound_init(i32 %0, i32 %1) {
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, ...);
void usage(char *argv0, char *msg) {
  printf("%s\n\n", msg);
  printf("Usage:\n\n%s\n create file to be dealt with and exit\n%s x y\n lock "
         "part of file from position x (inclusiv) to position y (exclusive), "
         "sleep 10 sec\n",
         argv0, argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0A\0A\00"
@.str.1 = [144 x i8] c"Usage:\0A\0A%s\0A create file to be dealt with and exit\0A%s x y\0A lock part of file from position x (inclusiv) to position y (exclusive), sleep 10 sec\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0A\0A\00"
@.str.1 = [144 x i8] c"Usage:\0A\0A%s\0A create file to be dealt with and exit\0A%s x y\0A lock part of file from position x (inclusiv) to position y (exclusive), sleep 10 sec\0A\00"
define void @usage(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void alternatives_smp_module_add(struct module *mod, char *name, void *locks,
                                 void *locks_end, void *text, void *text_end) {}


x86 assembly (clang, -O0):
<alternatives_smp_module_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.module = type opaque
define void @alternatives_smp_module_add(%struct.module* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca %struct.module*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
store %struct.module* %0, %struct.module** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i8* %5, i8** %12
ret void
}

LLVM IR (-O2):
%struct.module = type opaque
define void @alternatives_smp_module_add(%struct.module* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4, i8* nocapture %5) {
ret void
}