xunge/DecIR huggingface dataset:
int mel_wpg_uint_sizeof(unsigned int number) {
  int data_size = 1;
  if (number > (256 - 1)) {
    if (number > (65536 - 1)) {
      if (number > (16777216 - 1)) {
        data_size = 4;
      } else {
        data_size = 3;
      }
    } else {
      data_size = 2;
    }
  }
  return (data_size);
}


x86 assembly (clang, -O0):
<mel_wpg_uint_sizeof>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xff,-0x4(%rbp)
jbe    1159 <mel_wpg_uint_sizeof+0x59>
cmpl   $0xffff,-0x4(%rbp)
jbe    114d <mel_wpg_uint_sizeof+0x4d>
cmpl   $0xffffff,-0x4(%rbp)
jbe    1141 <mel_wpg_uint_sizeof+0x41>
movl   $0x4,-0x8(%rbp)
jmp    1148 <mel_wpg_uint_sizeof+0x48>
movl   $0x3,-0x8(%rbp)
jmp    1154 <mel_wpg_uint_sizeof+0x54>
movl   $0x2,-0x8(%rbp)
jmp    1159 <mel_wpg_uint_sizeof+0x59>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mel_wpg_uint_sizeof>:
mov    $0x1,%eax
cmp    $0x100,%edi
jb     1128 <mel_wpg_uint_sizeof+0x28>
mov    $0x2,%eax
cmp    $0x10000,%edi
jb     1128 <mel_wpg_uint_sizeof+0x28>
cmp    $0x1000000,%edi
mov    $0x3,%eax
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @mel_wpg_uint_sizeof(i32 %0) {
%2 = icmp ugt i32 %0, 255
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = icmp ugt i32 %0, 65535
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = icmp ugt i32 %0, 16777215
%7 = select i1 %6, i32 4, i32 3
br label %8
8: ; preds = %3, %5, %1
%9 = phi i32 [ 1, %1 ], [ %7, %5 ], [ 2, %3 ]
ret i32 %9
}
int ffi_test_50(int x, int y) { return x + y + 1; }


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

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

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

