xunge/DecIR huggingface dataset:
float test1f(float x) { return __builtin_sqrtf(x); }


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

x86 assembly (clang, -O2):
<test1f>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <test1f+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @test1f(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Type definitions */
struct media_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ media_print_topology_dot(struct media_device *);
int /*<<< orphan*/ media_print_topology_text(struct media_device *);
void media_print_topology(struct media_device *media, int dot) {
  if (dot)
    media_print_topology_dot(media);
  else
    media_print_topology_text(media);
}


x86 assembly (clang, -O0):
<media_print_topology>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1147 <media_print_topology+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <media_print_topology_dot@plt>
jmp    1150 <media_print_topology+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <media_print_topology_text@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<media_print_topology>:
test   %esi,%esi
je     1129 <media_print_topology+0x9>
jmp    1040 <media_print_topology_dot@plt>
jmp    1030 <media_print_topology_text@plt>

LLVM IR (-O0):
%struct.media_device = type { i32 }
define void @media_print_topology(%struct.media_device* %0, i32 %1) {
%3 = alloca %struct.media_device*
%4 = alloca i32
store %struct.media_device* %0, %struct.media_device** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.media_device*, %struct.media_device** %3
%9 = call i32 @media_print_topology_dot(%struct.media_device* %8)
br label %13
10: ; preds = %2
%11 = load %struct.media_device*, %struct.media_device** %3
%12 = call i32 @media_print_topology_text(%struct.media_device* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
%struct.media_device = type { i32 }
define void @media_print_topology(%struct.media_device* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @media_print_topology_dot(%struct.media_device* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @media_print_topology_text(%struct.media_device* %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ activate();
int /*<<< orphan*/ bwputs(char *);
int main(void) {
  bwputs("Starting\n");
  activate();
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <bwputs@plt>
mov    $0x0,%al
call   1040 <activate@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <bwputs@plt>
xor    %eax,%eax
call   1040 <activate@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [10 x i8] c"Starting\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bwputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @activate()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"Starting\0A\00"
define i32 @main() {
%1 = tail call i32 @bwputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @activate()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, unsigned int);
void *buffer_DefaultAllocFunction(void *userData, void *ptr,
                                  unsigned int size) {
  (void)userData;
  if (size == 0) {
    free(ptr);
    return NULL;
  } else {
    return realloc(ptr, size);
  }
}


x86 assembly (clang, -O0):
<buffer_DefaultAllocFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1153 <buffer_DefaultAllocFunction+0x33>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1163 <buffer_DefaultAllocFunction+0x43>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_DefaultAllocFunction>:
mov    %rsi,%rdi
test   %edx,%edx
je     112e <buffer_DefaultAllocFunction+0xe>
mov    %edx,%esi
jmp    1040 <realloc@plt>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @buffer_DefaultAllocFunction(i8* nocapture readnone %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @free(i8* %1)
br label %9
7: ; preds = %3
%8 = tail call i8* @realloc(i8* %1, i32 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ null, %5 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
double libt_timetointerval2(double, int /*<<< orphan*/);
double libt_timetointerval(double interval) {
  return libt_timetointerval2(interval, 0);
}


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

x86 assembly (clang, -O2):
<libt_timetointerval>:
xor    %edi,%edi
jmp    1030 <libt_timetointerval2@plt>

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

LLVM IR (-O2):
define double @libt_timetointerval(double %0) {
%2 = tail call double @libt_timetointerval2(double %0, i32 0)
ret double %2
}
int ld_bgt_rc2(long double a1) { return !(__builtin_isgreater(a1, 100)); }


x86 assembly (clang, -O0):
<ld_bgt_rc2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_rc2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_bgt_rc2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp ogt x86_fp80 %3, 0xK4005C800000000000000
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_bgt_rc2(x86_fp80 %0) {
%2 = fcmp ule x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_deck(int *deck, int card_num) {
  int i;
  for (i = 0; i < card_num; i++)
    printf("%d ", deck[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_deck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_deck+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_deck+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_deck>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_deck+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_deck+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_deck(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_deck(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno_exit(char *);
int /*<<< orphan*/ execvp(char *, char **);
void exec_command(char *argv[]) {
  execvp(argv[0], argv);
  errno_exit(argv[0]);
}


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

x86 assembly (clang, -O2):
<exec_command>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    %rbx,%rsi
call   1040 <execvp@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <errno_exit@plt>

LLVM IR (-O0):
define void @exec_command(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** %2
%7 = call i32 @execvp(i8* %5, i8** %6)
%8 = load i8**, i8*** %2
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @errno_exit(i8* %10)
ret void
}

LLVM IR (-O2):
define void @exec_command(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @execvp(i8* %2, i8** %0)
%4 = load i8*, i8** %0
%5 = tail call i32 @errno_exit(i8* %4)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int RAND_MAX;
int random();
uint64_t random64(void) {
  if (RAND_MAX < ~(uint64_t)0)
    return random() * (~(uint64_t)0 / RAND_MAX);
  else
    return (uint64_t)random();
}


x86 assembly (clang, -O0):
<random64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
cmpl   $0xffffffff,(%rax)
jge    1151 <random64+0x41>
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x8(%rbp)
mov    $0xffffffff,%eax
mov    0x2eaa(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <random64+0x4b>
mov    $0x0,%al
call   1030 <random@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random64>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ece(%rip),%rbx
mov    (%rbx),%ebp
xor    %eax,%eax
call   1030 <random@plt>
mov    %eax,%ecx
cmp    $0xfffffffe,%ebp
jg     1135 <random64+0x25>
mov    $0xffffffff,%eax
cltd
idivl  (%rbx)
imul   %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @random64() {
%1 = alloca i32
%2 = load i32, i32* @RAND_MAX
%3 = icmp slt i32 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = call i32 (...) @random()
%6 = load i32, i32* @RAND_MAX
%7 = sdiv i32 -1, %6
%8 = mul nsw i32 %5, %7
store i32 %8, i32* %1
br label %11
9: ; preds = %0
%10 = call i32 (...) @random()
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @random64() {
%1 = load i32, i32* @RAND_MAX
%2 = icmp slt i32 %1, -1
%3 = tail call i32 (...) @random()
br i1 %2, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @RAND_MAX
%6 = sdiv i32 -1, %5
%7 = mul nsw i32 %6, %3
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ %7, %4 ], [ %3, %0 ]
ret i32 %9
}
int test_imm_A7uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A7uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 89
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_atim(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0000 | 0x0090);
}


x86 assembly (clang, -O0):
<ieee80211_is_atim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x90,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_atim>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x90,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_atim(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 144)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_atim(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 144)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ game_draw();
int /*<<< orphan*/ status_print();
void pause_draw(void) {
  game_draw();
  status_print();
}


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

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

LLVM IR (-O0):
define void @pause_draw() {
%1 = call i32 (...) @game_draw()
%2 = call i32 (...) @status_print()
ret void
}

LLVM IR (-O2):
define void @pause_draw() {
%1 = tail call i32 (...) @game_draw()
%2 = tail call i32 (...) @status_print()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nlopt_set_stochastic_population(int const);
void nlossp_(const int *pop) { nlopt_set_stochastic_population(*pop); }


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

x86 assembly (clang, -O2):
<nlossp_>:
mov    (%rdi),%edi
jmp    1030 <nlopt_set_stochastic_population@plt>

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

LLVM IR (-O2):
define void @nlossp_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @nlopt_set_stochastic_population(i32 %2)
ret void
}
void SysTick_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @SysTick_Handler() {
ret void
}
unsigned int scuResetReason(void) {
  unsigned int reason;
  reason =
      (*((volatile unsigned int *const)((0x40010000 + 0x400) + 0x00))) & 0x3FF;
  (*((volatile unsigned int *const)((0x40010000 + 0x400) + 0x08))) = (1 << 0);
  (*((volatile unsigned int *const)((0x40010000 + 0x400) + 0x0c))) =
      (1 << 1) | (1 << 0);
  return reason;
}


x86 assembly (clang, -O0):
<scuResetReason>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40010400,%eax
mov    (%rax),%eax
and    $0x3ff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x40010408,%eax
movl   $0x1,(%rax)
mov    $0x4001040c,%eax
movl   $0x3,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scuResetReason>:
mov    $0x3ff,%eax
and    0x40010400,%eax
movl   $0x1,0x40010408
movl   $0x3,0x4001040c
ret

LLVM IR (-O0):
define i32 @scuResetReason() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073808384 to i32*)
%3 = and i32 %2, 1023
store i32 %3, i32* %1
store volatile i32 1, i32* inttoptr (i64 1073808392 to i32*)
store volatile i32 3, i32* inttoptr (i64 1073808396 to i32*)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @scuResetReason() {
%1 = load volatile i32, i32* inttoptr (i64 1073808384 to i32*)
%2 = and i32 %1, 1023
store volatile i32 1, i32* inttoptr (i64 1073808392 to i32*)
store volatile i32 3, i32* inttoptr (i64 1073808396 to i32*)
ret i32 %2
}
void RTDirRemove(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDirRemove() {
ret void
}
/* Variables and functions */
int func4();
int main(int argc, char *argv[]) { return func4() == 2 ? 0 : 1; }


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 <func4@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func4@plt>
xor    %ecx,%ecx
cmp    $0x2,%eax
setne  %cl
mov    %ecx,%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 = call i32 (...) @func4()
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func4()
%4 = icmp ne i32 %3, 2
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned long EthernetPHYRead(unsigned long ulBase, unsigned char ucRegAddr) {
  ;
  while ((*((volatile unsigned long *)(ulBase + 0x00000020))) & 0x00000001) {
  }
  (*((volatile unsigned long *)(ulBase + 0x00000020))) =
      (((ucRegAddr << 3) & 0x000000F8) | 0x00000001);
  while ((*((volatile unsigned long *)(ulBase + 0x00000020))) & 0x00000001) {
  }
  return ((*((volatile unsigned long *)(ulBase + 0x00000030))) & 0x0000FFFF);
}


x86 assembly (clang, -O0):
<EthernetPHYRead>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1129 <EthernetPHYRead+0x29>
jmp    110e <EthernetPHYRead+0xe>
movzbl -0x9(%rbp),%eax
shl    $0x3,%eax
and    $0xf8,%eax
or     $0x1,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     115e <EthernetPHYRead+0x5e>
jmp    1143 <EthernetPHYRead+0x43>
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rax
and    $0xffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EthernetPHYRead>:
mov    0x20(%rdi),%rax
test   $0x1,%al
jne    1100 <EthernetPHYRead>
movzbl %sil,%eax
lea    0x1(,%rax,8),%eax
movzbl %al,%eax
mov    %rax,0x20(%rdi)
nopw   0x0(%rax,%rax,1)
mov    0x20(%rdi),%rax
test   $0x1,%al
jne    1120 <EthernetPHYRead+0x20>
mov    0x30(%rdi),%rax
movzwl %ax,%eax
ret

LLVM IR (-O0):
define i64 @EthernetPHYRead(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
br label %5
5: ; preds = %12, %2
%6 = load i64, i64* %3
%7 = add i64 %6, 32
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = and i64 %9, 1
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 3
%17 = and i32 %16, 248
%18 = or i32 %17, 1
%19 = sext i32 %18 to i64
%20 = load i64, i64* %3
%21 = add i64 %20, 32
%22 = inttoptr i64 %21 to i64*
store volatile i64 %19, i64* %22
br label %23
23: ; preds = %30, %13
%24 = load i64, i64* %3
%25 = add i64 %24, 32
%26 = inttoptr i64 %25 to i64*
%27 = load volatile i64, i64* %26
%28 = and i64 %27, 1
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %23
br label %23
31: ; preds = %23
%32 = load i64, i64* %3
%33 = add i64 %32, 48
%34 = inttoptr i64 %33 to i64*
%35 = load volatile i64, i64* %34
%36 = and i64 %35, 65535
ret i64 %36
}

LLVM IR (-O2):
define i64 @EthernetPHYRead(i64 %0, i8 zeroext %1) {
%3 = add i64 %0, 32
%4 = inttoptr i64 %3 to i64*
br label %5
5: ; preds = %5, %2
%6 = load volatile i64, i64* %4
%7 = and i64 %6, 1
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = zext i8 %1 to i64
%11 = shl nuw nsw i64 %10, 3
%12 = and i64 %11, 248
%13 = or i64 %12, 1
store volatile i64 %13, i64* %4
br label %14
14: ; preds = %14, %9
%15 = load volatile i64, i64* %4
%16 = and i64 %15, 1
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %14
18: ; preds = %14
%19 = add i64 %0, 48
%20 = inttoptr i64 %19 to i64*
%21 = load volatile i64, i64* %20
%22 = and i64 %21, 65535
ret i64 %22
}
int pci_iov_resource_bar(struct pci_dev *dev, int resno,
                         enum pci_bar_type *type) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define i32 @pci_iov_resource_bar(%struct.pci_dev* %0, i32 %1, i32* %2) {
%4 = alloca %struct.pci_dev*
%5 = alloca i32
%6 = alloca i32*
store %struct.pci_dev* %0, %struct.pci_dev** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
ret i32 0
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define i32 @pci_iov_resource_bar(%struct.pci_dev* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double x, double *_sin, double *_cos) {
  *_sin = sin(x);
  *_cos = cos(x);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_textdoublefunc(void) { return GppcFinfoV1(); }


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

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

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

LLVM IR (-O2):
define i8* @pg_finfo_textdoublefunc() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_color() { printf("\033[32m"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[32m\00"
define void @set_color() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[32m\00"
define void @set_color() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
int bit_count32(unsigned v) {
  v = v - ((v >> 1) & 0x55555555);
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
  return (int)((((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24);
}


x86 assembly (clang, -O0):
<bit_count32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_count32>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @bit_count32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul i32 %18, 16843009
%20 = lshr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @bit_count32(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
int count_tokens(char *str, char delim) {
  int mode = 0;
  int ret = 0;
  while (*str) {
    if (*str == delim) {
      mode = 0;
    } else if (mode == 0) {
      mode = 1;
      ret++;
    }
    str++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<count_tokens>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <count_tokens+0x78>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <count_tokens+0x48>
movl   $0x0,-0x10(%rbp)
jmp    1167 <count_tokens+0x67>
cmpl   $0x0,-0x10(%rbp)
jne    1162 <count_tokens+0x62>
movl   $0x1,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <count_tokens+0x67>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <count_tokens+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_tokens>:
mov    (%rdi),%r9b
test   %r9b,%r9b
je     1141 <count_tokens+0x41>
add    $0x1,%rdi
xor    %r8d,%r8d
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    $0x1,%ecx
xor    %edx,%edx
cmp    %sil,%r9b
setne  %dl
cmove  %r8d,%ecx
add    %ecx,%eax
movzbl (%rdi),%r9d
add    $0x1,%rdi
mov    %edx,%ecx
test   %r9b,%r9b
jne    1120 <count_tokens+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_tokens(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %17, %5 ], [ %3, %2 ]
%7 = phi i32 [ %15, %5 ], [ 0, %2 ]
%8 = phi i32 [ %13, %5 ], [ 0, %2 ]
%9 = phi i8* [ %16, %5 ], [ %0, %2 ]
%10 = icmp eq i8 %6, %1
%11 = xor i32 %8, 1
%12 = xor i1 %10, true
%13 = zext i1 %12 to i32
%14 = select i1 %10, i32 0, i32 %11
%15 = add nuw nsw i32 %14, %7
%16 = getelementptr inbounds i8, i8* %9, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %5, %2
%20 = phi i32 [ 0, %2 ], [ %15, %5 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_init(int, char **);
int main(int argc, char *argv[]) {
  test_init(argc, argv);
  do {
    cleanup();
    printf("PASS\n");
    exit(0);
  } while (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 <test_init@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1050 <cleanup@plt>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
br label %9
9: ; preds = %2
%10 = call i32 (...) @cleanup()
%11 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; No predecessors!
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @cleanup()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 0)
unreachable
}
void free_array(char **array, int len) {
  int i;
  for (i = 0; i < len; i++) {
    free(array[i]);
  }
  free(array);
}


x86 assembly (clang, -O0):
<free_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_array+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_array+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_array>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_array+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_array+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_array(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void barf(char *s) {
  perror(s);
  exit(1);
}


x86 assembly (clang, -O0):
<barf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<barf>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @barf(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int libfun();
int main(void) { return libfun(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @libfun()
ret i32 %1
}
void finn_vec2_right(float *result) {
  result[0] = 1;
  result[1] = 0;
}


x86 assembly (clang, -O0):
<finn_vec2_right>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xeec(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec2_right>:
movq   $0x3f800000,(%rdi)
ret

LLVM IR (-O0):
define void @finn_vec2_right(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 1.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
ret void
}

LLVM IR (-O2):
define void @finn_vec2_right(float* nocapture writeonly %0) {
store float 1.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void wceex_perror(const char *msg) { fprintf(stderr, msg); }


x86 assembly (clang, -O0):
<wceex_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wceex_perror>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @wceex_perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @wceex_perror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
ret void
}
void delete (unsigned char *where, int size) {
  for (int i = 0; i < size; i++) {
    *where = 255;
    where++;
  }
}


x86 assembly (clang, -O0):
<delete>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <delete+0x3f>
mov    -0x8(%rbp),%rax
movb   $0xff,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <delete+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete>:
test   %esi,%esi
jle    1125 <delete+0x15>
push   %rax
mov    %esi,%edx
mov    $0xff,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @delete(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
f(char *arg) {
  char *const kp = arg;
  const char *ks = arg;
  char *s = ks;
  void g(void *, ...);
  g(kp, ks, s);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x0,%al
call   1030 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rsi
mov    %rdi,%rdx
xor    %eax,%eax
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @f(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
%7 = load i8*, i8** %3
store i8* %7, i8** %4
%8 = load i8*, i8** %3
store i8* %8, i8** %5
%9 = load i8*, i8** %5
store i8* %9, i8** %6
%10 = load i8*, i8** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i8* %0) {
tail call void (i8*, ...) @g(i8* %0, i8* %0, i8* %0)
ret i32 undef
}
void a() {
  char xxx[1024 * 1024] = {1};
  a();
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100000,%rsp
lea    -0x100000(%rbp),%rdi
xor    %esi,%esi
mov    $0x100000,%edx
call   1030 <memset@plt>
movb   $0x1,-0x100000(%rbp)
call   1040 <a@plt>
add    $0x100000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
jmp    1100 <a>

LLVM IR (-O0):
define void @a() {
%1 = alloca [1048576 x i8]
%2 = bitcast [1048576 x i8]* %1 to i8*
%3 = bitcast i8* %2 to <{ i8, [1048575 x i8] }>*
%4 = getelementptr inbounds <{ i8, [1048575 x i8] }>, <{ i8, [1048575 x i8] }>* %3, i32 0, i32 0
store i8 1, i8* %4
ret void
}

LLVM IR (-O2):
define void @a() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *DES_fcrypt(char const *, char const *, char *);
char *_ossl_old_des_fcrypt(const char *buf, const char *salt, char *ret) {
  return DES_fcrypt(buf, salt, ret);
}


x86 assembly (clang, -O0):
<_ossl_old_des_fcrypt>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <DES_fcrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ossl_old_des_fcrypt>:
jmp    1030 <DES_fcrypt@plt>

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

LLVM IR (-O2):
define i8* @_ossl_old_des_fcrypt(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @DES_fcrypt(i8* %0, i8* %1, i8* %2)
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int read_fsr();
void wait_ready() {
  uint8_t fsr = read_fsr();
  while (fsr & (1 << 4))
    fsr = read_fsr();
}


x86 assembly (clang, -O0):
<wait_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_fsr@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1140 <wait_ready+0x30>
mov    $0x0,%al
call   1030 <read_fsr@plt>
mov    %eax,-0x4(%rbp)
jmp    1122 <wait_ready+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_ready>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_fsr@plt>
test   $0x10,%al
jne    1120 <wait_ready+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @wait_ready() {
%1 = tail call i32 (...) @read_fsr()
%2 = and i32 %1, 16
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @read_fsr()
%6 = and i32 %5, 16
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %0
ret void
}
int omp_get_num_procs(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @omp_get_num_procs() {
ret i32 1
}

LLVM IR (-O2):
define i32 @omp_get_num_procs() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ _sethostdnsent(int);
int /*<<< orphan*/ _sethosthtent(int);
void sethostent(int stayopen) {
  _sethosthtent(stayopen);
  _sethostdnsent(stayopen);
}


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

x86 assembly (clang, -O2):
<sethostent>:
push   %rbx
mov    %edi,%ebx
call   1030 <_sethosthtent@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <_sethostdnsent@plt>

LLVM IR (-O0):
define void @sethostent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_sethosthtent(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @_sethostdnsent(i32 %5)
ret void
}

LLVM IR (-O2):
define void @sethostent(i32 %0) {
%2 = tail call i32 @_sethosthtent(i32 %0)
%3 = tail call i32 @_sethostdnsent(i32 %0)
ret void
}