xunge/DecIR huggingface dataset:
/* Variables and functions */
int *alloca(int);
int /*<<< orphan*/ store_a(int volatile *, int);
int run(int b) {
  if (b > 1) {
    int x = 0xA0000000;
    volatile int *p = alloca(sizeof(int));
    store_a(p, x);
    return 1;
  }
  return 2;
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1162 <run+0x42>
movl   $0xa0000000,-0xc(%rbp)
mov    $0x4,%edi
call   1040 <alloca@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <store_a@plt>
movl   $0x1,-0x4(%rbp)
jmp    1169 <run+0x49>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run>:
mov    $0x2,%eax
cmp    $0x2,%edi
jl     114b <run+0x2b>
push   %rax
mov    $0x4,%edi
call   1040 <alloca@plt>
mov    %rax,%rdi
mov    $0xa0000000,%esi
call   1030 <store_a@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @run(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %1
store i32 -1610612736, i32* %4
%9 = call i32* @alloca(i32 4)
store i32* %9, i32** %5
%10 = load i32*, i32** %5
%11 = load i32, i32* %4
%12 = call i32 @store_a(i32* %10, i32 %11)
store i32 1, i32* %2
br label %14
13: ; preds = %1
store i32 2, i32* %2
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @run(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32* @alloca(i32 4)
%5 = tail call i32 @store_a(i32* %4, i32 -1610612736)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ 1, %3 ], [ 2, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ ilogbf(float);
float scalbnf(float, int /*<<< orphan*/);
float significandf(float x) { return scalbnf(x, -ilogbf(x)); }


x86 assembly (clang, -O0):
<significandf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <ilogbf@plt>
movss  -0x8(%rbp),%xmm0
xor    %edi,%edi
sub    %eax,%edi
call   1030 <scalbnf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<significandf>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1040 <ilogbf@plt>
neg    %eax
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <scalbnf@plt>

LLVM IR (-O0):
define float @significandf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = call i32 @ilogbf(float %4)
%6 = sub nsw i32 0, %5
%7 = call float @scalbnf(float %3, i32 %6)
ret float %7
}

LLVM IR (-O2):
define float @significandf(float %0) {
%2 = tail call i32 @ilogbf(float %0)
%3 = sub nsw i32 0, %2
%4 = tail call float @scalbnf(float %0, i32 %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ failExpectation(char *);
void failWhen(int condition, char *expectationFailMessage) {
  if (condition)
    failExpectation(expectationFailMessage);
}


x86 assembly (clang, -O0):
<failWhen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <failWhen+0x22>
mov    -0x10(%rbp),%rdi
call   1030 <failExpectation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<failWhen>:
test   %edi,%edi
je     111c <failWhen+0xc>
mov    %rsi,%rdi
jmp    1030 <failExpectation@plt>
ret

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

LLVM IR (-O2):
define void @failWhen(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @failExpectation(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
int test_imm_FDuint16_mem(unsigned short *val) {
  return ((*val) & (0xFD << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FDuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 253
%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_FDuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 253
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void StringLower(char *sStr) {
  while (*sStr != '\0') {
    *sStr =
        (((int)*sStr) >= 'A' && ((int)*sStr) <= 'Z' ? (((int)*sStr) - 'A' + 'a')
                                                    : ((int)*sStr));
    sStr++;
  }
}


x86 assembly (clang, -O0):
<StringLower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <StringLower+0x73>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114d <StringLower+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <StringLower+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0xc(%rbp)
jmp    1157 <StringLower+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <StringLower+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StringLower>:
mov    (%rdi),%al
test   %al,%al
je     1130 <StringLower+0x30>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edx
cmp    $0x1a,%cl
movzbl %al,%eax
movzbl %dl,%ecx
cmovae %eax,%ecx
mov    %cl,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <StringLower+0x10>
ret

LLVM IR (-O0):
define void @StringLower(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %28, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %34
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %24
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 65
%23 = add nsw i32 %22, 97
br label %28
24: ; preds = %13, %8
%25 = load i8*, i8** %2
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
br label %28
28: ; preds = %24, %18
%29 = phi i32 [ %23, %18 ], [ %27, %24 ]
%30 = trunc i32 %29 to i8
%31 = load i8*, i8** %2
store i8 %30, i8* %31
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %2
br label %3
34: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @StringLower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
%9 = add nuw nsw i8 %5, 32
%10 = select i1 %8, i8 %9, i8 %5
store i8 %10, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
ret void
}
/* Variables and functions */
int device_set_irq_affinity_list(int, unsigned long, unsigned long);
int device_set_irq_affinity(int irq, unsigned long cpu) {
  return device_set_irq_affinity_list(irq, cpu, cpu);
}


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

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

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

LLVM IR (-O2):
define i32 @device_set_irq_affinity(i32 %0, i64 %1) {
%3 = tail call i32 @device_set_irq_affinity_list(i32 %0, i64 %1, i64 %1)
ret i32 %3
}
/* Type definitions */
struct symbol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ x86_symbol(struct symbol *);
void emit_one_symbol(struct symbol *sym) { x86_symbol(sym); }


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

x86 assembly (clang, -O2):
<emit_one_symbol>:
jmp    1030 <x86_symbol@plt>

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

LLVM IR (-O2):
%struct.symbol = type { i32 }
define void @emit_one_symbol(%struct.symbol* %0) {
%2 = tail call i32 @x86_symbol(%struct.symbol* %0)
ret void
}
int f18_a() {
  int x = 0;
  return (x = 10);
}


x86 assembly (clang, -O0):
<f18_a>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x4(%rbp)
mov    $0xa,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f18_a() {
ret i32 10
}
/* Variables and functions */
int min_inserts(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void main() {
  char str[] = "race";
  int len = strlen(str);
  printf("Min inserts required to make palind = %d",
         min_inserts(str, 0, len - 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
lea    -0x5(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1050 <min_inserts@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x65636172,0x8(%rsp)
65
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <min_inserts@plt>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [5 x i8] c"race\00"
@.str = [41 x i8] c"Min inserts required to make palind = %d\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = alloca i32
%3 = bitcast [5 x i8]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %2
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = call i32 @min_inserts(i8* %6, i32 0, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@__const.main.str = [5 x i8] c"race\00"
@.str = [41 x i8] c"Min inserts required to make palind = %d\00"
define void @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = add nsw i32 %3, -1
%5 = call i32 @min_inserts(i8* %2, i32 0, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
int eapol_sm_failed(struct eapol_sm *sm) { return 0; }


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

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

LLVM IR (-O0):
%struct.eapol_sm = type opaque
define i32 @eapol_sm_failed(%struct.eapol_sm* %0) {
%2 = alloca %struct.eapol_sm*
store %struct.eapol_sm* %0, %struct.eapol_sm** %2
ret i32 0
}

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define i32 @eapol_sm_failed(%struct.eapol_sm* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct list_node {
  int dummy;
};

/* Variables and functions */
void *list_node_to_off_(struct list_node *node, size_t off) {
  return (void *)((char *)node - off);
}


x86 assembly (clang, -O0):
<list_node_to_off_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_node_to_off_>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
%struct.list_node = type { i32 }
define i8* @list_node_to_off_(%struct.list_node* %0, i64 %1) {
%3 = alloca %struct.list_node*
%4 = alloca i64
store %struct.list_node* %0, %struct.list_node** %3
store i64 %1, i64* %4
%5 = load %struct.list_node*, %struct.list_node** %3
%6 = bitcast %struct.list_node* %5 to i8*
%7 = load i64, i64* %4
%8 = sub i64 0, %7
%9 = getelementptr inbounds i8, i8* %6, i64 %8
ret i8* %9
}

LLVM IR (-O2):
%struct.list_node = type { i32 }
define i8* @list_node_to_off_(%struct.list_node* readnone %0, i64 %1) {
%3 = bitcast %struct.list_node* %0 to i8*
%4 = sub i64 0, %1
%5 = getelementptr inbounds i8, i8* %3, i64 %4
ret i8* %5
}
w(d, i, j) { return d ? w(d - 1, j, 3 - i) : 4 * i + j; }


x86 assembly (clang, -O0):
<w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <w+0x39>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
mov    $0x3,%edx
sub    -0x8(%rbp),%edx
call   1030 <w@plt>
mov    %eax,-0x10(%rbp)
jmp    1155 <w+0x45>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w>:
test   %edi,%edi
je     1145 <w+0x45>
lea    -0x1(%rdi),%r8d
mov    %edi,%r9d
and    $0x7,%r9d
je     1135 <w+0x35>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %esi,%ecx
mov    %edx,%esi
mov    $0x3,%edx
sub    %ecx,%edx
add    $0x1,%eax
cmp    %eax,%r9d
jne    1120 <w+0x20>
sub    %eax,%edi
cmp    $0x7,%r8d
jb     1145 <w+0x45>
nopl   0x0(%rax,%rax,1)
add    $0xfffffff8,%edi
jne    1140 <w+0x40>
lea    (%rdx,%rsi,4),%eax
ret

LLVM IR (-O0):
define i32 @w(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub nsw i32 3, %13
%15 = call i32 @w(i32 %11, i32 %12, i32 %14)
br label %21
16: ; preds = %3
%17 = load i32, i32* %5
%18 = mul nsw i32 4, %17
%19 = load i32, i32* %6
%20 = add nsw i32 %18, %19
br label %21
21: ; preds = %16, %9
%22 = phi i32 [ %15, %9 ], [ %20, %16 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @w(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %29, label %5
5: ; preds = %3
%6 = add i32 %0, -1
%7 = and i32 %0, 7
%8 = icmp eq i32 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %5, %9
%10 = phi i32 [ %15, %9 ], [ %2, %5 ]
%11 = phi i32 [ %10, %9 ], [ %1, %5 ]
%12 = phi i32 [ %14, %9 ], [ %0, %5 ]
%13 = phi i32 [ %16, %9 ], [ 0, %5 ]
%14 = add nsw i32 %12, -1
%15 = sub nsw i32 3, %11
%16 = add i32 %13, 1
%17 = icmp eq i32 %16, %7
br i1 %17, label %18, label %9
18: ; preds = %9, %5
%19 = phi i32 [ undef, %5 ], [ %10, %9 ]
%20 = phi i32 [ undef, %5 ], [ %15, %9 ]
%21 = phi i32 [ %2, %5 ], [ %15, %9 ]
%22 = phi i32 [ %1, %5 ], [ %10, %9 ]
%23 = phi i32 [ %0, %5 ], [ %14, %9 ]
%24 = icmp ult i32 %6, 7
br i1 %24, label %29, label %25
25: ; preds = %18, %25
%26 = phi i32 [ %27, %25 ], [ %23, %18 ]
%27 = add nsw i32 %26, -8
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %25
29: ; preds = %18, %25, %3
%30 = phi i32 [ %1, %3 ], [ %19, %18 ], [ %22, %25 ]
%31 = phi i32 [ %2, %3 ], [ %20, %18 ], [ %21, %25 ]
%32 = shl nsw i32 %30, 2
%33 = add nsw i32 %32, %31
ret i32 %33
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
__attribute__((noreturn)) void _Exit(int status) { _exit(status); }


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

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

LLVM IR (-O0):
define void @_Exit(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 @_Exit(i32 %0) {
%2 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
scalar_t__ fastfib(int);
scalar_t__ fastfib_v2(int);
scalar_t__ fib(int);
int main(void) {
  int x = 0;
  x += fib(10);
  x += fastfib(10);
  x += fastfib_v2(10);
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0xa,%edi
call   1050 <fib@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <fastfib@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    $0xa,%edi
call   1040 <fastfib_v2@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xa,%edi
call   1050 <fib@plt>
mov    %rax,%r14
mov    $0xa,%edi
call   1030 <fastfib@plt>
mov    %rax,%rbx
add    %r14d,%ebx
mov    $0xa,%edi
call   1040 <fastfib_v2@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i64 @fib(i32 10)
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %5, %3
%7 = trunc i64 %6 to i32
store i32 %7, i32* %2
%8 = call i64 @fastfib(i32 10)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = add nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = call i64 @fastfib_v2(i32 10)
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = add nsw i64 %15, %13
%17 = trunc i64 %16 to i32
store i32 %17, i32* %2
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @fib(i32 10)
%2 = tail call i64 @fastfib(i32 10)
%3 = add i64 %2, %1
%4 = tail call i64 @fastfib_v2(i32 10)
%5 = add i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
int export_fun(int x, int y) { return x + y + 6; }


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

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

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

LLVM IR (-O2):
define i32 @export_fun(i32 %0, i32 %1) {
%3 = add i32 %0, 6
%4 = add i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int linearSearch(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int array1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  printf("%d\n", linearSearch(array1, 3, 9));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x3,%esi
mov    $0x9,%edx
call   1030 <linearSearch@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3,%esi
mov    $0x9,%edx
call   1030 <linearSearch@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.array1 = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = bitcast [9 x i32]* %3 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = call i32 @linearSearch(i32* %5, i32 3, i32 9)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ERR_load_SSL_strings();
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SSL_library_init();
void apps_startup() {
  ERR_load_crypto_strings();
  ERR_load_SSL_strings();
  OpenSSL_add_all_algorithms();
  SSL_library_init();
}


x86 assembly (clang, -O0):
<apps_startup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1030 <ERR_load_SSL_strings@plt>
mov    $0x0,%al
call   1050 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1040 <SSL_library_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<apps_startup>:
push   %rax
xor    %eax,%eax
call   1060 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1030 <ERR_load_SSL_strings@plt>
xor    %eax,%eax
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <SSL_library_init@plt>

LLVM IR (-O0):
define void @apps_startup() {
%1 = call i32 (...) @ERR_load_crypto_strings()
%2 = call i32 (...) @ERR_load_SSL_strings()
%3 = call i32 (...) @OpenSSL_add_all_algorithms()
%4 = call i32 (...) @SSL_library_init()
ret void
}

LLVM IR (-O2):
define void @apps_startup() {
%1 = tail call i32 (...) @ERR_load_crypto_strings()
%2 = tail call i32 (...) @ERR_load_SSL_strings()
%3 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%4 = tail call i32 (...) @SSL_library_init()
ret void
}
void callee_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @callee_1_1_2() {
ret void
}
int misc_ReturnValue(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @misc_ReturnValue() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ done(int /*<<< orphan*/);
int /*<<< orphan*/ getargs(int, char **);
int /*<<< orphan*/ lalr();
int /*<<< orphan*/ lr0();
int /*<<< orphan*/ make_parser();
int /*<<< orphan*/ open_files();
int /*<<< orphan*/ output();
int /*<<< orphan*/ reader();
int /*<<< orphan*/ set_signals();
int /*<<< orphan*/ verbose();
int main(int argc, char **argv) {
  set_signals();
  getargs(argc, argv);
  open_files();
  reader();
  lr0();
  lalr();
  make_parser();
  verbose();
  output();
  done(0);
  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   10c0 <set_signals@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <getargs@plt>
mov    $0x0,%al
call   1070 <open_files@plt>
mov    $0x0,%al
call   1060 <reader@plt>
mov    $0x0,%al
call   1030 <lr0@plt>
mov    $0x0,%al
call   1090 <lalr@plt>
mov    $0x0,%al
call   1080 <make_parser@plt>
mov    $0x0,%al
call   10a0 <verbose@plt>
mov    $0x0,%al
call   1040 <output@plt>
xor    %edi,%edi
call   1050 <done@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   10c0 <set_signals@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   10b0 <getargs@plt>
xor    %eax,%eax
call   1070 <open_files@plt>
xor    %eax,%eax
call   1060 <reader@plt>
xor    %eax,%eax
call   1030 <lr0@plt>
xor    %eax,%eax
call   1090 <lalr@plt>
xor    %eax,%eax
call   1080 <make_parser@plt>
xor    %eax,%eax
call   10a0 <verbose@plt>
xor    %eax,%eax
call   1040 <output@plt>
xor    %edi,%edi
call   1050 <done@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
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 (...) @set_signals()
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @getargs(i32 %7, i8** %8)
%10 = call i32 (...) @open_files()
%11 = call i32 (...) @reader()
%12 = call i32 (...) @lr0()
%13 = call i32 (...) @lalr()
%14 = call i32 (...) @make_parser()
%15 = call i32 (...) @verbose()
%16 = call i32 (...) @output()
%17 = call i32 @done(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @set_signals()
%4 = tail call i32 @getargs(i32 %0, i8** %1)
%5 = tail call i32 (...) @open_files()
%6 = tail call i32 (...) @reader()
%7 = tail call i32 (...) @lr0()
%8 = tail call i32 (...) @lalr()
%9 = tail call i32 (...) @make_parser()
%10 = tail call i32 (...) @verbose()
%11 = tail call i32 (...) @output()
%12 = tail call i32 @done(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void ident(int n) {
  while (n--)
    putchar('\t');
}


x86 assembly (clang, -O0):
<ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <ident+0x2e>
mov    $0x9,%edi
call   1030 <putchar@plt>
jmp    111b <ident+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ident>:
push   %rbx
test   %edi,%edi
je     112f <ident+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x9,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <ident+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ident(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @putchar(i8 signext 9)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
unsigned int CharClass_IsNumeric(char ch) {
  return (ch >= '0') && (ch <= '9');
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<CharClass_IsNumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <CharClass_IsNumeric+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CharClass_IsNumeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @CharClass_IsNumeric(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @CharClass_IsNumeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int main(void) {
  main();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
main() { int y[] = {1, 2, {3, 4}, 5}; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.y = [4 x i32] [i32 1, i32 2, i32 3, i32 5]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
double ddot(int N, double *X, int INCX, double *Y, int INCY) {
  extern double ddot_(int *N, double *X, int *INCX, double *Y, int *INCY);
  return ddot_(&N, X, &INCX, Y, &INCY);
}


x86 assembly (clang, -O0):
<ddot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <ddot_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddot>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <ddot_@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @ddot(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call double @ddot_(i32* %6, double* %1, i32* %7, double* %3, i32* %8)
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void op0xEF(void) { rst(0x28); }


x86 assembly (clang, -O0):
<op0xEF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
call   1030 <rst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op0xEF>:
mov    $0x28,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @op0xEF() {
%1 = call i32 @rst(i32 40)
ret void
}

LLVM IR (-O2):
define void @op0xEF() {
%1 = tail call i32 @rst(i32 40)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
char *ndesc(char *buf, char *name, char *add) {
  snprintf(buf, 100, "%s %s", name, add);
  return buf;
}


x86 assembly (clang, -O0):
<ndesc>:
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),%rcx
mov    -0x18(%rbp),%r8
mov    $0x64,%esi
lea    0xec4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndesc>:
push   %rbx
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rbx
lea    0xedf(%rip),%rdx
mov    $0x64,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
define i8* @ndesc(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 i32 @snprintf(i8* %7, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
define i8* @ndesc(i8* returned %0, i8* %1, i8* %2) {
%4 = tail call i32 @snprintf(i8* %0, i32 100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret i8* %0
}
void glDeleteFramebuffers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteFramebuffers() {
ret void
}
/* Variables and functions */
const char **get_languages(void) {
  static const char *l[] = {"Katrin", "Hanswurscht", NULL};
  return l;
}


x86 assembly (clang, -O0):
<get_languages>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@get_languages.l = internal global [3 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [7 x i8] c"Katrin\00"
@.str.1 = [12 x i8] c"Hanswurscht\00"
define i8** @get_languages() {
ret i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @get_languages.l, i64 0, i64 0)
}

LLVM IR (-O2):
@get_languages.l = internal global [3 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [7 x i8] c"Katrin\00"
@.str.1 = [12 x i8] c"Hanswurscht\00"
define i8** @get_languages() {
ret i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @get_languages.l, i64 0, i64 0)
}
double square(double d) { return d * d; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @square(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @square(double %0) {
%2 = fmul double %0, %0
ret double %2
}
void REMR3BreakpointSet(void) {}


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

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

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

LLVM IR (-O2):
define void @REMR3BreakpointSet() {
ret void
}
int inc_pod_index(int i) { return (i + 1) % 257; }


x86 assembly (clang, -O0):
<inc_pod_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x101,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_pod_index>:
add    $0x1,%edi
movslq %edi,%rax
imul   $0x7f807f81,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x8,%edx
add    %ecx,%edx
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @inc_pod_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = srem i32 %4, 257
ret i32 %5
}

LLVM IR (-O2):
define i32 @inc_pod_index(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 257
ret i32 %3
}
/* Variables and functions */
int ebbrt_newlib_exit(int);
int _exit(int val) { return ebbrt_newlib_exit(val); }


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

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

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

LLVM IR (-O2):
define i32 @_exit(i32 %0) {
%2 = tail call i32 @ebbrt_newlib_exit(i32 %0)
unreachable
}
/* Variables and functions */
int application_unregister(char *);
int unload_module() { return application_unregister("Action:"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"Action:\00"
define i32 @unload_module() {
%1 = tail call i32 @application_unregister(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int exact_square(int number) {
  int count;
  for (count = 0; count * count <= number; count++) {
    if (count * count == number) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     114d <exact_square+0x4d>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113a <exact_square+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1154 <exact_square+0x54>
jmp    113f <exact_square+0x3f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <exact_square+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
test   %edi,%edi
js     1120 <exact_square+0x20>
xor    %edx,%edx
mov    $0x1,%eax
mov    $0x1,%ecx
cmp    %edi,%edx
je     1122 <exact_square+0x22>
mov    %ecx,%edx
imul   %ecx,%edx
add    $0x1,%ecx
cmp    %edi,%edx
jle    1110 <exact_square+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %6
3: ; preds = %6
%4 = mul nsw i32 %10, %10
%5 = icmp sgt i32 %4, %0
br i1 %5, label %11, label %6
6: ; preds = %1, %3
%7 = phi i32 [ %4, %3 ], [ 0, %1 ]
%8 = phi i32 [ %10, %3 ], [ 0, %1 ]
%9 = icmp eq i32 %7, %0
%10 = add nuw nsw i32 %8, 1
br i1 %9, label %11, label %3
11: ; preds = %6, %3, %1
%12 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdout;
void sound_bell(void) {
  putchar(7);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<sound_bell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sound_bell>:
push   %rax
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @sound_bell() {
%1 = call i32 @putchar(i32 7)
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @sound_bell() {
%1 = tail call i32 @putchar(i32 7)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("USAGE: hex2float <hex>\n", stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"USAGE: hex2float <hex>\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"USAGE: hex2float <hex>\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void setfloat(arrayptr, num_cols, row, col, value) float *arrayptr;
short num_cols;
short row, col;
float value;
{
  int position;
  position = row * num_cols + col;
  *(arrayptr + position) = value;
}


x86 assembly (clang, -O0):
<setfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %edx,%ecx
mov    %si,%dx
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %cx,-0xc(%rbp)
mov    %ax,-0xe(%rbp)
movss  %xmm0,-0x14(%rbp)
movswl -0xc(%rbp),%eax
movswl -0xa(%rbp),%ecx
imul   %ecx,%eax
movswl -0xe(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setfloat>:
cvtsd2ss %xmm0,%xmm0
movswl %dx,%eax
movswl %si,%edx
imul   %eax,%edx
movswl %cx,%eax
add    %edx,%eax
cltq
movss  %xmm0,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @setfloat(float* %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = alloca float*
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = alloca float
%11 = alloca i32
%12 = trunc i32 %1 to i16
%13 = trunc i32 %2 to i16
%14 = trunc i32 %3 to i16
%15 = fptrunc double %4 to float
store float* %0, float** %6
store i16 %12, i16* %7
store i16 %13, i16* %8
store i16 %14, i16* %9
store float %15, float* %10
%16 = load i16, i16* %8
%17 = sext i16 %16 to i32
%18 = load i16, i16* %7
%19 = sext i16 %18 to i32
%20 = mul nsw i32 %17, %19
%21 = load i16, i16* %9
%22 = sext i16 %21 to i32
%23 = add nsw i32 %20, %22
store i32 %23, i32* %11
%24 = load float, float* %10
%25 = load float*, float** %6
%26 = load i32, i32* %11
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %25, i64 %27
store float %24, float* %28
ret void
}

LLVM IR (-O2):
define void @setfloat(float* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, double %4) {
%6 = fptrunc double %4 to float
%7 = shl i32 %2, 16
%8 = ashr exact i32 %7, 16
%9 = shl i32 %1, 16
%10 = ashr exact i32 %9, 16
%11 = mul nsw i32 %8, %10
%12 = shl i32 %3, 16
%13 = ashr exact i32 %12, 16
%14 = add nsw i32 %11, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %0, i64 %15
store float %6, float* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *calloc(size_t, size_t);
void *my_calloc(size_t nmemb, size_t size) {
  void *ptr = calloc(nmemb, size);
  assert(ptr != NULL);
  return (ptr);
}


x86 assembly (clang, -O0):
<my_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @my_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @my_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ tester_debug(char *, char const *);
void test_debug(const char *str, void *user_data) { tester_debug("%s", str); }


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

x86 assembly (clang, -O2):
<test_debug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tester_debug@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @test_debug(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @tester_debug(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}

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