LLVM IR (-O2):
define i32 @ffi_test_50(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  char word[200] = {0};
  printf("%ld", hash(word));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1050 <memset@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xc8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0xc0(%rsp)
mov    %rsp,%rdi
call   1030 <hash@plt>
lea    0xe74(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xc8,%rsp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = call i32 @hash(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void quit(void) {
  printf("\033[31m"
         "You've quit VirtualSoc !\n"
         "\033[0m");
  return;
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"\1B[31mYou've quit VirtualSoc !\0A\1B[0m\00"
define void @quit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"\1B[31mYou've quit VirtualSoc !\0A\1B[0m\00"
define void @quit() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int read_script(char const *);
int exec(char **args) { return read_script((const char *)args[1]); }


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

x86 assembly (clang, -O2):
<exec>:
mov    0x8(%rdi),%rdi
jmp    1030 <read_script@plt>

LLVM IR (-O0):
define i32 @exec(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 1
%5 = load i8*, i8** %4
%6 = call i32 @read_script(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @exec(i8** nocapture %0) {
%2 = getelementptr inbounds i8*, i8** %0, i64 1
%3 = load i8*, i8** %2
%4 = tail call i32 @read_script(i8* %3)
ret i32 %4
}
int f(int *restrict a, int *restrict b) {
  *a = 1;
  *b = 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<f>:
movl   $0x1,(%rdi)
movl   $0x1,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32* noalias nocapture writeonly %0, i32* noalias nocapture writeonly %1) {
store i32 1, i32* %0
store i32 1, i32* %1
ret i32 0
}
int spam(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @spam() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c_panic(char *, char *);
size_t strlen(const char *str) {
  const char *char_ptr;
  for (char_ptr = str; *char_ptr != '\0'; ++char_ptr) {
    if (char_ptr == 0)
      c_panic("STRLEN_LOOP", "Char pointer overflow during strlen");
  }
  return char_ptr - str;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1168 <strlen+0x58>
cmpq   $0x0,-0x10(%rbp)
jne    1152 <strlen+0x42>
lea    0xeba(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <c_panic@plt>
jmp    1157 <strlen+0x47>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strlen+0x14>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
@.str = [12 x i8] c"STRLEN_LOOP\00"
@.str.1 = [36 x i8] c"Char pointer overflow during strlen\00"
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %16, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @c_panic(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %10
br label %16
16: ; preds = %15
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
br label %5
19: ; preds = %5
%20 = load i8*, i8** %3
%21 = load i8*, i8** %2
%22 = ptrtoint i8* %20 to i64
%23 = ptrtoint i8* %21 to i64
%24 = sub i64 %22, %23
ret i64 %24
}

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_cleanup_all_ex_data();
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ EVP_cleanup();
void free_context() {
  ERR_free_strings();
  EVP_cleanup();
  CRYPTO_cleanup_all_ex_data();
}


x86 assembly (clang, -O0):
<free_context>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ERR_free_strings@plt>
mov    $0x0,%al
call   1040 <EVP_cleanup@plt>
mov    $0x0,%al
call   1030 <CRYPTO_cleanup_all_ex_data@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_context>:
push   %rax
xor    %eax,%eax
call   1050 <ERR_free_strings@plt>
xor    %eax,%eax
call   1040 <EVP_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <CRYPTO_cleanup_all_ex_data@plt>

LLVM IR (-O0):
define void @free_context() {
%1 = call i32 (...) @ERR_free_strings()
%2 = call i32 (...) @EVP_cleanup()
%3 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
ret void
}

LLVM IR (-O2):
define void @free_context() {
%1 = tail call i32 (...) @ERR_free_strings()
%2 = tail call i32 (...) @EVP_cleanup()
%3 = tail call i32 (...) @CRYPTO_cleanup_all_ex_data()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ angle_rotate(unsigned int);
int /*<<< orphan*/ soft_right_2();
void soft_right_2_degrees(unsigned int Degrees) {
  soft_right_2();
  Degrees = Degrees * 2;
  angle_rotate(Degrees);
}


x86 assembly (clang, -O0):
<soft_right_2_degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <soft_right_2@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <angle_rotate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_right_2_degrees>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <soft_right_2@plt>
add    %ebx,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <angle_rotate@plt>

LLVM IR (-O0):
define void @soft_right_2_degrees(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @soft_right_2()
%4 = load i32, i32* %2
%5 = mul i32 %4, 2
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @angle_rotate(i32 %6)
ret void
}

LLVM IR (-O2):
define void @soft_right_2_degrees(i32 %0) {
%2 = tail call i32 (...) @soft_right_2()
%3 = shl i32 %0, 1
%4 = tail call i32 @angle_rotate(i32 %3)
ret void
}
int nondet() {
  int i;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @nondet() {
ret i32 undef
}
void vec3_lerp(const float a[3], const float b[3], float t, float out[3]) {
  vec3_mix(a, b, t, out);
}


x86 assembly (clang, -O0):
<vec3_lerp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x20(%rbp),%rdx
mov    $0x1,%al
call   1030 <vec3_mix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_lerp>:
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
jmp    1030 <vec3_mix@plt>

LLVM IR (-O0):
define void @vec3_lerp(float* %0, float* %1, float %2, float* %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
%8 = alloca float*
store float* %0, float** %5
store float* %1, float** %6
store float %2, float* %7
store float* %3, float** %8
%9 = load float*, float** %5
%10 = load float*, float** %6
%11 = load float, float* %7
%12 = fpext float %11 to double
%13 = load float*, float** %8
%14 = call i32 (float*, float*, double, float*, ...) bitcast (i32 (...)* @vec3_mix to i32 (float*, float*, double, float*, ...)*)(float* %9, float* %10, double %12, float* %13)
ret void
}

LLVM IR (-O2):
define void @vec3_lerp(float* %0, float* %1, float %2, float* %3) {
%5 = fpext float %2 to double
%6 = tail call i32 (float*, float*, double, float*, ...) bitcast (i32 (...)* @vec3_mix to i32 (float*, float*, double, float*, ...)*)(float* %0, float* %1, double %5, float* %3)
ret void
}
/* Variables and functions */
scalar_t__ random();
double rand_float(void) {
  float ret = ((unsigned)random()) % 2000000;
  return (ret - 1.0e6) / 1.0e6;
}


x86 assembly (clang, -O0):
<rand_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
imul   $0x431bde83,%rcx,%rcx
shr    $0x33,%rcx
imul   $0x1e8480,%ecx,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_float>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
imul   $0x431bde83,%rcx,%rcx
shr    $0x33,%rcx
imul   $0x1e8480,%ecx,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xec3(%rip),%xmm0
divsd  0xec3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand_float() {
%1 = alloca float
%2 = call i64 (...) @random()
%3 = trunc i64 %2 to i32
%4 = urem i32 %3, 2000000
%5 = uitofp i32 %4 to float
store float %5, float* %1
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = fsub double %7, 1.000000e+06
%9 = fdiv double %8, 1.000000e+06
ret double %9
}

LLVM IR (-O2):
define double @rand_float() {
%1 = tail call i64 (...) @random()
%2 = trunc i64 %1 to i32
%3 = urem i32 %2, 2000000
%4 = uitofp i32 %3 to float
%5 = fpext float %4 to double
%6 = fadd double %5, -1.000000e+06
%7 = fdiv double %6, 1.000000e+06
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exit_unreachable() { exit(0); }


x86 assembly (clang, -O0):
<exit_unreachable>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @exit_unreachable() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @exit_unreachable() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct udev_monitor {
  int dummy;
};
struct udev {
  int dummy;
};

/* Variables and functions */
struct udev_monitor *udev_monitor_new_from_netlink_fd(struct udev *,
                                                      char const *, int);
__attribute__((visibility("default"))) struct udev_monitor *
udev_monitor_new_from_netlink(struct udev *udev, const char *name) {
  return udev_monitor_new_from_netlink_fd(udev, name, -1);
}


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

x86 assembly (clang, -O2):
<udev_monitor_new_from_netlink>:
mov    $0xffffffff,%edx
jmp    1030 <udev_monitor_new_from_netlink_fd@plt>

LLVM IR (-O0):
%struct.udev_monitor = type { i32 }
%struct.udev = type { i32 }
define %struct.udev_monitor* @udev_monitor_new_from_netlink(%struct.udev* %0, i8* %1) {
%3 = alloca %struct.udev*
%4 = alloca i8*
store %struct.udev* %0, %struct.udev** %3
store i8* %1, i8** %4
%5 = load %struct.udev*, %struct.udev** %3
%6 = load i8*, i8** %4
%7 = call %struct.udev_monitor* @udev_monitor_new_from_netlink_fd(%struct.udev* %5, i8* %6, i32 -1)
ret %struct.udev_monitor* %7
}

LLVM IR (-O2):
%struct.udev_monitor = type { i32 }
%struct.udev = type { i32 }
define %struct.udev_monitor* @udev_monitor_new_from_netlink(%struct.udev* %0, i8* %1) {
%3 = tail call %struct.udev_monitor* @udev_monitor_new_from_netlink_fd(%struct.udev* %0, i8* %1, i32 -1)
ret %struct.udev_monitor* %3
}
void EFlash_ClockConfig() {
  while ((*(volatile unsigned int *)(0x40009000 + 0x018) & (1 << 1)) ==
         (1 << 1))
    ;
  *(volatile unsigned int *)(0x40009000 + 0x01C) = 0x00200B43;
  ;
  while ((*(volatile unsigned int *)(0x40009000 + 0x018) & 1) == 1)
    ;
}


x86 assembly (clang, -O0):
<EFlash_ClockConfig>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <EFlash_ClockConfig+0x9>
mov    $0x40009018,%eax
mov    (%rax),%eax
and    $0x2,%eax
cmp    $0x2,%eax
jne    1121 <EFlash_ClockConfig+0x21>
jmp    1109 <EFlash_ClockConfig+0x9>
mov    $0x4000901c,%eax
movl   $0x200b43,(%rax)
mov    $0x40009018,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1144 <EFlash_ClockConfig+0x44>
jmp    112c <EFlash_ClockConfig+0x2c>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EFlash_ClockConfig>:
testl  $0x2,0x40009018
jne    1100 <EFlash_ClockConfig>
movl   $0x200b43,0x4000901c
nopl   0x0(%rax,%rax,1)
mov    0x40009018,%eax
test   $0x1,%al
jne    1120 <EFlash_ClockConfig+0x20>
ret

LLVM IR (-O0):
define void @EFlash_ClockConfig() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
store volatile i32 2100035, i32* inttoptr (i64 1073778716 to i32*)
br label %7
7: ; preds = %11, %6
%8 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @EFlash_ClockConfig() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%3 = and i32 %2, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
store volatile i32 2100035, i32* inttoptr (i64 1073778716 to i32*)
br label %6
6: ; preds = %6, %5
%7 = load volatile i32, i32* inttoptr (i64 1073778712 to i32*)
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
ret void
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};
struct _Locale_codecvt {
  int dummy;
};

/* Variables and functions */
scalar_t__ _Locale_create(char const *, int *);
struct _Locale_codecvt *_Locale_codecvt_create(const char *name,
                                               struct _Locale_name_hint *hint,
                                               int *__err_code) {
  return (struct _Locale_codecvt *)_Locale_create(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_codecvt_create>:
mov    %rdx,%rsi
jmp    1030 <_Locale_create@plt>

LLVM IR (-O0):
%struct._Locale_codecvt = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_codecvt* @_Locale_codecvt_create(i8* %0, %struct._Locale_name_hint* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca %struct._Locale_name_hint*
%6 = alloca i32*
store i8* %0, i8** %4
store %struct._Locale_name_hint* %1, %struct._Locale_name_hint** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32*, i32** %6
%9 = call i64 @_Locale_create(i8* %7, i32* %8)
%10 = inttoptr i64 %9 to %struct._Locale_codecvt*
ret %struct._Locale_codecvt* %10
}

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
%struct._Locale_name_hint = type { i32 }
define %struct._Locale_codecvt* @_Locale_codecvt_create(i8* %0, %struct._Locale_name_hint* nocapture readnone %1, i32* %2) {
%4 = tail call i64 @_Locale_create(i8* %0, i32* %2)
%5 = inttoptr i64 %4 to %struct._Locale_codecvt*
ret %struct._Locale_codecvt* %5
}
void gtk_drag_highlight() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_highlight() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BLE_bless_isr_Disable();
void CyBleHal_DisableGlobalInterrupts(void) { BLE_bless_isr_Disable(); }


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

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

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

LLVM IR (-O2):
define void @CyBleHal_DisableGlobalInterrupts() {
%1 = tail call i32 (...) @BLE_bless_isr_Disable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ esc(char *);
void ris(void) { esc("c"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"c\00"
define void @ris() {
%1 = tail call i32 @esc(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
int fmod(m, mod)
int m, mod;
{
  int register res, m2;
  res = m % mod;
  m2 = (mod >> 1);
  if (res > m2)
    return (m - mod);
  else if (res < -m2)
    return (res + mod);
  else
    return res;
}


x86 assembly (clang, -O0):
<fmod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1137 <fmod+0x37>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <fmod+0x5b>
mov    -0x10(%rbp),%eax
xor    %ecx,%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1155 <fmod+0x55>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115b <fmod+0x5b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %esi,%eax
sar    %eax
cmp    %eax,%edx
jle    1112 <fmod+0x12>
sub    %esi,%edi
mov    %edi,%eax
ret
neg    %eax
xor    %edi,%edi
cmp    %eax,%edx
cmovl  %esi,%edi
add    %edx,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @fmod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = ashr i32 %1, 1
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = sub nsw i32 %0, %1
br label %13
8: ; preds = %2
%9 = sub nsw i32 0, %4
%10 = icmp slt i32 %3, %9
%11 = select i1 %10, i32 %1, i32 0
%12 = add nsw i32 %11, %3
br label %13
13: ; preds = %8, %6
%14 = phi i32 [ %7, %6 ], [ %12, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ swap_le16(void *, void *);
void swap_le16_num(void *s, void *d, int n) {
  int i;
  for (i = 0; i < n; i++, s += 16 / 8, d += 16 / 8)
    swap_le16(s, d);
}


x86 assembly (clang, -O0):
<swap_le16_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1169 <swap_le16_num+0x59>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <swap_le16@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <swap_le16_num+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_le16_num>:
push   %rbp
push   %r14
push   %rbx
test   %edx,%edx
jle    1149 <swap_le16_num+0x39>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <swap_le16@plt>
add    $0x2,%rbp
add    $0x2,%rbx
add    $0xffffffff,%r14d
jne    1130 <swap_le16_num+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @swap_le16_num(i8* %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3, %5
%6 = phi i32 [ %10, %5 ], [ 0, %3 ]
%7 = phi i8* [ %11, %5 ], [ %0, %3 ]
%8 = phi i8* [ %12, %5 ], [ %1, %3 ]
%9 = tail call i32 @swap_le16(i8* %7, i8* %8)
%10 = add nuw nsw i32 %6, 1
%11 = getelementptr i8, i8* %7, i64 2
%12 = getelementptr i8, i8* %8, i64 2
%13 = icmp eq i32 %10, %2
br i1 %13, label %14, label %5
14: ; preds = %5, %3
ret void
}
int create_view(char *the_stem_name) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @create_view(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void debug_nl(void) { printf("\n\r"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0D\00"
define void @debug_nl() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawDiamond(int, char);
int /*<<< orphan*/ drawLine(int, char);
int /*<<< orphan*/ drawSquare(int, char);
int /*<<< orphan*/ drawTriangle(int, char);
int main() {
  drawLine(5, '#');
  drawSquare(5, '#');
  drawTriangle(5, '#');
  drawDiamond(5, '#');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x23,%esi
call   1030 <drawLine@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1060 <drawSquare@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1040 <drawTriangle@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1050 <drawDiamond@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
mov    $0x23,%esi
call   1030 <drawLine@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1060 <drawSquare@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1040 <drawTriangle@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1050 <drawDiamond@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @drawLine(i32 5, i8 signext 35)
%3 = call i32 @drawSquare(i32 5, i8 signext 35)
%4 = call i32 @drawTriangle(i32 5, i8 signext 35)
%5 = call i32 @drawDiamond(i32 5, i8 signext 35)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @drawLine(i32 5, i8 signext 35)
%2 = tail call i32 @drawSquare(i32 5, i8 signext 35)
%3 = tail call i32 @drawTriangle(i32 5, i8 signext 35)
%4 = tail call i32 @drawDiamond(i32 5, i8 signext 35)
ret i32 0
}
/* Type definitions */
struct vertex_set {
  int dummy;
};
struct vertex {
  int dummy;
};

/* Variables and functions */
struct vertex_set *vs_add(struct vertex_set *, struct vertex *);
struct vertex_set *vs_empty();
struct vertex_set *vs_singleton(struct vertex *v) {
  struct vertex_set *e = vs_empty();
  return vs_add(e, v);
}


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

x86 assembly (clang, -O2):
<vs_singleton>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <vs_empty@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <vs_add@plt>

LLVM IR (-O0):
%struct.vertex_set = type { i32 }
%struct.vertex = type { i32 }
define %struct.vertex_set* @vs_singleton(%struct.vertex* %0) {
%2 = alloca %struct.vertex*
%3 = alloca %struct.vertex_set*
store %struct.vertex* %0, %struct.vertex** %2
%4 = call %struct.vertex_set* (...) @vs_empty()
store %struct.vertex_set* %4, %struct.vertex_set** %3
%5 = load %struct.vertex_set*, %struct.vertex_set** %3
%6 = load %struct.vertex*, %struct.vertex** %2
%7 = call %struct.vertex_set* @vs_add(%struct.vertex_set* %5, %struct.vertex* %6)
ret %struct.vertex_set* %7
}

LLVM IR (-O2):
%struct.vertex_set = type { i32 }
%struct.vertex = type { i32 }
define %struct.vertex_set* @vs_singleton(%struct.vertex* %0) {
%2 = tail call %struct.vertex_set* (...) @vs_empty()
%3 = tail call %struct.vertex_set* @vs_add(%struct.vertex_set* %2, %struct.vertex* %0)
ret %struct.vertex_set* %3
}
/* Variables and functions */
int /*<<< orphan*/ test(char *, char *);
void TEST_literal_string(void) {
  test("Hello", "main(){char *p=\"Hello\"; printf(\"%s\", p);}");
  test("Hello world",
       "main(){char *p=\"Hello \" \"world\"; printf(\"%s\", p);}");
}


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

x86 assembly (clang, -O2):
<TEST_literal_string>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <test@plt>
lea    0xf05(%rip),%rdi
lea    0xf0a(%rip),%rsi
pop    %rax
jmp    1030 <test@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [42 x i8] c"main(){char *p=\22Hello\22; printf(\22%s\22, p);}\00"
@.str.2 = [12 x i8] c"Hello world\00"
@.str.3 = [51 x i8] c"main(){char *p=\22Hello \22 \22world\22; printf(\22%s\22, p);}\00"
define void @TEST_literal_string() {
%1 = call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
@.str.1 = [42 x i8] c"main(){char *p=\22Hello\22; printf(\22%s\22, p);}\00"
@.str.2 = [12 x i8] c"Hello world\00"
@.str.3 = [51 x i8] c"main(){char *p=\22Hello \22 \22world\22; printf(\22%s\22, p);}\00"
define void @TEST_literal_string() {
%1 = tail call i32 @test(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void teletype_wr_init(const char *fname) {}


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

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

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

LLVM IR (-O2):
define void @teletype_wr_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int strlen(const char *str) {
  int i = 0;
  while (str[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid(int *, int);
int query_cpu_feature_sse() {
  int buffer[4];
  __cpuid(buffer, 1);
  if ((buffer[3] & (1 << 25)) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<query_cpu_feature_sse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1030 <__cpuid@plt>
mov    -0x14(%rbp),%eax
and    $0x2000000,%eax
cmp    $0x0,%eax
jne    1143 <query_cpu_feature_sse+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <query_cpu_feature_sse+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_cpu_feature_sse>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <__cpuid@plt>
mov    0xc(%rsp),%eax
shr    $0x19,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @query_cpu_feature_sse() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%4 = call i32 @__cpuid(i32* %3, i32 1)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 3
%6 = load i32, i32* %5
%7 = and i32 %6, 33554432
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 0, i32* %1
br label %11
10: ; preds = %0
store i32 1, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @query_cpu_feature_sse() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @__cpuid(i32* %3, i32 1)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 3
%6 = load i32, i32* %5
%7 = lshr i32 %6, 25
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char const);
int /*<<< orphan*/ stderr;
void dump_hex(const unsigned char *data, size_t len) {
  size_t i;
  for (i = 0; i < len; ++i) {
    fprintf(stderr, "%02x", data[i]);
  }
}


x86 assembly (clang, -O0):
<dump_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1168 <dump_hex+0x58>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
lea    0xeb2(%rip),%rsi
movzbl (%rax,%rcx,1),%edx
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <dump_hex+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_hex>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rsi,%rsi
je     115a <dump_hex+0x4a>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
mov    0x2eb3(%rip),%r13
lea    0xecc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%r13),%edi
movzbl (%r14,%rbx,1),%edx
mov    %r15,%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <dump_hex+0x30>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [5 x i8] c"%02x\00"
define void @dump_hex(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %15)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [5 x i8] c"%02x\00"
define void @dump_hex(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = load i32, i32* @stderr
%7 = getelementptr inbounds i8, i8* %0, i64 %5
%8 = load i8, i8* %7
%9 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
void memMapAddress(volatile unsigned int *address,
                   volatile unsigned int *target) {
  *address = 0xaaaa5555;
  *address = 0x5555aaaa;
  *address = 0xca5cca5c;
  *address = (unsigned int)target;
}


x86 assembly (clang, -O0):
<memMapAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xaaaa5555,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5555aaaa,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xca5cca5c,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<memMapAddress>:
movl   $0xaaaa5555,(%rdi)
movl   $0x5555aaaa,(%rdi)
movl   $0xca5cca5c,(%rdi)
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @memMapAddress(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
store volatile i32 -1431677611, i32* %5
%6 = load i32*, i32** %3
store volatile i32 1431677610, i32* %6
%7 = load i32*, i32** %3
store volatile i32 -899888548, i32* %7
%8 = load i32*, i32** %4
%9 = ptrtoint i32* %8 to i32
%10 = load i32*, i32** %3
store volatile i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @memMapAddress(i32* %0, i32* %1) {
store volatile i32 -1431677611, i32* %0
store volatile i32 1431677610, i32* %0
store volatile i32 -899888548, i32* %0
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
store volatile i32 %4, i32* %0
ret void
}
/* Variables and functions */
unsigned long long __real___udivdi3(unsigned long long, unsigned long long);
unsigned long long __wrap___udivdi3(unsigned long long a,
                                    unsigned long long b) {
  return __real___udivdi3(a, b);
}


x86 assembly (clang, -O0):
<__wrap___udivdi3>:
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 <__real___udivdi3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap___udivdi3>:
jmp    1030 <__real___udivdi3@plt>

LLVM IR (-O0):
define i64 @__wrap___udivdi3(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 = call i64 @__real___udivdi3(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @__wrap___udivdi3(i64 %0, i64 %1) {
%3 = tail call i64 @__real___udivdi3(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x22() {
  Assert_real((isascii(34)),
              "/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",
              175, ("isascii should be 1 for 0x22"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x22>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xaf,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x22\00"
define void @t_isascii_0x22() {
%1 = call i32 @isascii(i32 34)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, 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 1 for 0x22\00"
define void @t_isascii_0x22() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int DBL_MIN_EXP;
int minexponentdbl_(double *x) { return DBL_MIN_EXP; }


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

x86 assembly (clang, -O2):
<minexponentdbl_>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@DBL_MIN_EXP = global i32 0
define i32 @minexponentdbl_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load i32, i32* @DBL_MIN_EXP
ret i32 %3
}

LLVM IR (-O2):
@DBL_MIN_EXP = global i32 0
define i32 @minexponentdbl_(double* nocapture readnone %0) {
%2 = load i32, i32* @DBL_MIN_EXP
ret i32 %2
}
/* Variables and functions */
int atoi(char const *);
scalar_t__ isalpha(char const);
int get_val(const char *identifier, const int *registers) {
  if (isalpha(identifier[0])) {
    return registers[identifier[0] - 'a'];
  } else {
    return atoi(identifier);
  }
}


x86 assembly (clang, -O0):
<get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1162 <get_val+0x42>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x61,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <get_val+0x4e>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isalpha@plt>
test   %rax,%rax
je     114b <get_val+0x2b>
movsbq (%rbx),%rax
mov    -0x184(%r14,%rax,4),%eax
ff
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <atoi@plt>

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

LLVM IR (-O2):
define i32 @get_val(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = tail call i64 @isalpha(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = sext i8 %7 to i64
%9 = add nsw i64 %8, -97
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
br label %14
12: ; preds = %2
%13 = tail call i32 @atoi(i8* %0)
br label %14
14: ; preds = %12, %6
%15 = phi i32 [ %11, %6 ], [ %13, %12 ]
ret i32 %15
}