xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int a = 10;
  if (0) {
    printf("eee");
  }
  printf("hello world!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hello world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int, char const *);
void test_assert_not_equal(int val1, int val2, const char *msg) {
  test_assert(val1 != val2, msg);
}


x86 assembly (clang, -O0):
<test_assert_not_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_not_equal>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
mov    %eax,%edi
mov    %rdx,%rsi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
define void @test_assert_not_equal(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp ne i32 %7, %8
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %6
%12 = call i32 @test_assert(i32 %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @test_assert_not_equal(i32 %0, i32 %1, i8* %2) {
%4 = icmp ne i32 %0, %1
%5 = zext i1 %4 to i32
%6 = tail call i32 @test_assert(i32 %5, i8* %2)
ret void
}
unsigned int f66(unsigned int x, long int y) {
  return (x << y) + (x >> (8 * 4 - y));
}


x86 assembly (clang, -O0):
<f66>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f66>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f66(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 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub nsw i64 32, %10
%12 = trunc i64 %11 to i32
%13 = lshr i32 %9, %12
%14 = add i32 %8, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f66(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 32, %3
%6 = lshr i32 %0, %5
%7 = add i32 %6, %4
ret i32 %7
}
void gtk_misc_set_alignment() {}


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

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

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

LLVM IR (-O2):
define void @gtk_misc_set_alignment() {
ret void
}
int _lo_internal_compare_ptrs(const void *a, const void *b) {
  if (*(void **)a < *(void **)b)
    return -1;
  if (*(void **)a == *(void **)b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<_lo_internal_compare_ptrs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jae    112c <_lo_internal_compare_ptrs+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1153 <_lo_internal_compare_ptrs+0x53>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%rax
jne    114c <_lo_internal_compare_ptrs+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1153 <_lo_internal_compare_ptrs+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lo_internal_compare_ptrs>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_lo_internal_compare_ptrs(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = icmp ult i8* %4, %6
%8 = icmp ne i8* %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
char *str_extend(char *, char const *);
char *str_new(char *);
char *str_join(const char **list) {
  char *str = str_new("");
  for (; *list; list++)
    str = str_extend(str, *list);
  return str;
}


x86 assembly (clang, -O0):
<str_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <str_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     116f <str_join+0x4f>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
call   1040 <str_extend@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    113c <str_join+0x1c>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_join>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <str_new@plt>
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1154 <str_join+0x34>
add    $0x8,%rbx
nopl   0x0(%rax)
mov    %rax,%rdi
call   1040 <str_extend@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <str_join+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @str_join(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = call i8* @str_new(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
br label %5
5: ; preds = %14, %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = call i8* @str_extend(i8* %10, i8* %12)
store i8* %13, i8** %3
br label %14
14: ; preds = %9
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %2
br label %5
17: ; preds = %5
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @str_join(i8** nocapture %0) {
%2 = tail call i8* @str_new(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %11, %5 ], [ %3, %1 ]
%7 = phi i8* [ %9, %5 ], [ %2, %1 ]
%8 = phi i8** [ %10, %5 ], [ %0, %1 ]
%9 = tail call i8* @str_extend(i8* %7, i8* %6)
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i8* [ %2, %1 ], [ %9, %5 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
fd_set *fd_set_choose(int type, fd_set *rfd, fd_set *wfd, fd_set *efd) {
  switch (type) {
  case 0x1:
    return rfd;
  case 0x2:
    return wfd;
  case 0x3:
    return efd;
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<fd_set_choose>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x1,%eax
je     1149 <fd_set_choose+0x49>
jmp    1127 <fd_set_choose+0x27>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     1156 <fd_set_choose+0x56>
jmp    1138 <fd_set_choose+0x38>
mov    -0x2c(%rbp),%eax
sub    $0x3,%eax
je     1163 <fd_set_choose+0x63>
jmp    1170 <fd_set_choose+0x70>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <fd_set_choose+0x78>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <fd_set_choose+0x78>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <fd_set_choose+0x78>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_set_choose>:
mov    %rsi,%rax
cmp    $0x1,%edi
je     111a <fd_set_choose+0x1a>
mov    %rcx,%rax
cmp    $0x3,%edi
je     111a <fd_set_choose+0x1a>
mov    %rdx,%rax
cmp    $0x2,%edi
je     111a <fd_set_choose+0x1a>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @fd_set_choose(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%10 = load i32, i32* %6
switch i32 %10, label %17 [
i32 1, label %11
i32 2, label %13
i32 3, label %15
]
11: ; preds = %4
%12 = load i32*, i32** %7
store i32* %12, i32** %5
br label %18
13: ; preds = %4
%14 = load i32*, i32** %8
store i32* %14, i32** %5
br label %18
15: ; preds = %4
%16 = load i32*, i32** %9
store i32* %16, i32** %5
br label %18
17: ; preds = %4
store i32* null, i32** %5
br label %18
18: ; preds = %17, %15, %13, %11
%19 = load i32*, i32** %5
ret i32* %19
}

LLVM IR (-O2):
define i32* @fd_set_choose(i32 %0, i32* readnone %1, i32* readnone %2, i32* readnone %3) {
switch i32 %0, label %7 [
i32 1, label %8
i32 2, label %5
i32 3, label %6
]
5: ; preds = %4
br label %8
6: ; preds = %4
br label %8
7: ; preds = %4
br label %8
8: ; preds = %4, %7, %6, %5
%9 = phi i32* [ null, %7 ], [ %3, %6 ], [ %2, %5 ], [ %1, %4 ]
ret i32* %9
}
void f6(const float f, const float g) {}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f6(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
ret void
}

LLVM IR (-O2):
define void @f6(float %0, float %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
float __attribute__((regparm(3))) audit2_test(int i, int j, int k) {
  if (i != 1 || j != 2 || k != 3)
    abort();
  return 30;
}


x86 assembly (clang, -O0):
<audit2_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113f <audit2_test+0x2f>
cmpl   $0x2,-0x8(%rbp)
jne    113f <audit2_test+0x2f>
cmpl   $0x3,-0xc(%rbp)
je     1146 <audit2_test+0x36>
mov    $0x0,%al
call   1030 <abort@plt>
movss  0xeb2(%rip),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit2_test>:
push   %rax
cmp    $0x1,%edi
jne    112a <audit2_test+0x1a>
cmp    $0x2,%esi
jne    112a <audit2_test+0x1a>
cmp    $0x3,%edx
jne    112a <audit2_test+0x1a>
movss  0xed8(%rip),%xmm0
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define float @audit2_test(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, 1
br i1 %8, label %15, label %9
9: ; preds = %3
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 2
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 3
br i1 %14, label %15, label %17
15: ; preds = %12, %9, %3
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
ret float 3.000000e+01
}

LLVM IR (-O2):
define float @audit2_test(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, 1
%5 = icmp ne i32 %1, 2
%6 = or i1 %4, %5
%7 = icmp ne i32 %2, 3
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3
ret float 3.000000e+01
}
void system_wmb() {}


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

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

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

LLVM IR (-O2):
define void @system_wmb() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteLine(char *);
int /*<<< orphan*/ print(int);
void Main() {
  for (int i = 0; i < 3; i++)
    print(i);
  WriteLine("Hello World!");
}


x86 assembly (clang, -O0):
<Main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    114f <Main+0x2f>
mov    -0x4(%rbp),%edi
call   1040 <print@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <Main+0xf>
lea    0xeaa(%rip),%rdi
call   1030 <WriteLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Main>:
push   %rax
xor    %edi,%edi
call   1040 <print@plt>
mov    $0x1,%edi
call   1040 <print@plt>
mov    $0x2,%edi
call   1040 <print@plt>
lea    0xebd(%rip),%rdi
pop    %rax
jmp    1030 <WriteLine@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
define void @Main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @print(i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
%12 = call i32 @WriteLine(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define void @Main() {
%1 = tail call i32 @print(i32 0)
%2 = tail call i32 @print(i32 1)
%3 = tail call i32 @print(i32 2)
%4 = tail call i32 @WriteLine(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long fibonnaci(int);
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  long unsigned answer = 0;
  for (int i = 0; i < 50; ++i) {
    long unsigned answer = fibonnaci(i);
    printf("%lu\n", answer);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x32,-0x14(%rbp)
jge    1172 <main+0x52>
mov    -0x14(%rbp),%edi
call   1030 <fibonnaci@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x1e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %ebx,%edi
call   1030 <fibonnaci@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x32,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %6, %2 ]
%4 = tail call i64 @fibonnaci(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i32 %6, 50
br i1 %7, label %1, label %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ system(char *);
int set_touchpad_sate(const char *state) {
  int sucess = -1;
  if (strcmp(state, "ON") == 0) {
    system("synclient TouchpadOff=0");
    sucess = 0;
  } else {
    system("synclient TouchpadOff=1");
    sucess = 0;
  }
  return sucess;
}


x86 assembly (clang, -O0):
<set_touchpad_sate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1165 <set_touchpad_sate+0x45>
lea    0xeaf(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0xc(%rbp)
jmp    1178 <set_touchpad_sate+0x58>
lea    0xeaf(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_touchpad_sate>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
lea    0xecc(%rip),%rax
lea    0xedd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"ON\00"
@.str.1 = [24 x i8] c"synclient TouchpadOff=0\00"
@.str.2 = [24 x i8] c"synclient TouchpadOff=1\00"
define i32 @set_touchpad_sate(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
%4 = load i8*, i8** %2
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %11
9: ; preds = %1
%10 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %11
11: ; preds = %9, %7
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"ON\00"
@.str.1 = [24 x i8] c"synclient TouchpadOff=0\00"
@.str.2 = [24 x i8] c"synclient TouchpadOff=1\00"
define i32 @set_touchpad_sate(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0)
%5 = tail call i32 @system(i8* %4)
ret i32 0
}
void cleanup(char *stat) {
  char *p;
  for (p = stat; *p; p++) {
    if (*p == ':' || *p == '|' || *p == '@') {
      *p = '_';
    }
  }
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116a <cleanup+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     114d <cleanup+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7c,%eax
je     114d <cleanup+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1154 <cleanup+0x54>
mov    -0x10(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1159 <cleanup+0x59>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <cleanup+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
jmp    111b <cleanup+0x1b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x3a,%al
jne    112c <cleanup+0x2c>
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x3f,%al
jle    1110 <cleanup+0x10>
cmp    $0x7c,%al
je     1114 <cleanup+0x14>
cmp    $0x40,%al
je     1114 <cleanup+0x14>
jmp    1117 <cleanup+0x17>
test   %al,%al
jne    1117 <cleanup+0x17>
ret

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

LLVM IR (-O2):
define void @cleanup(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 58, label %5
i8 124, label %5
i8 64, label %5
]
5: ; preds = %2, %2, %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
extern long long ArglessLongLong() { return 2; }


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

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

LLVM IR (-O0):
define i64 @ArglessLongLong() {
ret i64 2
}

LLVM IR (-O2):
define i64 @ArglessLongLong() {
ret i64 2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int a;
  int *pa;
  pa = &a;
  *pa = 5;
  foo(pa);
  return a;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *routine(void *arg) {
  output("info output by sub-thread.\n");
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<routine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <output@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<routine>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <output@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"info output by sub-thread.\0A\00"
define i8* @routine(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @output(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [28 x i8] c"info output by sub-thread.\0A\00"
define noalias i8* @routine(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
int test_imm_C3int16_mem(short *val) {
  return ((*val) & (-0xC3 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C3int16_mem>:
movzwl (%rdi),%eax
test   $0xff3d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C3int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -195
%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_C3int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -195
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(int /*<<< orphan*/ *, void const *, int);
void inv_fifo_protocol_helper_decode_light_data(const void *in, uint16_t len,
                                                uint32_t *light) {
  FifoProtocol_memcpy((light), (in), (sizeof(uint32_t)));
  *light = *light;
  (void)len;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_light_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_light_data>:
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    $0x4,%edx
jmp    1030 <FifoProtocol_memcpy@plt>

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

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_light_data(i8* %0, i32 %1, i32* %2) {
%4 = tail call i32 @FifoProtocol_memcpy(i32* %2, i8* %0, i32 4)
ret void
}
int nodemap_mod_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nodemap_mod_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_detach(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
void *ThreadFunc() {
  static int count = 1;
  printf("Create thread%d\n", count);
  pthread_detach(pthread_self());
  count++;
}


x86 assembly (clang, -O0):
<ThreadFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2efa(%rip),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
mov    0x2eda(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed1(%rip)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadFunc>:
push   %rax
mov    0x2f01(%rip),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %eax,%edi
call   1040 <pthread_detach@plt>
addl   $0x1,0x2ee0(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@ThreadFunc.count = internal global i32 1
@.str = [17 x i8] c"Create thread%d\0A\00"
define i8* @ThreadFunc() {
%1 = alloca i8*
%2 = load i32, i32* @ThreadFunc.count
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @pthread_self()
%5 = call i32 @pthread_detach(i32 %4)
%6 = load i32, i32* @ThreadFunc.count
%7 = add nsw i32 %6, 1
store i32 %7, i32* @ThreadFunc.count
%8 = load i8*, i8** %1
ret i8* %8
}

LLVM IR (-O2):
@ThreadFunc.count = internal unnamed_addr global i32 1
@.str = [17 x i8] c"Create thread%d\0A\00"
define noalias i8* @ThreadFunc() {
%1 = load i32, i32* @ThreadFunc.count
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @pthread_self()
%4 = tail call i32 @pthread_detach(i32 %3)
%5 = load i32, i32* @ThreadFunc.count
%6 = add nsw i32 %5, 1
store i32 %6, i32* @ThreadFunc.count
ret i8* undef
}
int pit_init() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @pit_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ func(long, long);
long main() {
  long b, c;
  b = 1;
  c = 7;
  func(b, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x1,-0x10(%rbp)
movq   $0x7,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <func@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x7,%esi
jmp    1030 <func@plt>

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

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i32 @func(i64 1, i64 7)
ret i64 undef
}
/* Type definitions */
struct libkeccak_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ libkeccak_f(struct libkeccak_state *);
void libkeccak_simple_squeeze(register struct libkeccak_state *restrict state,
                              register long int times) {
  while (times--)
    libkeccak_f(state);
}


x86 assembly (clang, -O0):
<libkeccak_simple_squeeze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1147 <libkeccak_simple_squeeze+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <libkeccak_f@plt>
jmp    1120 <libkeccak_simple_squeeze+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libkeccak_simple_squeeze>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     112e <libkeccak_simple_squeeze+0x1e>
mov    %rsi,%rbx
mov    %rdi,%r14
nop
mov    %r14,%rdi
call   1030 <libkeccak_f@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <libkeccak_simple_squeeze+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.libkeccak_state = type { i32 }
define void @libkeccak_simple_squeeze(%struct.libkeccak_state* noalias %0, i64 %1) {
%3 = alloca %struct.libkeccak_state*
%4 = alloca i64
store %struct.libkeccak_state* %0, %struct.libkeccak_state** %3
store i64 %1, i64* %4
br label %5
5: ; preds = %9, %2
%6 = load i64, i64* %4
%7 = add nsw i64 %6, -1
store i64 %7, i64* %4
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load %struct.libkeccak_state*, %struct.libkeccak_state** %3
%11 = call i32 @libkeccak_f(%struct.libkeccak_state* %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.libkeccak_state = type { i32 }
define void @libkeccak_simple_squeeze(%struct.libkeccak_state* noalias %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %1, %2 ]
%6 = add nsw i64 %5, -1
%7 = tail call i32 @libkeccak_f(%struct.libkeccak_state* %0)
%8 = icmp eq i64 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
float fflip(float x) {
  union {
    char b[4];
    float l;
  } in, out;
  in.l = x;
  out.b[0] = in.b[3];
  out.b[1] = in.b[2];
  out.b[2] = in.b[1];
  out.b[3] = in.b[0];
  return out.l;
}


x86 assembly (clang, -O0):
<fflip>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x10(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0xf(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0xd(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fflip>:
movd   %xmm0,%eax
bswap  %eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @fflip(float %0) {
%2 = alloca float
%3 = alloca %union.anon
%4 = alloca %union.anon
store float %0, float* %2
%5 = load float, float* %2
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
%9 = load i8, i8* %8
%10 = bitcast %union.anon* %4 to [4 x i8]*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
store i8 %9, i8* %11
%12 = bitcast %union.anon* %3 to [4 x i8]*
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %12, i64 0, i64 2
%14 = load i8, i8* %13
%15 = bitcast %union.anon* %4 to [4 x i8]*
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %15, i64 0, i64 1
store i8 %14, i8* %16
%17 = bitcast %union.anon* %3 to [4 x i8]*
%18 = getelementptr inbounds [4 x i8], [4 x i8]* %17, i64 0, i64 1
%19 = load i8, i8* %18
%20 = bitcast %union.anon* %4 to [4 x i8]*
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %20, i64 0, i64 2
store i8 %19, i8* %21
%22 = bitcast %union.anon* %3 to [4 x i8]*
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %22, i64 0, i64 0
%24 = load i8, i8* %23
%25 = bitcast %union.anon* %4 to [4 x i8]*
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %25, i64 0, i64 3
store i8 %24, i8* %26
%27 = bitcast %union.anon* %4 to float*
%28 = load float, float* %27
ret float %28
}

LLVM IR (-O2):
define float @fflip(float %0) {
%2 = bitcast float %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = bitcast i32 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printIntArray(int *array, int len) {
  for (int i = 0; i < len; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


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

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

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

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


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

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

LLVM IR (-O0):
define void @thread_exit() {
%1 = call i32 (...) @thread_get_current()
%2 = call i32 @thread_destroy(i32 %1)
ret void
}

LLVM IR (-O2):
define void @thread_exit() {
%1 = tail call i32 (...) @thread_get_current()
%2 = tail call i32 @thread_destroy(i32 %1)
ret void
}
void _dummy_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_dummy_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 0; i < 8000; i++) {
    printf("%d \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)
cmpl   $0x1f40,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x1f40,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 8000
br i1 %6, label %1, label %2
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Getchar() != EOF = %d\n", getchar() != EOF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"Getchar() != EOF = %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Getchar() != EOF = %d\0A\00"
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
int convierteHora(int ampm, int hora, int min, int seg) {
  int tiempo = 0;
  tiempo = (0x01 & ampm) << 16;
  tiempo = tiempo | (0x0F & hora) << 12;
  tiempo = tiempo | (0x3F & min) << 6;
  tiempo = tiempo | (0x3F & seg);
  return tiempo;
}


x86 assembly (clang, -O0):
<convierteHora>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
shl    $0xc,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x6,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
and    $0x3f,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convierteHora>:
and    $0x1,%edi
shl    $0x10,%edi
shl    $0xc,%esi
movzwl %si,%eax
or     %edi,%eax
and    $0x3f,%edx
shl    $0x6,%edx
or     %edx,%eax
and    $0x3f,%ecx
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @convierteHora(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = and i32 1, %10
%12 = shl i32 %11, 16
store i32 %12, i32* %9
%13 = load i32, i32* %9
%14 = load i32, i32* %6
%15 = and i32 15, %14
%16 = shl i32 %15, 12
%17 = or i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = load i32, i32* %7
%20 = and i32 63, %19
%21 = shl i32 %20, 6
%22 = or i32 %18, %21
store i32 %22, i32* %9
%23 = load i32, i32* %9
%24 = load i32, i32* %8
%25 = and i32 63, %24
%26 = or i32 %23, %25
store i32 %26, i32* %9
%27 = load i32, i32* %9
ret i32 %27
}

LLVM IR (-O2):
define i32 @convierteHora(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 16
%6 = and i32 %5, 65536
%7 = shl i32 %1, 12
%8 = and i32 %7, 61440
%9 = or i32 %8, %6
%10 = shl i32 %2, 6
%11 = and i32 %10, 4032
%12 = or i32 %9, %11
%13 = and i32 %3, 63
%14 = or i32 %12, %13
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_add_int8_t(int /*<<< orphan*/ *, int);
int8_t atomic_inc_int8_t(int8_t *var) { return atomic_add_int8_t(var, 1); }


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

x86 assembly (clang, -O2):
<atomic_inc_int8_t>:
mov    $0x1,%esi
jmp    1030 <atomic_add_int8_t@plt>

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

LLVM IR (-O2):
define i32 @atomic_inc_int8_t(i32* %0) {
%2 = tail call i32 @atomic_add_int8_t(i32* %0, i32 1)
ret i32 %2
}
length(str) char *str;
{
  register char *cp;
  for (cp = str; *cp++;)
    ;
  return (cp - str - 1);
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <length+0x2d>
jmp    1110 <length+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @length(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
/* Variables and functions */
unsigned int bar();
void foo20xf(void) {
  unsigned int a = bar();
  if (a > 0xf)
    bar();
}


x86 assembly (clang, -O0):
<foo20xf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <bar@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jbe    1133 <foo20xf+0x23>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo20xf>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
cmp    $0x10,%eax
jb     1125 <foo20xf+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @foo20xf() {
%1 = alloca i32
%2 = call i32 (...) @bar()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ugt i32 %3, 15
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @bar()
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @foo20xf() {
%1 = tail call i32 (...) @bar()
%2 = icmp ugt i32 %1, 15
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @bar()
br label %5
5: ; preds = %3, %0
ret void
}