xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
void ft_puterr(char *file, int no) {
  if (no != 0) {
    ft_putstr("cat: ");
    ft_putstr(file);
    ft_putstr(": ");
    if (no == 2)
      ft_putstr("No such file or directory\n");
  }
}


x86 assembly (clang, -O0):
<ft_puterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1165 <ft_puterr+0x55>
lea    0xed0(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ft_putstr@plt>
lea    0xebe(%rip),%rdi
call   1030 <ft_putstr@plt>
cmpl   $0x2,-0xc(%rbp)
jne    1160 <ft_puterr+0x50>
lea    0xeab(%rip),%rdi
call   1030 <ft_putstr@plt>
jmp    1165 <ft_puterr+0x55>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_puterr>:
test   %esi,%esi
je     1156 <ft_puterr+0x46>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xedc(%rip),%rdi
call   1030 <ft_putstr@plt>
mov    %r14,%rdi
call   1030 <ft_putstr@plt>
lea    0xecb(%rip),%rdi
call   1030 <ft_putstr@plt>
cmp    $0x2,%ebx
lea    0x8(%rsp),%rsp
pop    %rbx
pop    %r14
jne    1156 <ft_puterr+0x46>
lea    0xeb5(%rip),%rdi
jmp    1030 <ft_putstr@plt>
ret

LLVM IR (-O0):
@.str = [6 x i8] c"cat: \00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [27 x i8] c"No such file or directory\0A\00"
define void @ft_puterr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %3
%10 = call i32 @ft_putstr(i8* %9)
%11 = call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %7
%15 = call i32 @ft_putstr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %7
br label %17
17: ; preds = %16, %2
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"cat: \00"
@.str.1 = [3 x i8] c": \00"
@.str.2 = [27 x i8] c"No such file or directory\0A\00"
define void @ft_puterr(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @ft_putstr(i8* %0)
%7 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %1, 2
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %4, %9, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void exitShell(char *params[], int paramNumber) { exit(0); }


x86 assembly (clang, -O0):
<exitShell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

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

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

LLVM IR (-O2):
define void @exitShell(i8** nocapture readnone %0, i32 %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int cStrLen(const char *str) {
  int i = 0;
  if (str == 0)
    return (0);
  while (str[i] != '\0')
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<cStrLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <cStrLen+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1154 <cStrLen+0x54>
jmp    112b <cStrLen+0x2b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114e <cStrLen+0x4e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <cStrLen+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cStrLen>:
test   %rdi,%rdi
je     111d <cStrLen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <cStrLen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cStrLen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ analyze_hand();
int /*<<< orphan*/ print_result();
int /*<<< orphan*/ read_cards();
int main(void) {
  while (1) {
    read_cards();
    analyze_hand();
    print_result();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <read_cards@plt>
mov    $0x0,%al
call   1050 <analyze_hand@plt>
mov    $0x0,%al
call   1040 <print_result@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <read_cards@plt>
xor    %eax,%eax
call   1050 <analyze_hand@plt>
xor    %eax,%eax
call   1040 <print_result@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @read_cards()
%4 = call i32 (...) @analyze_hand()
%5 = call i32 (...) @print_result()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @read_cards()
%3 = tail call i32 (...) @analyze_hand()
%4 = tail call i32 (...) @print_result()
br label %1
}
int test_imm_F7int16_reg(short val) {
  return ((val) & (-0xF7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff09,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F7int16_reg>:
test   $0xff09,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F7int16_reg(i16 signext %0) {
%2 = and i16 %0, -247
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_sql_block_comment();
int /*<<< orphan*/ test_sql_comment_entities();
int /*<<< orphan*/ test_sql_comments();
int /*<<< orphan*/ test_sql_empty_comments();
void all_sql_tests() {
  test_sql_comments();
  test_sql_empty_comments();
  test_sql_block_comment();
  test_sql_comment_entities();
}


x86 assembly (clang, -O0):
<all_sql_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_sql_comments@plt>
mov    $0x0,%al
call   1060 <test_sql_empty_comments@plt>
mov    $0x0,%al
call   1040 <test_sql_block_comment@plt>
mov    $0x0,%al
call   1050 <test_sql_comment_entities@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_sql_tests>:
push   %rax
xor    %eax,%eax
call   1030 <test_sql_comments@plt>
xor    %eax,%eax
call   1060 <test_sql_empty_comments@plt>
xor    %eax,%eax
call   1040 <test_sql_block_comment@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_sql_comment_entities@plt>

LLVM IR (-O0):
define void @all_sql_tests() {
%1 = call i32 (...) @test_sql_comments()
%2 = call i32 (...) @test_sql_empty_comments()
%3 = call i32 (...) @test_sql_block_comment()
%4 = call i32 (...) @test_sql_comment_entities()
ret void
}

LLVM IR (-O2):
define void @all_sql_tests() {
%1 = tail call i32 (...) @test_sql_comments()
%2 = tail call i32 (...) @test_sql_empty_comments()
%3 = tail call i32 (...) @test_sql_block_comment()
%4 = tail call i32 (...) @test_sql_comment_entities()
ret void
}
Jmprintf(row, col, s, a, b, c, d) char *s;
long a, b, c, d;
{
  char buf[90];
  Jmove(row, col);
  sprintf(buf, s, a, b, c, d);
  Jputstr(buf);
}


x86 assembly (clang, -O0):
<Jmprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1040 <Jmove@plt>
lea    -0x90(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x90(%rbp),%rdi
mov    $0x0,%al
call   1030 <Jputstr@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jmprintf>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    0xa0(%rsp),%r13
xor    %eax,%eax
call   1040 <Jmove@plt>
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <Jputstr@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Jmprintf(i32 %0, i32 %1, i8* nocapture %2, i64 %3, i64 %4, i64 %5, i64 %6) {
%8 = alloca [90 x i8]
%9 = getelementptr inbounds [90 x i8], [90 x i8]* %8, i64 0, i64 0
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Jmove to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* dereferenceable(1) %2, i64 %3, i64 %4, i64 %5, i64 %6)
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @Jputstr to i32 (i8*, ...)*)(i8* %9)
ret i32 undef
}
unsigned short rotr16(unsigned short val, int count) {
  count &= 15;
  return (val >> count) | (val << (16 - count));
}


x86 assembly (clang, -O0):
<rotr16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotr16>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @rotr16(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 15
store i32 %6, i32* %4
%7 = load i16, i16* %3
%8 = zext i16 %7 to i32
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = load i32, i32* %4
%14 = sub nsw i32 16, %13
%15 = shl i32 %12, %14
%16 = or i32 %10, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @rotr16(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = tail call i16 @llvm.fshr.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_tail(struct list_head *, struct list_head *);
void en_queue(struct list_head *node, struct list_head *list) {
  list_add_tail(node, list);
}


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

x86 assembly (clang, -O2):
<en_queue>:
jmp    1030 <list_add_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @en_queue(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_add_tail(%struct.list_head* %5, %struct.list_head* %6)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @en_queue(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_add_tail(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
int isprm(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 1; i <= 100000000; i++) {
    if (isprm(i) == 1)
      printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5f5e100,-0x8(%rbp)
jg     1176 <main+0x56>
mov    -0x8(%rbp),%edi
call   1030 <isprm@plt>
cmp    $0x1,%eax
jne    1163 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
jmp    1168 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x5f5e101,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1030 <isprm@plt>
cmp    $0x1,%eax
jne    1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 1, %0 ], [ %8, %7 ]
%3 = tail call i32 @isprm(i32 %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 100000001
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
int testBit_fun_int16_t(int16_t x, uint32_t i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_int16_t>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_int16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @testBit_fun_int16_t(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_NOTICE;
int /*<<< orphan*/ hdd_folders_reinit();
int /*<<< orphan*/ hdd_options_common(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
void hdd_reload(void) {
  hdd_options_common(0);
  syslog(LOG_NOTICE, "reloading hdd data ...");
  hdd_folders_reinit();
}


x86 assembly (clang, -O0):
<hdd_reload>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <hdd_options_common@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x0,%al
call   1030 <hdd_folders_reinit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdd_reload>:
push   %rax
xor    %edi,%edi
call   1040 <hdd_options_common@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1050 <syslog@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <hdd_folders_reinit@plt>

LLVM IR (-O0):
@LOG_NOTICE = global i32 0
@.str = [23 x i8] c"reloading hdd data ...\00"
define void @hdd_reload() {
%1 = call i32 @hdd_options_common(i32 0)
%2 = load i32, i32* @LOG_NOTICE
%3 = call i32 @syslog(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @hdd_folders_reinit()
ret void
}

LLVM IR (-O2):
@LOG_NOTICE = global i32 0
@.str = [23 x i8] c"reloading hdd data ...\00"
define void @hdd_reload() {
%1 = tail call i32 @hdd_options_common(i32 0)
%2 = load i32, i32* @LOG_NOTICE
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @hdd_folders_reinit()
ret void
}
void shared_function() {}


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

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

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

LLVM IR (-O2):
define void @shared_function() {
ret void
}
short sabs(short n) {
  if (n < 0) {
    n *= -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<sabs>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
cmp    $0x0,%eax
jge    1123 <sabs+0x23>
movswl -0x2(%rbp),%eax
imul   $0xffffffff,%eax,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sabs>:
mov    %edi,%eax
neg    %ax
cmovs  %di,%ax
ret

LLVM IR (-O0):
define signext i16 @sabs(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = mul nsw i32 %8, -1
%10 = trunc i32 %9 to i16
store i16 %10, i16* %2
br label %11
11: ; preds = %6, %1
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
define signext i16 @sabs(i16 signext %0) {
%2 = tail call i16 @llvm.abs.i16(i16 %0, i1 false)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int is_prime(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char a[11];
  fgets(a, 11, stdin);
  printf("%d", is_prime(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xf(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
mov    $0xb,%esi
call   1040 <fgets@plt>
lea    -0xf(%rbp),%rdi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
lea    0x5(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xb,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <is_prime@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 11, i32 %4)
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = call i32 @is_prime(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 11, i32 %3)
%5 = call i32 @is_prime(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
main() {
  int x, m;
  x = 0;
  while (x < 100) {
    m = __VERIFIER_nondet_int();
    x = x + 1;
  }
  __VERIFIER_assert(x == 100);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1158 <main+0x38>
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
cmpl   $0x64,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
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 = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 100
%14 = zext i1 %13 to i32
%15 = call i32 @__VERIFIER_assert(i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @__VERIFIER_nondet_int()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
void ft_setintchar(char **a, int *b, char *a_val, int b_val) {
  *a = a_val;
  *b = b_val;
}


x86 assembly (clang, -O0):
<ft_setintchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_setintchar>:
mov    %rdx,(%rdi)
mov    %ecx,(%rsi)
ret

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

LLVM IR (-O2):
define void @ft_setintchar(i8** nocapture writeonly %0, i32* nocapture writeonly %1, i8* %2, i32 %3) {
store i8* %2, i8** %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int log(double);
double npos(double m, double u) {
  double r = (1 - m) / (1 - u);
  return ((double)(log((double)r) / log((double)2.0)));
}


x86 assembly (clang, -O0):
<npos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,-0x1c(%rbp)
movsd  0xea6(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<npos>:
push   %rbx
movsd  0xee7(%rip),%xmm3
movapd %xmm3,%xmm2
subsd  %xmm0,%xmm2
subsd  %xmm1,%xmm3
divsd  %xmm3,%xmm2
movapd %xmm2,%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0xecc(%rip),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @npos(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = fsub double 1.000000e+00, %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = call i32 @log(double %11)
%13 = call i32 @log(double 2.000000e+00)
%14 = sdiv i32 %12, %13
%15 = sitofp i32 %14 to double
ret double %15
}

LLVM IR (-O2):
define double @npos(double %0, double %1) {
%3 = fsub double 1.000000e+00, %0
%4 = fsub double 1.000000e+00, %1
%5 = fdiv double %3, %4
%6 = tail call i32 @log(double %5)
%7 = tail call i32 @log(double 2.000000e+00)
%8 = sdiv i32 %6, %7
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int);
int __float_clone_array(const float *p, float *q, int elements) {
  memcpy(q, p, elements * sizeof(float));
  return 0;
}


x86 assembly (clang, -O0):
<__float_clone_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__float_clone_array>:
push   %rax
mov    %rdi,%rax
shl    $0x2,%edx
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <memcpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__float_clone_array(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load float*, float** %5
%8 = load float*, float** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(float* %7, float* %8, i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @__float_clone_array(float* %0, float* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(float* %1, float* %0, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ getegid();
__attribute__((__weak__, __always___)) gid_t softboundmpx_getegid(void) {
  return getegid();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundmpx_getegid() {
%1 = call i32 (...) @getegid()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundmpx_getegid() {
%1 = tail call i32 (...) @getegid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
float smith_waterman_gotoh_similarity(char *, char *);
char *soundex(char const *);
float soundex_similarity(const char *str1, const char *str2) {
  char *s1 = soundex(str1);
  char *s2 = soundex(str2);
  float res = smith_waterman_gotoh_similarity(s1, s2);
  free(s1);
  free(s2);
  return (res);
}


x86 assembly (clang, -O0):
<soundex_similarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <soundex@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <soundex@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <smith_waterman_gotoh_similarity@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movss  -0x24(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundex_similarity>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
call   1050 <soundex@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <soundex@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <smith_waterman_gotoh_similarity@plt>
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @soundex_similarity(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @soundex(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @soundex(i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call float @smith_waterman_gotoh_similarity(i8* %12, i8* %13)
store float %14, float* %7
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %6
%18 = call i32 @free(i8* %17)
%19 = load float, float* %7
ret float %19
}

LLVM IR (-O2):
define float @soundex_similarity(i8* %0, i8* %1) {
%3 = tail call i8* @soundex(i8* %0)
%4 = tail call i8* @soundex(i8* %1)
%5 = tail call float @smith_waterman_gotoh_similarity(i8* %3, i8* %4)
%6 = tail call i32 @free(i8* %3)
%7 = tail call i32 @free(i8* %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ PutErr(int, char *);
void astBacktrace_(int *status) {
  PutErr((*status), "Backtrace functionality is not available "
                    "on the current operating system.");
}


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

x86 assembly (clang, -O2):
<astBacktrace_>:
mov    (%rdi),%edi
lea    0xee7(%rip),%rsi
jmp    1030 <PutErr@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"Backtrace functionality is not available on the current operating system.\00"
define void @astBacktrace_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @PutErr(i32 %4, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"Backtrace functionality is not available on the current operating system.\00"
define void @astBacktrace_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @PutErr(i32 %2, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0))
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  {
    state[0UL] = (input[0UL] | 51238316UL) >> (unsigned short)3;
    if ((state[0UL] >> (unsigned short)3) & (unsigned short)1) {
      state[0UL] <<=
          ((state[0UL] >> (unsigned short)1) & (unsigned short)7) | 1UL;
    }
    output[0UL] = state[0UL] << (unsigned short)3;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
or     $0x30dd5ac,%rax
shr    $0x3,%rax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sar    $0x3,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <RandomFunc+0x4f>
movzwl -0x12(%rbp),%eax
sar    $0x1,%eax
and    $0x7,%eax
movslq %eax,%rcx
or     $0x1,%rcx
movzwl -0x12(%rbp),%eax
shl    %cl,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
shl    $0x3,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
mov    %eax,%edx
shr    $0x3,%edx
or     $0xffffbab5,%edx
and    $0x40,%eax
mov    %edx,%ecx
shr    %cl
and    $0x6,%cl
or     $0x1,%cl
test   %eax,%eax
movzbl %cl,%ecx
cmove  %eax,%ecx
shl    %cl,%edx
shl    $0x3,%edx
mov    %dx,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
store i16* %0, i16** %3
store i16* %1, i16** %4
%6 = load i16*, i16** %3
%7 = getelementptr inbounds i16, i16* %6, i64 0
%8 = load i16, i16* %7
%9 = zext i16 %8 to i64
%10 = or i64 %9, 51238316
%11 = lshr i64 %10, 3
%12 = trunc i64 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%15 = load i16, i16* %14
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 3
%18 = and i32 %17, 1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %34
20: ; preds = %2
%21 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = ashr i32 %23, 1
%25 = and i32 %24, 7
%26 = sext i32 %25 to i64
%27 = or i64 %26, 1
%28 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%29 = load i16, i16* %28
%30 = zext i16 %29 to i32
%31 = trunc i64 %27 to i32
%32 = shl i32 %30, %31
%33 = trunc i32 %32 to i16
store i16 %33, i16* %28
br label %34
34: ; preds = %20, %2
%35 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%36 = load i16, i16* %35
%37 = zext i16 %36 to i32
%38 = shl i32 %37, 3
%39 = trunc i32 %38 to i16
%40 = load i16*, i16** %4
%41 = getelementptr inbounds i16, i16* %40, i64 0
store i16 %39, i16* %41
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = lshr i16 %3, 3
%5 = or i16 %4, -17739
%6 = and i16 %3, 64
%7 = icmp eq i16 %6, 0
%8 = lshr i16 %5, 1
%9 = and i16 %8, 6
%10 = or i16 %9, 1
%11 = select i1 %7, i16 0, i16 %10
%12 = shl i16 %5, %11
%13 = shl i16 %12, 3
store i16 %13, i16* %1
ret void
}
_Bool ptrconversion(char *ptr) { return ptr; }


x86 assembly (clang, -O0):
<ptrconversion>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrconversion>:
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
define zeroext i1 @ptrconversion(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @ptrconversion(i8* readnone %0) {
%2 = icmp ne i8* %0, null
ret i1 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i;
  for (i = 0; i < 2; i++) {
    printf("a rose is ");
  }
  printf("a rose.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a rose is \00"
@.str.1 = [9 x i8] c"a rose.\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 = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"a rose is \00"
@str = [8 x i8] c"a rose.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void math_acos(void) {
  double d = lua_check_number(1, "acos");
  lua_pushnumber(((acos(d)) * 180.0 / 3.14159265358979323846));
}


x86 assembly (clang, -O0):
<math_acos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <acos@plt>
movsd  0xea2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8e(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    $0x1,%al
call   1050 <lua_pushnumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_acos>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <lua_check_number@plt>
cvtsi2sd %eax,%xmm0
call   1040 <acos@plt>
mulsd  0xeab(%rip),%xmm0
divsd  0xeab(%rip),%xmm0
mov    $0x1,%al
pop    %rcx
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"acos\00"
define void @math_acos() {
%1 = alloca double
%2 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = sitofp i32 %2 to double
store double %3, double* %1
%4 = load double, double* %1
%5 = call double @acos(double %4)
%6 = fmul double %5, 1.800000e+02
%7 = fdiv double %6, 0x400921FB54442D18
%8 = call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"acos\00"
define void @math_acos() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @lua_check_number to i32 (i32, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = sitofp i32 %1 to double
%3 = tail call double @acos(double %2)
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB54442D18
%6 = tail call i32 (double, ...) bitcast (i32 (...)* @lua_pushnumber to i32 (double, ...)*)(double %5)
ret void
}
/* Variables and functions */
void *calloc(size_t, int);
void *crush_malloc(size_t size, void *user_data) {
  (void)user_data;
  return calloc(size, 1);
}


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

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

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

LLVM IR (-O2):
define i8* @crush_malloc(i64 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @calloc(i64 %0, i32 1)
ret i8* %3
}
/* Variables and functions */
int usart_write_arr(char *, int);
int _write(int file, char *ptr, int len) {
  if (len) {
    len = usart_write_arr(ptr, len);
    return len;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1146 <_write+0x36>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <usart_write_arr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <_write+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
test   %edx,%edx
je     111e <_write+0xe>
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <usart_write_arr@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @usart_write_arr(i8* %1, i32 %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
/* Variables and functions */
__attribute__((always_)) bool IsAlpha(char C) {
  bool Result = (((C >= 'a') && (C <= 'z')) || ((C >= 'A') && (C <= 'Z')));
  return Result;
}


x86 assembly (clang, -O0):
<IsAlpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <IsAlpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x9(%rbp)
jle    114e <IsAlpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0xa(%rbp)
jl     1148 <IsAlpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsAlpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsAlpha(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %21, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br label %19
19: ; preds = %15, %11
%20 = phi i1 [ false, %11 ], [ %18, %15 ]
br label %21
21: ; preds = %19, %7
%22 = phi i1 [ true, %7 ], [ %20, %19 ]
%23 = zext i1 %22 to i32
store i32 %23, i32* %3
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @IsAlpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ getbits(unsigned char const *, int, int);
double getbitu(unsigned char const *, int, int);
double getbits_38(const unsigned char *buff, int pos) {
  return (double)getbits(buff, pos, 32) * 64.0 + getbitu(buff, pos + 32, 6);
}


x86 assembly (clang, -O0):
<getbits_38>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%edx
call   1030 <getbits@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x20,%esi
mov    $0x6,%edx
call   1040 <getbitu@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe92(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbits_38>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    $0x20,%edx
call   1030 <getbits@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,(%rsp)
add    $0x20,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    $0x6,%edx
call   1040 <getbitu@plt>
movsd  (%rsp),%xmm1
mulsd  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define double @getbits_38(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i64 @getbits(i8* %5, i32 %6, i32 32)
%8 = sitofp i64 %7 to double
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 32
%12 = call double @getbitu(i8* %9, i32 %11, i32 6)
%13 = call double @llvm.fmuladd.f64(double %8, double 6.400000e+01, double %12)
ret double %13
}

LLVM IR (-O2):
define double @getbits_38(i8* %0, i32 %1) {
%3 = tail call i64 @getbits(i8* %0, i32 %1, i32 32)
%4 = sitofp i64 %3 to double
%5 = add nsw i32 %1, 32
%6 = tail call double @getbitu(i8* %0, i32 %5, i32 6)
%7 = tail call double @llvm.fmuladd.f64(double %4, double 6.400000e+01, double %6)
ret double %7
}