xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned long ilog2(unsigned int);
unsigned long pwm_tdiv_div_bits(unsigned int div) { return ilog2(div) - 1; }


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

x86 assembly (clang, -O2):
<pwm_tdiv_div_bits>:
push   %rax
call   1030 <ilog2@plt>
add    $0xffffffffffffffff,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @pwm_tdiv_div_bits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @ilog2(i32 %3)
%5 = sub i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @pwm_tdiv_div_bits(i32 %0) {
%2 = tail call i64 @ilog2(i32 %0)
%3 = add i64 %2, -1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void scsc_matvecs(int n_row, int n_col, int n_vecs, int *Ap, int *Ai, float *Ax,
                  float *Xx, float *Yx) {
  int i, j, ii;
  printf("dcsc_matvecs not working in m_sparsetools.c\n");
  exit(1);
}


x86 assembly (clang, -O0):
<scsc_matvecs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [45 x i8] c"dcsc_matvecs not working in m_sparsetools.c\0A\00"
define void @scsc_matvecs(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4, float* %5, float* %6, float* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store float* %5, float** %14
store float* %6, float** %15
store float* %7, float** %16
%20 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [44 x i8] c"dcsc_matvecs not working in m_sparsetools.c\00"
define void @scsc_matvecs(i32 %0, i32 %1, i32 %2, i32* nocapture readnone %3, i32* nocapture readnone %4, float* nocapture readnone %5, float* nocapture readnone %6, float* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct catmc_atomic_intptr_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_intptr_t *);
void catmc_atomic_intptr_t_destroy(struct catmc_atomic_intptr_t *wrapper) {
  free(wrapper);
}


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

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

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

LLVM IR (-O2):
%struct.catmc_atomic_intptr_t = type { i32 }
define void @catmc_atomic_intptr_t_destroy(%struct.catmc_atomic_intptr_t* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_intptr_t* %0)
ret void
}
unsigned long crc_finish(unsigned long crc) { return (crc ^ 0xFFFFFFFF); }


x86 assembly (clang, -O0):
<crc_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xffffffff,%rax
xor    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc_finish>:
mov    $0xffffffff,%eax
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @crc_finish(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, 4294967295
ret i64 %4
}

LLVM IR (-O2):
define i64 @crc_finish(i64 %0) {
%2 = xor i64 %0, 4294967295
ret i64 %2
}
int anyc(char c, char *s) {
  while (*s != '\0')
    if (c == *s++)
      return (1);
  return (0);
}


x86 assembly (clang, -O0):
<anyc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <anyc+0x4d>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1148 <anyc+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1154 <anyc+0x54>
jmp    110e <anyc+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<anyc>:
movzbl (%rsi),%eax
test   %al,%al
je     1116 <anyc+0x16>
add    $0x1,%rsi
cmp    %dil,%al
jne    1100 <anyc>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @anyc(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ msg_new_from_str(char *);
void *msg_copy(void *msg) { return (void *)msg_new_from_str((char *)msg); }


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

x86 assembly (clang, -O2):
<msg_copy>:
jmp    1030 <msg_new_from_str@plt>

LLVM IR (-O0):
define i8* @msg_copy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @msg_new_from_str(i8* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @msg_copy(i8* %0) {
%2 = tail call i64 @msg_new_from_str(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ vol_print_all();
void dt_s390mv_info(void) { vol_print_all(); }


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

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

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

LLVM IR (-O2):
define void @dt_s390mv_info() {
%1 = tail call i32 (...) @vol_print_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chain_node_free(void *);
void pending_cleanup(void *p) { chain_node_free(p); }


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

x86 assembly (clang, -O2):
<pending_cleanup>:
jmp    1030 <chain_node_free@plt>

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

LLVM IR (-O2):
define void @pending_cleanup(i8* %0) {
%2 = tail call i32 @chain_node_free(i8* %0)
ret void
}
int cmpChar(const void *_a, const void *_b) {
  char *a = (char *)_a;
  char *b = (char *)_b;
  return *a - *b;
}


x86 assembly (clang, -O0):
<cmpChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpChar>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmpChar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = sub nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmpChar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
unsigned long __VERIFIER_nondet_ulong();
int /*<<< orphan*/ assert_context_process();
unsigned long copy_from_user(void *to, void *from, unsigned long n) {
  unsigned long tmp;
  {
    {
      assert_context_process();
      tmp = __VERIFIER_nondet_ulong();
    }
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<copy_from_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <assert_context_process@plt>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_ulong@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @copy_from_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @assert_context_process()
%5 = tail call i64 (...) @__VERIFIER_nondet_ulong()
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(sizeof "foo" == 4);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
void gtk_style_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_style_new() {
ret void
}
/* Variables and functions */
scalar_t__ strlen(char *);
void clrstr(char *str) {
  if (strlen(str) == 0) {
    return;
  }
  while (*str != '\0') {
    *str = '\0';
    str++;
  }
}


x86 assembly (clang, -O0):
<clrstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1134 <clrstr+0x24>
jmp    1161 <clrstr+0x51>
jmp    1139 <clrstr+0x29>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1161 <clrstr+0x51>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1139 <clrstr+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrstr>:
cmpb   $0x0,(%rdi)
je     111d <clrstr+0x1d>
add    $0x1,%rdi
nopl   0x0(%rax)
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <clrstr+0x10>
ret

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

LLVM IR (-O2):
define void @clrstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
store i8 0, i8* %5
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
float pow_custom(float number, int base) {
  int i;
  float num = 1;
  for (i = 0; i < base; i++) {
    num *= number;
  }
  return num;
}


x86 assembly (clang, -O0):
<pow_custom>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  0xeec(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <pow_custom+0x49>
movss  -0x4(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1120 <pow_custom+0x20>
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow_custom>:
test   %edi,%edi
jle    111b <pow_custom+0x1b>
lea    -0x1(%rdi),%ecx
mov    %edi,%eax
and    $0x7,%eax
cmp    $0x7,%ecx
jae    1124 <pow_custom+0x24>
movss  0xee7(%rip),%xmm1
jmp    1155 <pow_custom+0x55>
movss  0xedd(%rip),%xmm0
ret
and    $0xfffffff8,%edi
movss  0xed1(%rip),%xmm1
nop
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  %xmm0,%xmm1
add    $0xfffffff8,%edi
jne    1130 <pow_custom+0x30>
test   %eax,%eax
je     1169 <pow_custom+0x69>
nopl   0x0(%rax)
mulss  %xmm0,%xmm1
add    $0xffffffff,%eax
jne    1160 <pow_custom+0x60>
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @pow_custom(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
store i32 %1, i32* %4
store float 1.000000e+00, float* %6
store i32 0, i32* %5
br label %7
7: ; preds = %15, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load float, float* %3
%13 = load float, float* %6
%14 = fmul float %13, %12
store float %14, float* %6
br label %15
15: ; preds = %11
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %7
18: ; preds = %7
%19 = load float, float* %6
ret float %19
}

LLVM IR (-O2):
define float @pow_custom(float %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = add i32 %1, -1
%6 = and i32 %1, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %4
%9 = and i32 %1, -8
br label %10
10: ; preds = %10, %8
%11 = phi float [ 1.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul float %11, %0
%14 = fmul float %13, %0
%15 = fmul float %14, %0
%16 = fmul float %15, %0
%17 = fmul float %16, %0
%18 = fmul float %17, %0
%19 = fmul float %18, %0
%20 = fmul float %19, %0
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %4
%24 = phi float [ undef, %4 ], [ %20, %10 ]
%25 = phi float [ 1.000000e+00, %4 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi float [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul float %28, %0
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %2
%34 = phi float [ 1.000000e+00, %2 ], [ %24, %23 ], [ %30, %27 ]
ret float %34
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void runner_crash(int return_code) { exit(return_code); }


x86 assembly (clang, -O0):
<runner_crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define void @runner_crash(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
double sqrt(float);
double NormalizationFactor(int NumFilters, int m) {
  double normalizationFactor = 0.0f;
  if (m == 0) {
    normalizationFactor = sqrt(1.0f / NumFilters);
  } else {
    normalizationFactor = sqrt(2.0f / NumFilters);
  }
  return normalizationFactor;
}


x86 assembly (clang, -O0):
<NormalizationFactor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1150 <NormalizationFactor+0x40>
cvtsi2ssl -0x4(%rbp),%xmm1
movss  0xec7(%rip),%xmm0
divss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    116b <NormalizationFactor+0x5b>
cvtsi2ssl -0x4(%rbp),%xmm1
movss  0xea3(%rip),%xmm0
divss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalizationFactor>:
xor    %eax,%eax
test   %esi,%esi
cvtsi2ss %edi,%xmm1
sete   %al
lea    0xede(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
divss  %xmm1,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @NormalizationFactor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
store double 0.000000e+00, double* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to float
%11 = fdiv float 1.000000e+00, %10
%12 = call double @sqrt(float %11)
store double %12, double* %5
br label %18
13: ; preds = %2
%14 = load i32, i32* %3
%15 = sitofp i32 %14 to float
%16 = fdiv float 2.000000e+00, %15
%17 = call double @sqrt(float %16)
store double %17, double* %5
br label %18
18: ; preds = %13, %8
%19 = load double, double* %5
ret double %19
}

LLVM IR (-O2):
define double @NormalizationFactor(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = sitofp i32 %0 to float
%5 = select i1 %3, float 1.000000e+00, float 2.000000e+00
%6 = fdiv float %5, %4
%7 = tail call double @sqrt(float %6)
ret double %7
}
short unsigned int HashRs(char *str) {
  const unsigned int b = 378551;
  unsigned int a = 63689;
  unsigned int hash = 0;
  for (; *str; str++) {
    hash = hash * a + (unsigned char)(*str);
    a *= b;
  }
  return (unsigned short)hash;
}


x86 assembly (clang, -O0):
<HashRs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x5c6b7,-0xc(%rbp)
movl   $0xf8c9,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <HashRs+0x58>
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
imul   $0x5c6b7,-0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <HashRs+0x1d>
mov    -0x14(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashRs>:
mov    (%rdi),%cl
xor    %eax,%eax
test   %cl,%cl
je     113b <HashRs+0x3b>
add    $0x1,%rdi
mov    $0xf8c9,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%esi
imul   %edx,%esi
movzbl %cl,%eax
add    %esi,%eax
imul   $0x5c6b7,%edx,%edx
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1120 <HashRs+0x20>
ret

LLVM IR (-O0):
define zeroext i16 @HashRs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
store i32 378551, i32* %3
store i32 63689, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %20, %1
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = mul i32 %11, %12
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = add i32 %13, %16
store i32 %17, i32* %5
%18 = load i32, i32* %4
%19 = mul i32 %18, 378551
store i32 %19, i32* %4
br label %20
20: ; preds = %10
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %2
br label %6
23: ; preds = %6
%24 = load i32, i32* %5
%25 = trunc i32 %24 to i16
ret i16 %25
}

LLVM IR (-O2):
define zeroext i16 @HashRs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i32 [ %12, %4 ], [ 63689, %1 ]
%8 = phi i8* [ %13, %4 ], [ %0, %1 ]
%9 = mul i32 %6, %7
%10 = zext i8 %5 to i32
%11 = add i32 %9, %10
%12 = mul i32 %7, 378551
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
%17 = trunc i32 %11 to i16
br label %18
18: ; preds = %16, %1
%19 = phi i16 [ 0, %1 ], [ %17, %16 ]
ret i16 %19
}
void glGetProgramBinary(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetProgramBinary() {
ret void
}
void Timer_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Timer_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fadd_preg32_qword(int reg32) {
  put8(0xDC);
  put8(reg32);
}


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

x86 assembly (clang, -O2):
<fadd_preg32_qword>:
push   %rbx
mov    %edi,%ebx
mov    $0xdc,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fadd_preg32_qword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 220)
%4 = load i32, i32* %2
%5 = call i32 @put8(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fadd_preg32_qword(i32 %0) {
%2 = tail call i32 @put8(i32 220)
%3 = tail call i32 @put8(i32 %0)
ret void
}
void prefsi_(x, y) int *x, *y;
{ prefsize((long)*x, (long)*y); }


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

x86 assembly (clang, -O2):
<prefsi_>:
movslq (%rdi),%rdi
movslq (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <prefsize@plt>

LLVM IR (-O0):
define void @prefsi_(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* %5
%7 = sext i32 %6 to i64
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = call i32 (i64, i64, ...) bitcast (i32 (...)* @prefsize to i32 (i64, i64, ...)*)(i64 %7, i64 %10)
ret void
}

LLVM IR (-O2):
define void @prefsi_(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = sext i32 %3 to i64
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @prefsize to i32 (i64, i64, ...)*)(i64 %4, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int show_foo();
int main() {
  printf("%d\n", show_foo());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <show_foo@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @show_foo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_F3uint32_reg(unsigned int val) {
  return ((val) & (0xF3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F3uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xf3,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F3uint32_reg>:
test   $0xf3,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F3uint32_reg(i32 %0) {
%2 = and i32 %0, 243
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void debugOn() {}


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

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

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

LLVM IR (-O2):
define void @debugOn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_membed(int, char **);
int main(int argc, char *argv[]) {
  gmx_membed(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_membed(i32 %0, i8** %1)
ret i32 0
}
int test_imm_40uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x40 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_40uint64_lowword_mem>:
testb  $0x40,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_40uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 64
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("The process ID is %d\n", getpid());
  printf("The parent process ID is %d\n", getppid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getppid@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The process ID is %d\0A\00"
@.str.1 = [29 x i8] c"The parent process ID is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getpid()
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @getppid()
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The process ID is %d\0A\00"
@.str.1 = [29 x i8] c"The parent process ID is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @getppid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void nn_xpull_out(struct nn_sockbase *self, struct nn_pipe *pipe) {}


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

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

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

LLVM IR (-O2):
%struct.nn_sockbase = type opaque
%struct.nn_pipe = type opaque
define void @nn_xpull_out(%struct.nn_sockbase* nocapture %0, %struct.nn_pipe* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *open_key_file(char *kf) {
  if (!kf)
    return 0;
  return fopen(kf, "w");
}


x86 assembly (clang, -O0):
<open_key_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <open_key_file+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1148 <open_key_file+0x38>
mov    -0x10(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_key_file>:
test   %rdi,%rdi
je     1121 <open_key_file+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <fopen@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define noalias i32* @open_key_file(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32* [ %4, %3 ], [ null, %1 ]
ret i32* %6
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int gettimeofday(struct timeval *, struct timezone *);
double mygettime() {
  struct timeval tp;
  struct timezone tzp;
  int i;
  i = gettimeofday(&tp, &tzp);
  return ((double)tp.tv_sec + (double)tp.tv_usec * 1.e-6);
}


x86 assembly (clang, -O0):
<mygettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    %eax,-0x1c(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mygettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xec9(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @mygettime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
store i32 %4, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define double @mygettime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = tail call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %8)
ret double %12
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};
struct forth_instance {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ st_push(struct forth_instance *, int);
void gettime(struct forth_instance *fi) {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  st_push(fi, (int)tp.tv_usec);
  st_push(fi, (int)tp.tv_sec);
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1040 <st_push@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <st_push@plt>
mov    (%rsp),%esi
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
%struct.timeval = type { i64, i64 }
define void @gettime(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
%3 = alloca %struct.timeval
store %struct.forth_instance* %0, %struct.forth_instance** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = load %struct.forth_instance*, %struct.forth_instance** %2
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = call i32 @st_push(%struct.forth_instance* %5, i32 %8)
%10 = load %struct.forth_instance*, %struct.forth_instance** %2
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = call i32 @st_push(%struct.forth_instance* %10, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
%struct.timeval = type { i64, i64 }
define void @gettime(%struct.forth_instance* %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %7)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = tail call i32 @st_push(%struct.forth_instance* %0, i32 %11)
ret void
}
void *test_anti_range_103(unsigned int n) {
  extern void *alloc_anti_range_103(unsigned int)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_103(n);
}


x86 assembly (clang, -O0):
<test_anti_range_103>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
ja     1137 <test_anti_range_103+0x27>
cmpl   $0x2,-0x4(%rbp)
ja     1137 <test_anti_range_103+0x27>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_103@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_103>:
cmp    $0x3,%edi
mov    $0xffffffff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_103@plt>

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

LLVM IR (-O2):
define i8* @test_anti_range_103(i32 %0) {
%2 = icmp ult i32 %0, 3
%3 = select i1 %2, i32 -1, i32 %0
%4 = tail call i8* @alloc_anti_range_103(i32 %3)
ret i8* %4
}
/* Type definitions */
struct xdispline {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlleft(struct xdispline *);
int /*<<< orphan*/ wl_rcursor(struct xdispline *);
void wl_dlleft(struct xdispline *line) {
  dlleft(line);
  wl_rcursor(line);
}


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

x86 assembly (clang, -O2):
<wl_dlleft>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dlleft@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <wl_rcursor@plt>

LLVM IR (-O0):
%struct.xdispline = type { i32 }
define void @wl_dlleft(%struct.xdispline* %0) {
%2 = alloca %struct.xdispline*
store %struct.xdispline* %0, %struct.xdispline** %2
%3 = load %struct.xdispline*, %struct.xdispline** %2
%4 = call i32 @dlleft(%struct.xdispline* %3)
%5 = load %struct.xdispline*, %struct.xdispline** %2
%6 = call i32 @wl_rcursor(%struct.xdispline* %5)
ret void
}

LLVM IR (-O2):
%struct.xdispline = type { i32 }
define void @wl_dlleft(%struct.xdispline* %0) {
%2 = tail call i32 @dlleft(%struct.xdispline* %0)
%3 = tail call i32 @wl_rcursor(%struct.xdispline* %0)
ret void
}
/* Type definitions */
struct in6_addr {
  int /*<<< orphan*/ *s6_addr32;
};
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf) {
  buf[0] = 0x33;
  buf[1] = 0x33;
  memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32));
}


x86 assembly (clang, -O0):
<ipv6_eth_mc_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x33,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x33,0x1(%rax)
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
add    $0xc,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_eth_mc_map>:
movw   $0x3333,(%rsi)
lea    0x2(%rsi),%rax
mov    (%rdi),%rsi
add    $0xc,%rsi
mov    %rax,%rdi
mov    $0x4,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
%struct.in6_addr = type { i32* }
define void @ipv6_eth_mc_map(%struct.in6_addr* %0, i8* %1) {
%3 = alloca %struct.in6_addr*
%4 = alloca i8*
store %struct.in6_addr* %0, %struct.in6_addr** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 51, i8* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 51, i8* %8
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load %struct.in6_addr*, %struct.in6_addr** %3
%12 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %11, i32 0, i32 0
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 3
%15 = call i32 @memcpy(i8* %10, i32* %14, i32 4)
ret void
}

LLVM IR (-O2):
%struct.in6_addr = type { i32* }
define void @ipv6_eth_mc_map(%struct.in6_addr* nocapture %0, i8* %1) {
store i8 51, i8* %1
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 51, i8* %3
%4 = getelementptr inbounds i8, i8* %1, i64 2
%5 = getelementptr inbounds %struct.in6_addr, %struct.in6_addr* %0, i64 0, i32 0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = tail call i32 @memcpy(i8* %4, i32* %7, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Help() {
  fprintf(stderr, "\nmbuseradd commandline:\n\n");
  fprintf(stderr, "mbuseradd [gid] [name] [comment] [usersdir]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Help>:
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
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"\0Ambuseradd commandline:\0A\0A\00"
@.str.1 = [45 x i8] c"mbuseradd [gid] [name] [comment] [usersdir]\0A\00"
define void @Help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"\0Ambuseradd commandline:\0A\0A\00"
@.str.1 = [45 x i8] c"mbuseradd [gid] [name] [comment] [usersdir]\0A\00"
define void @Help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int rand();
unsigned int rand_interval(unsigned int min, unsigned int max) {
  int r;
  unsigned int range = 1 + max - min;
  unsigned int buckets = 32767 / range;
  unsigned int limit = buckets * range;
  do {
    r = rand();
  } while (r >= limit);
  return min + (r / buckets);
}


x86 assembly (clang, -O0):
<rand_interval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x7fff,%eax
xor    %edx,%edx
divl   -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1141 <rand_interval+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x14(%rbp)
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_interval>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %edi,%r14d
sub    %edi,%ebp
add    $0x1,%ebp
mov    $0x7fff,%eax
xor    %edx,%edx
div    %ebp
mov    %eax,%ebx
imul   %eax,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %ebp,%eax
jae    1130 <rand_interval+0x20>
xor    %edx,%edx
div    %ebx
add    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_interval(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = add i32 1, %9
%11 = load i32, i32* %3
%12 = sub i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = udiv i32 32767, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = mul i32 %15, %16
store i32 %17, i32* %8
br label %18
18: ; preds = %20, %2
%19 = call i32 (...) @rand()
store i32 %19, i32* %5
br label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = load i32, i32* %8
%23 = icmp uge i32 %21, %22
br i1 %23, label %18, label %24
24: ; preds = %20
%25 = load i32, i32* %3
%26 = load i32, i32* %5
%27 = load i32, i32* %7
%28 = udiv i32 %26, %27
%29 = add i32 %25, %28
ret i32 %29
}

LLVM IR (-O2):
define i32 @rand_interval(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = udiv i32 32767, %4
%6 = mul i32 %5, %4
br label %7
7: ; preds = %7, %2
%8 = tail call i32 (...) @rand()
%9 = icmp ult i32 %8, %6
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = udiv i32 %8, %5
%12 = add i32 %11, %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, int);
void test1(void) { foo("%d", 20); }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x14,%esi
call   1030 <foo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
lea    0xee9(%rip),%rdi
mov    $0x14,%esi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @test1() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 20)
ret void
}