xunge/DecIR huggingface dataset:
void test_ispunct_macro(void) {
  int i, j;
  for (i = -127; i < 256;)
    j = i, printf("%s: %d -> %d\n", __FUNCTION__, j, ispunct(i++) ? 1 : 0);
}


x86 assembly (clang, -O0):
<test_ispunct_macro>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffff81,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1184 <test_ispunct_macro+0x64>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1040 <ispunct@plt>
mov    -0xc(%rbp),%edx
mov    %eax,%esi
xor    %ecx,%ecx
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%ecx
lea    0xe8f(%rip),%rdi
lea    0xe96(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <test_ispunct_macro+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ispunct_macro>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0xffffff81,%ebx
lea    0xecd(%rip),%r14
lea    0xed4(%rip),%r15
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%ebp
mov    %ebx,%edi
call   1040 <ispunct@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%ebx
cmp    $0x100,%ebp
jne    1140 <test_ispunct_macro+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%s: %d -> %d\0A\00"
@__FUNCTION__.test_ispunct_macro = [19 x i8] c"test_ispunct_macro\00"
define void @test_ispunct_macro() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ -127, %0 ], [ %3, %1 ]
%3 = add nsw i32 %2, 1
%4 = tail call i32 @ispunct(i32 %2)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__FUNCTION__.test_ispunct_macro, i64 0, i64 0), i32 %2, i32 %6)
%8 = icmp eq i32 %3, 256
br i1 %8, label %9, label %1
9: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverseWords(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char buf[100];
  scanf("%[^\n]", buf);
  reverseWords(buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <reverseWords@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
call   1040 <reverseWords@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%[^\0A]\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @reverseWords(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%[^\0A]\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverseWords(i8* %2)
ret i32 0
}
void test3(int *i) {}


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

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

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

LLVM IR (-O2):
define void @test3(i32* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned long long __readeflags();
__attribute__((no, noclone)) unsigned long long int
readeflags_test(unsigned int a, unsigned int b) {
  volatile char x = (a == b);
  return __readeflags();
}


x86 assembly (clang, -O0):
<readeflags_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1030 <__readeflags@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readeflags_test>:
cmp    %esi,%edi
sete   -0x1(%rsp)
xor    %eax,%eax
jmp    1030 <__readeflags@plt>

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

LLVM IR (-O2):
define i64 @readeflags_test(i32 %0, i32 %1) {
%3 = alloca i8
%4 = icmp eq i32 %0, %1
%5 = zext i1 %4 to i8
store volatile i8 %5, i8* %3
%6 = tail call i64 (...) @__readeflags()
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void draw_house(char **output, int height) {
  int top_row = (40 + height) * 2 + 1;
  while (top_row--) {
    if (output[top_row] != NULL) {
      puts(output[top_row]);
    }
  }
}


x86 assembly (clang, -O0):
<draw_house>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x28,%eax
shl    $0x1,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     116b <draw_house+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1166 <draw_house+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
jmp    112e <draw_house+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_house>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    (%rsi,%rsi,1),%eax
add    $0x50,%eax
movslq %eax,%rbx
jmp    1136 <draw_house+0x26>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffffffffffff,%rbx
jae    1146 <draw_house+0x36>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <draw_house+0x20>
call   1030 <puts@plt>
jmp    1130 <draw_house+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @draw_house(i8** nocapture %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = add i32 %3, 80
%5 = sext i32 %4 to i64
br label %6
6: ; preds = %2, %13
%7 = phi i64 [ %5, %2 ], [ %14, %13 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 @puts(i8* %9)
br label %13
13: ; preds = %11, %6
%14 = add nsw i64 %7, -1
%15 = icmp eq i64 %7, 0
br i1 %15, label %16, label %6
16: ; preds = %13
ret void
}
_Complex short foo_short(_Complex short x) { return x; }


x86 assembly (clang, -O0):
<foo_short>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    -0x10(%rbp),%cx
mov    -0xe(%rbp),%ax
mov    %cx,-0x8(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_short>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @foo_short(i32 %0) {
%2 = alloca { i16, i16 }
%3 = alloca { i16, i16 }
%4 = bitcast { i16, i16 }* %3 to i32*
store i32 %0, i32* %4
%5 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %3, i32 0, i32 0
%6 = load i16, i16* %5
%7 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %3, i32 0, i32 1
%8 = load i16, i16* %7
%9 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %2, i32 0, i32 0
%10 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %2, i32 0, i32 1
store i16 %6, i16* %9
store i16 %8, i16* %10
%11 = bitcast { i16, i16 }* %2 to i32*
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo_short(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int bswap_64(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
uint64_t knot_wire_read_u48(const uint8_t *pos) {
  uint64_t input = 0;
  memcpy((void *)&input + 1, (void *)pos, 6);
  return bswap_64(input) >> 8;
}


x86 assembly (clang, -O0):
<knot_wire_read_u48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <bswap_64@plt>
sar    $0x8,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<knot_wire_read_u48>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <bswap_64@plt>
sar    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @knot_wire_read_u48(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = getelementptr i8, i8* %4, i64 1
%6 = load i32*, i32** %2
%7 = bitcast i32* %6 to i8*
%8 = call i32 @memcpy(i8* %5, i8* %7, i32 6)
%9 = load i32, i32* %3
%10 = call i32 @bswap_64(i32 %9)
%11 = ashr i32 %10, 8
ret i32 %11
}

LLVM IR (-O2):
define i32 @knot_wire_read_u48(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = bitcast i32* %0 to i8*
%6 = call i32 @memcpy(i8* %4, i8* %5, i32 6)
%7 = load i32, i32* %2
%8 = call i32 @bswap_64(i32 %7)
%9 = ashr i32 %8, 8
ret i32 %9
}
/* Variables and functions */
int *f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int *a = f();
  g();
  printf("MAIN says: %d %d %d\n", a[0], a[1], a[2]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <g@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"MAIN says: %d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @f()
store i32* %3, i32** %2
%4 = call i32 (...) @g()
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %10, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"MAIN says: %d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32* (...) @f()
%2 = tail call i32 (...) @g()
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void clr_scr() { printf("%c[2j", 0x1B); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%c[2j\00"
define void @clr_scr() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 27)
ret void
}
void g_slist_delete_link() {}


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

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

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

LLVM IR (-O2):
define void @g_slist_delete_link() {
ret void
}
/* Type definitions */
struct bloom {
  int dummy;
};

/* Variables and functions */
int bloom_check_add(struct bloom *, void const *, int, int);
int bloom_add(struct bloom *bloom, const void *buffer, int len) {
  return bloom_check_add(bloom, buffer, len, 1);
}


x86 assembly (clang, -O0):
<bloom_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x1,%ecx
call   1030 <bloom_check_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bloom_add>:
mov    $0x1,%ecx
jmp    1030 <bloom_check_add@plt>

LLVM IR (-O0):
%struct.bloom = type { i32 }
define i32 @bloom_add(%struct.bloom* %0, i8* %1, i32 %2) {
%4 = alloca %struct.bloom*
%5 = alloca i8*
%6 = alloca i32
store %struct.bloom* %0, %struct.bloom** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.bloom*, %struct.bloom** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @bloom_check_add(%struct.bloom* %7, i8* %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.bloom = type { i32 }
define i32 @bloom_add(%struct.bloom* %0, i8* %1, i32 %2) {
%4 = tail call i32 @bloom_check_add(%struct.bloom* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  for (;;) {
    printf("one\n");
    for (int i = 0; i < 100000000; ++i) {
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jge    1152 <main+0x42>
jmp    1144 <main+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <main+0x22>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"one\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %12, %0
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %5
5: ; preds = %9, %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 100000000
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %5
12: ; preds = %5
br label %3
}

LLVM IR (-O2):
@str = [4 x i8] c"one\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %1
}
remove_file(fname) char *fname;
{ return (unlink(fname)); }


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

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

LLVM IR (-O0):
define i32 @remove_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @remove_file(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
void dv2_copy(double *a, double *b) {
  a[0] = b[0];
  a[1] = b[1];
}


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

x86 assembly (clang, -O2):
<dv2_copy>:
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @dv2_copy(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %3
%9 = getelementptr inbounds double, double* %8, i64 0
store double %7, double* %9
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @dv2_copy(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
store double %3, double* %0
%4 = getelementptr inbounds double, double* %1, i64 1
%5 = load double, double* %4
%6 = getelementptr inbounds double, double* %0, i64 1
store double %5, double* %6
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ clientaddr;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int ax_web_socket_accept(int socket_fd, char *remote_ip) {
  int client_fd = -1;
  struct sockaddr_in clientaddr;
  socklen_t clientaddr_len = sizeof(clientaddr);
  client_fd =
      accept(socket_fd, (struct sockaddr *)&clientaddr, &clientaddr_len);
  if (client_fd <= 0) {
    return -1;
  }
  return client_fd;
}


x86 assembly (clang, -O0):
<ax_web_socket_accept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x4,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <accept@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1156 <ax_web_socket_accept+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <ax_web_socket_accept+0x4c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ax_web_socket_accept>:
sub    $0x18,%rsp
movl   $0x4,0xc(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <accept@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovle %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @ax_web_socket_accept(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.sockaddr_in
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 -1, i32* %6
store i32 4, i32* %8
%9 = load i32, i32* %4
%10 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%11 = call i32 @accept(i32 %9, %struct.sockaddr* %10, i32* %8)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp sle i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %6
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @ax_web_socket_accept(i32 %0, i8* nocapture readnone %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = bitcast i32* %4 to i8*
store i32 4, i32* %4
%7 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%8 = call i32 @accept(i32 %0, %struct.sockaddr* %7, i32* %4)
%9 = icmp slt i32 %8, 1
%10 = select i1 %9, i32 -1, i32 %8
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ cube_panel(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void cube_clear(int buffer) {
  int panel;
  for (panel = 0; panel < 8; panel++)
    cube_panel(panel, buffer, 0, 0, 0);
}


x86 assembly (clang, -O0):
<cube_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    114e <cube_clear+0x3e>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <cube_panel@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <cube_clear+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cube_clear>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x1,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x2,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x3,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x4,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x5,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x6,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <cube_panel@plt>
mov    $0x7,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rbx
jmp    1030 <cube_panel@plt>

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

LLVM IR (-O2):
define void @cube_clear(i32 %0) {
%2 = tail call i32 @cube_panel(i32 0, i32 %0, i32 0, i32 0, i32 0)
%3 = tail call i32 @cube_panel(i32 1, i32 %0, i32 0, i32 0, i32 0)
%4 = tail call i32 @cube_panel(i32 2, i32 %0, i32 0, i32 0, i32 0)
%5 = tail call i32 @cube_panel(i32 3, i32 %0, i32 0, i32 0, i32 0)
%6 = tail call i32 @cube_panel(i32 4, i32 %0, i32 0, i32 0, i32 0)
%7 = tail call i32 @cube_panel(i32 5, i32 %0, i32 0, i32 0, i32 0)
%8 = tail call i32 @cube_panel(i32 6, i32 %0, i32 0, i32 0, i32 0)
%9 = tail call i32 @cube_panel(i32 7, i32 %0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t int2Byte(uint32_t i, uint8_t pos) {
  uint32_t r = i << (pos * 8);
  return r >> 24;
}


x86 assembly (clang, -O0):
<int2Byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int2Byte>:
mov    %edi,%eax
lea    0x0(,%rsi,8),%ecx
shl    %cl,%eax
sar    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @int2Byte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = shl i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = ashr i32 %10, 24
ret i32 %11
}

LLVM IR (-O2):
define i32 @int2Byte(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = shl i32 %0, %3
%5 = ashr i32 %4, 24
ret i32 %5
}
/* Type definitions */
typedef size_t uint8_t;
typedef int uint16_t;

/* Variables and functions */
const uint8_t *pgpword(uint16_t *wordlist, const uint8_t n, const size_t idx) {
  return ((const uint8_t *)wordlist + wordlist[(idx % 2) * 256 + n]);
}


x86 assembly (clang, -O0):
<pgpword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
and    $0x1,%rdx
shl    $0x8,%rdx
add    -0x10(%rbp),%rdx
movslq (%rcx,%rdx,4),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pgpword>:
and    $0x1,%edx
shl    $0x8,%rdx
add    %rsi,%rdx
movslq (%rdi,%rdx,4),%rax
lea    (%rdi,%rax,8),%rax
ret

LLVM IR (-O0):
define i64* @pgpword(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i64*
%9 = load i32*, i32** %4
%10 = load i64, i64* %6
%11 = urem i64 %10, 2
%12 = mul i64 %11, 256
%13 = load i64, i64* %5
%14 = add i64 %12, %13
%15 = getelementptr inbounds i32, i32* %9, i64 %14
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i64, i64* %8, i64 %17
ret i64* %18
}

LLVM IR (-O2):
define i64* @pgpword(i32* %0, i64 %1, i64 %2) {
%4 = bitcast i32* %0 to i64*
%5 = shl i64 %2, 8
%6 = and i64 %5, 256
%7 = add i64 %6, %1
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i64, i64* %4, i64 %10
ret i64* %11
}
long long test() {
  long long x = ((long long)1234 << 32) + 5678;
  return x;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movabs $0x4d20000162e,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movabs $0x4d20000162e,%rax
ret

LLVM IR (-O0):
define i64 @test() {
%1 = alloca i64
store i64 5299989648942, i64* %1
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @test() {
ret i64 5299989648942
}
/* Variables and functions */
void bfin_gpio_set_value(unsigned int, int);
void gpio_set_value(unsigned gpio, int value) {
  return bfin_gpio_set_value(gpio, value);
}


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

x86 assembly (clang, -O2):
<gpio_set_value>:
jmp    1030 <bfin_gpio_set_value@plt>

LLVM IR (-O0):
define void @gpio_set_value(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
ret void
}

LLVM IR (-O2):
define void @gpio_set_value(i32 %0, i32 %1) {
tail call void @bfin_gpio_set_value(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __print_float(float);
int /*<<< orphan*/ __print_int(int);
int main() {
  int a, b, c;
  float d, e, f;
  a = 5;
  b = 6;
  c = (a += b, b - a);
  __print_int(c);
  d = 4.7;
  e = 9.2;
  f = (e -= d, e - d);
  __print_float(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <__print_int@plt>
movss  0xea5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe94(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffffb,%edi
call   1040 <__print_int@plt>
movss  0xecd(%rip),%xmm0
call   1030 <__print_float@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i32 5, i32* %2
store i32 6, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = call i32 @__print_int(i32 %14)
store float 0x4012CCCCC0000000, float* %5
store float 0x4022666660000000, float* %6
%16 = load float, float* %5
%17 = load float, float* %6
%18 = fsub float %17, %16
store float %18, float* %6
%19 = load float, float* %6
%20 = load float, float* %5
%21 = fsub float %19, %20
store float %21, float* %7
%22 = load float, float* %7
%23 = call i32 @__print_float(float %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 -5)
%2 = tail call i32 @__print_float(float 0xBFC9999800000000)
ret i32 0
}
/* Variables and functions */
scalar_t__ cstring_at_white(char const *);
char *cstring_skip_white(const char *str) {
  while (cstring_at_white(str)) {
    ++str;
  }
  return (char *)str;
}


x86 assembly (clang, -O0):
<cstring_skip_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <cstring_at_white@plt>
cmp    $0x0,%rax
je     1140 <cstring_skip_white+0x30>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <cstring_skip_white+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstring_skip_white>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <cstring_at_white@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <cstring_skip_white+0x10>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @cstring_skip_white(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i64 @cstring_at_white(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int main(void) {
  int j = 0;
  while (j++ < 3) {
    int i;
    printf("%p\n", &i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x3,%eax
jge    114f <main+0x3f>
lea    0xebf(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <printf@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0x4(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp slt i32 %5, 3
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}
OP(fd, c7) {
  illegal_1();
  op_c7();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_c7()
ret i32 undef
}
/* Variables and functions */
unsigned long long _rdpmc(int);
unsigned long long test_rdpmc(int a) { return _rdpmc(a); }


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

x86 assembly (clang, -O2):
<test_rdpmc>:
jmp    1030 <_rdpmc@plt>

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

LLVM IR (-O2):
define i64 @test_rdpmc(i32 %0) {
%2 = tail call i64 @_rdpmc(i32 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ dbg_write(int);
void dbg_write_char(char msg) { dbg_write(0x02 | ((msg & 0xff) << 16)); }


x86 assembly (clang, -O0):
<dbg_write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
and    $0xff,%edi
shl    $0x10,%edi
or     $0x2,%edi
call   1030 <dbg_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_write_char>:
movzbl %dil,%edi
shl    $0x10,%edi
or     $0x2,%edi
jmp    1030 <dbg_write@plt>

LLVM IR (-O0):
define void @dbg_write_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 16
%7 = or i32 2, %6
%8 = call i32 @dbg_write(i32 %7)
ret void
}

LLVM IR (-O2):
define void @dbg_write_char(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 16
%4 = or i32 %3, 2
%5 = tail call i32 @dbg_write(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_tabort(int);
void must_not_compile2(void) { __builtin_tabort(255); }


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

x86 assembly (clang, -O2):
<must_not_compile2>:
mov    $0xff,%edi
jmp    1030 <__builtin_tabort@plt>

LLVM IR (-O0):
define void @must_not_compile2() {
%1 = call i32 @__builtin_tabort(i32 255)
ret void
}

LLVM IR (-O2):
define void @must_not_compile2() {
%1 = tail call i32 @__builtin_tabort(i32 255)
ret void
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ shutdown(int, int);
void cleanup(int shut, int s) {
  int retval;
  if (shut && shutdown(s, 2) < 0)
    perror("shutdown");
  if (close(s))
    perror("close");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116b <cleanup+0x3b>
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
cmp    $0x0,%rax
jge    116b <cleanup+0x3b>
lea    0xe9a(%rip),%rdi
call   1050 <perror@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
cmp    $0x0,%rax
je     1189 <cleanup+0x59>
lea    0xe85(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %esi,%ebx
test   %edi,%edi
je     1148 <cleanup+0x18>
mov    %ebx,%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
test   %rax,%rax
js     1163 <cleanup+0x33>
mov    %ebx,%edi
call   1040 <close@plt>
test   %rax,%rax
jne    1156 <cleanup+0x26>
pop    %rbx
ret
lea    0xeac(%rip),%rdi
pop    %rbx
jmp    1050 <perror@plt>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
jmp    1148 <cleanup+0x18>

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

LLVM IR (-O2):
@.str = [9 x i8] c"shutdown\00"
@.str.1 = [6 x i8] c"close\00"
define void @cleanup(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i64 @shutdown(i32 %1, i32 2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4, %2
%10 = tail call i64 @close(i32 %1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret void
}
int dquot_alloc_inode(const struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @dquot_alloc_inode(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_ftnacl(char *s) { return (char *)mock(s); }


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

x86 assembly (clang, -O2):
<cf_s_ftnacl>:
jmp    1030 <mock@plt>

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

LLVM IR (-O2):
define i8* @cf_s_ftnacl(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
double log2(double);
double qscale2qp(double qscale) { return 12.0 + 6.0 * log2(qscale / 0.85); }


x86 assembly (clang, -O0):
<qscale2qp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log2@plt>
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec1(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qscale2qp>:
push   %rax
divsd  0xee7(%rip),%xmm0
call   1030 <log2@plt>
mulsd  0xee2(%rip),%xmm0
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qscale2qp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 8.500000e-01
%5 = call double @log2(double %4)
%6 = call double @llvm.fmuladd.f64(double 6.000000e+00, double %5, double 1.200000e+01)
ret double %6
}

LLVM IR (-O2):
define double @qscale2qp(double %0) {
%2 = fdiv double %0, 8.500000e-01
%3 = tail call double @log2(double %2)
%4 = tail call double @llvm.fmuladd.f64(double %3, double 6.000000e+00, double 1.200000e+01)
ret double %4
}
void foo(char *x) {
  while (1) {
    ;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
jmp    1108 <foo+0x8>

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

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @foo(i8* nocapture %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
bool nrf52_errata_57(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_57() {
ret i32 0
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _setbit(struct bitmask *, unsigned int, int);
struct bitmask *bitmask_setbit(struct bitmask *bmp, unsigned int i) {
  _setbit(bmp, i, 1);
  return bmp;
}


x86 assembly (clang, -O0):
<bitmask_setbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1030 <_setbit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmask_setbit>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edx
call   1030 <_setbit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bitmask = type { i32 }
define %struct.bitmask* @bitmask_setbit(%struct.bitmask* %0, i32 %1) {
%3 = alloca %struct.bitmask*
%4 = alloca i32
store %struct.bitmask* %0, %struct.bitmask** %3
store i32 %1, i32* %4
%5 = load %struct.bitmask*, %struct.bitmask** %3
%6 = load i32, i32* %4
%7 = call i32 @_setbit(%struct.bitmask* %5, i32 %6, i32 1)
%8 = load %struct.bitmask*, %struct.bitmask** %3
ret %struct.bitmask* %8
}

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define %struct.bitmask* @bitmask_setbit(%struct.bitmask* returned %0, i32 %1) {
%3 = tail call i32 @_setbit(%struct.bitmask* %0, i32 %1, i32 1)
ret %struct.bitmask* %0
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ pr(char *, int, int /*<<< orphan*/);
void cldHandler(int signo) { pr("%d caught SIGCLD: %d\n", signo, getpid()); }


x86 assembly (clang, -O0):
<cldHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebc(%rip),%rdi
call   1040 <pr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cldHandler>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <pr@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"%d caught SIGCLD: %d\0A\00"
define void @cldHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @getpid()
%5 = call i32 @pr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%d caught SIGCLD: %d\0A\00"
define void @cldHandler(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @pr(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OsdSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void OsdSettingsRequestUpdate() { UAVObjRequestUpdate(OsdSettingsHandle()); }


x86 assembly (clang, -O0):
<OsdSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OsdSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OsdSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1040 <OsdSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @OsdSettingsRequestUpdate() {
%1 = call i32 (...) @OsdSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OsdSettingsRequestUpdate() {
%1 = tail call i32 (...) @OsdSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
void g_type_check_class_is_a() {}


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

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

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

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