xunge/DecIR huggingface dataset:
int getsqr(int n) {
  int _i;
  _i = 1;
  while (_i < n / _i)
    _i = +1 + _i;
  if (-n + _i * _i < n - (-1 + _i) * (_i - 1))
    return (_i);
  return (_i - 1);
}


x86 assembly (clang, -O0):
<getsqr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    1136 <getsqr+0x36>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <getsqr+0xe>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%edx
add    $0xffffffff,%edx
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
imul   %esi,%edx
sub    %edx,%ecx
cmp    %ecx,%eax
jge    116e <getsqr+0x6e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <getsqr+0x77>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsqr>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
cmp    %eax,%ecx
jl     1110 <getsqr+0x10>
mov    %ecx,%edx
imul   %ecx,%edx
sub    %edi,%edx
lea    -0x1(%rcx),%eax
mov    %eax,%esi
imul   %eax,%esi
sub    %esi,%edi
cmp    %edi,%edx
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getsqr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = sdiv i32 %7, %8
%10 = icmp slt i32 %6, %9
br i1 %10, label %11, label %14
11: ; preds = %5
%12 = load i32, i32* %4
%13 = add nsw i32 1, %12
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
%16 = sub nsw i32 0, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %4
%19 = mul nsw i32 %17, %18
%20 = add nsw i32 %16, %19
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = add nsw i32 -1, %22
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = mul nsw i32 %23, %25
%27 = sub nsw i32 %21, %26
%28 = icmp slt i32 %20, %27
br i1 %28, label %29, label %31
29: ; preds = %14
%30 = load i32, i32* %4
store i32 %30, i32* %2
br label %34
31: ; preds = %14
%32 = load i32, i32* %4
%33 = sub nsw i32 %32, 1
store i32 %33, i32* %2
br label %34
34: ; preds = %31, %29
%35 = load i32, i32* %2
ret i32 %35
}

LLVM IR (-O2):
define i32 @getsqr(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %6, %2 ]
%4 = sdiv i32 %0, %3
%5 = icmp slt i32 %3, %4
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
%8 = mul nsw i32 %3, %3
%9 = sub i32 %8, %0
%10 = add nsw i32 %3, -1
%11 = mul nsw i32 %10, %10
%12 = sub nsw i32 %0, %11
%13 = icmp slt i32 %9, %12
%14 = select i1 %13, i32 %3, i32 %10
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ two();
void one_three() {
  printf("one\n");
  two();
  printf("three\n");
}


x86 assembly (clang, -O0):
<one_three>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <two@plt>
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_three>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <two@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"one\0A\00"
@.str.1 = [7 x i8] c"three\0A\00"
define void @one_three() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @two()
%3 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"one\00"
@str.2 = [6 x i8] c"three\00"
define void @one_three() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @two()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char aes_mul2(unsigned char);
void aes_rcon_next(unsigned char *rcon) {
  if (*rcon) {
    *rcon = aes_mul2(*rcon);
  } else {
    *rcon = 0x1;
  }
  return;
}


x86 assembly (clang, -O0):
<aes_rcon_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <aes_rcon_next+0x32>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <aes_mul2@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1149 <aes_rcon_next+0x39>
mov    -0x8(%rbp),%rax
movb   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_rcon_next>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1124 <aes_rcon_next+0x14>
movzbl %al,%edi
call   1030 <aes_mul2@plt>
jmp    1126 <aes_rcon_next+0x16>
mov    $0x1,%al
mov    %al,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @aes_rcon_next(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call zeroext i8 @aes_mul2(i8 zeroext %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8 [ %5, %4 ], [ 1, %1 ]
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void useage() {
  printf("Useage: pfe [x] [y]\n");
  printf("Where x and y bounds for a FAT entry\n");
  exit(1);
}


x86 assembly (clang, -O0):
<useage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<useage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Useage: pfe [x] [y]\0A\00"
@.str.1 = [38 x i8] c"Where x and y bounds for a FAT entry\0A\00"
define void @useage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"Useage: pfe [x] [y]\00"
@str.2 = [37 x i8] c"Where x and y bounds for a FAT entry\00"
define void @useage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ pr_array(int *, int);
int /*<<< orphan*/ printf(char *, int, int);
int search1(int *, int, int);
main() {
  int a[] = {15, 16, 19, 1, 3, 4, 7, 15, 16, 19, 1, 3, 4};
  int t = 4;
  pr_array(a, 13);
  printf("d=%d, index=%d\n", t, search1(a, 13, t));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x34,%edx
call   1060 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1030 <pr_array@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
mov    $0xd,%esi
call   1040 <search1@plt>
mov    -0x48(%rbp),%esi
mov    %eax,%edx
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xef5(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <pr_array@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
mov    $0x4,%edx
call   1040 <search1@plt>
lea    0xea9(%rip),%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.a = [13 x i32] [i32 15, i32 16, i32 19, i32 1, i32 3, i32 4, i32 7, i32 15, i32 16, i32 19, i32 1, i32 3, i32 4]
@.str = [16 x i8] c"d=%d, index=%d\0A\00"
define i32 @main() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%4 = call i32 @pr_array(i32* %3, i32 13)
%5 = call i32 @search1(i32* %3, i32 13, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("./server.o [port]\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"./server.o [port]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"./server.o [port]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
int fun552() { return 552; }


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

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

LLVM IR (-O0):
define i32 @fun552() {
ret i32 552
}

LLVM IR (-O2):
define i32 @fun552() {
ret i32 552
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void ft_putstr(char *s) { write(1, s, ft_strlen(s)); }


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @ft_strlen(i8* %4)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = tail call i32 @ft_strlen(i8* %0)
%3 = tail call i32 @write(i32 1, i8* %0, i32 %2)
ret void
}
void foo_2_1_1_2_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_2_1_2_1() {
ret void
}
int recursive_sum(int n, int exp) {
  if (n == 0)
    return 0;
  return ((power(n, exp)) + recursive_sum(n - 1, exp));
}


x86 assembly (clang, -O0):
<recursive_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1144 <recursive_sum+0x24>
movl   $0x0,-0x4(%rbp)
jmp    116c <recursive_sum+0x4c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <power@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1040 <recursive_sum@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_sum>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
je     1135 <recursive_sum+0x25>
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nop
mov    %ebp,%edi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <power@plt>
add    %eax,%ebx
add    $0xffffffff,%ebp
jne    1120 <recursive_sum+0x10>
jmp    1137 <recursive_sum+0x27>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @recursive_sum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %18
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 (i32, i32, ...) bitcast (i32 (...)* @power to i32 (i32, i32, ...)*)(i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = sub nsw i32 %13, 1
%15 = load i32, i32* %5
%16 = call i32 @recursive_sum(i32 %14, i32 %15)
%17 = add nsw i32 %12, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @recursive_sum(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = phi i32 [ %9, %4 ], [ 0, %2 ]
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @power to i32 (i32, i32, ...)*)(i32 %5, i32 %1)
%8 = add nsw i32 %5, -1
%9 = add nsw i32 %7, %6
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ 0, %2 ], [ %9, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ uart0SendChar(int);
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  } else
    (void)uart0SendChar(c);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114b <printchar+0x3b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1153 <printchar+0x43>
mov    -0xc(%rbp),%edi
call   1030 <uart0SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     1120 <printchar+0x10>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret
mov    %esi,%edi
jmp    1030 <uart0SendChar@plt>

LLVM IR (-O0):
define void @printchar(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 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %18
15: ; preds = %2
%16 = load i32, i32* %4
%17 = call i32 @uart0SendChar(i32 %16)
br label %18
18: ; preds = %15, %7
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %11
9: ; preds = %2
%10 = tail call i32 @uart0SendChar(i32 %1)
br label %11
11: ; preds = %9, %4
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
void FlashIntDisable(uint32_t ui32IntFlags) {
  (*((volatile unsigned long *)(0x400FD010))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<FlashIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    $0x400fd010,%ecx
mov    (%rcx),%rcx
and    %rax,%rcx
mov    $0x400fd010,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlashIntDisable>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
not    %rax
and    %rax,0x400fd010
40
ret

LLVM IR (-O0):
define void @FlashIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074778128 to i64*)
ret void
}

LLVM IR (-O2):
define void @FlashIntDisable(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = xor i64 %3, -1
%5 = load volatile i64, i64* inttoptr (i64 1074778128 to i64*)
%6 = and i64 %5, %4
store volatile i64 %6, i64* inttoptr (i64 1074778128 to i64*)
ret void
}
double pathcon_nm4_twice(double x) { return x + x; }


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

x86 assembly (clang, -O2):
<pathcon_nm4_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathcon_nm4_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void RTI_EnableSleepReq(void) {}


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

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

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

LLVM IR (-O2):
define void @RTI_EnableSleepReq() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ loff_t;

/* Variables and functions */
int /*<<< orphan*/ lseek64(int, int /*<<< orphan*/, int);
loff_t llseek(int fd, loff_t offset, int whence) {
  return lseek64(fd, offset, whence);
}


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

x86 assembly (clang, -O2):
<llseek>:
jmp    1030 <lseek64@plt>

LLVM IR (-O0):
define i32 @llseek(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 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @lseek64(i32 %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @llseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek64(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
void GPMCRdAccessAndCycleTimeTimingConfig(unsigned int baseAddr,
                                          unsigned int csNum,
                                          unsigned int conf) {
  (*((volatile unsigned int *)(baseAddr + (0x70 + (csNum * (0x30)))))) = conf;
}


x86 assembly (clang, -O0):
<GPMCRdAccessAndCycleTimeTimingConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%edx
add    $0x70,%edx
add    %edx,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCRdAccessAndCycleTimeTimingConfig>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x70,%eax
mov    %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCRdAccessAndCycleTimeTimingConfig(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* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = mul i32 %9, 48
%11 = add i32 112, %10
%12 = add i32 %8, %11
%13 = zext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
store volatile i32 %7, i32* %14
ret void
}

LLVM IR (-O2):
define void @GPMCRdAccessAndCycleTimeTimingConfig(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 112
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store volatile i32 %2, i32* %8
ret void
}
/* Variables and functions */
unsigned short permute(unsigned short, int *, int, int);
unsigned short inverseP(unsigned short input) {
  unsigned short postIP;
  int iPBox[8] = {4, 1, 3, 5, 7, 2, 8, 6};
  postIP = permute(input, iPBox, 8, 8);
  return postIP;
}


x86 assembly (clang, -O0):
<inverseP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x2(%rbp),%ax
lea    -0x30(%rbp),%rsi
mov    $0x8,%ecx
movzwl %ax,%edi
mov    %ecx,%edx
call   1030 <permute@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverseP>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x8,%edx
mov    $0x8,%ecx
call   1030 <permute@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.inverseP.iPBox = [8 x i32] [i32 4, i32 1, i32 3, i32 5, i32 7, i32 2, i32 8, i32 6]
define zeroext i16 @inverseP(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
%4 = alloca [8 x i32]
store i16 %0, i16* %2
%5 = bitcast [8 x i32]* %4 to i8*
%6 = load i16, i16* %2
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%8 = call zeroext i16 @permute(i16 zeroext %6, i32* %7, i32 8, i32 8)
store i16 %8, i16* %3
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
@__const.inverseP.iPBox = [8 x i32] [i32 4, i32 1, i32 3, i32 5, i32 7, i32 2, i32 8, i32 6]
define zeroext i16 @inverseP(i16 zeroext %0) {
%2 = alloca [8 x i32]
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call zeroext i16 @permute(i16 zeroext %0, i32* %4, i32 8, i32 8)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_c_string(const char *arg) { printf("in print_c_string: %s\n", arg); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"in print_c_string: %s\0A\00"
define void @print_c_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"in print_c_string: %s\0A\00"
define void @print_c_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
scalar_t__ regexec(int /*<<< orphan*/ const *, char const *, int,
                   int /*<<< orphan*/ *, int /*<<< orphan*/);
int matches_p(const char *string, const regex_t *pattern) {
  if (regexec(pattern, string, 1, NULL, 0) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<matches_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %r8d,%r8d
call   1030 <regexec@plt>
cmp    $0x0,%rax
jne    114f <matches_p+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <matches_p+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matches_p>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <regexec@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @matches_p(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i8*, i8** %4
%8 = call i64 @regexec(i32* %6, i8* %7, i32 1, i32* null, i32 0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @matches_p(i8* %0, i32* %1) {
%3 = tail call i64 @regexec(i32* %1, i8* %0, i32 1, i32* null, i32 0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
void booster_seekdir(void *, int /*<<< orphan*/);
void seekdir(void *dir, off_t offset) { return booster_seekdir(dir, offset); }


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

x86 assembly (clang, -O2):
<seekdir>:
jmp    1030 <booster_seekdir@plt>

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

LLVM IR (-O2):
define void @seekdir(i8* %0, i32 %1) {
tail call void @booster_seekdir(i8* %0, i32 %1)
ret void
}
void *mapping(unsigned long page_addr) {
  void *result;
  if (0 || (page_addr < 0x80000)) {
    result = (void *)(page_addr << 12);
  } else {
    unsigned long alias;
    alias = page_addr & 0x7FFFF;
    alias += 0x80000;
    result = (void *)(alias << 12);
  }
  return result;
}


x86 assembly (clang, -O0):
<mapping>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x80000,-0x8(%rbp)
jae    1127 <mapping+0x27>
mov    -0x8(%rbp),%rax
shl    $0xc,%rax
mov    %rax,-0x10(%rbp)
jmp    114f <mapping+0x4f>
mov    -0x8(%rbp),%rax
and    $0x7ffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x80000,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0xc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapping>:
mov    %rdi,%rcx
shl    $0xc,%rcx
mov    %ecx,%eax
or     $0x80000000,%eax
cmp    $0x80000,%rdi
cmovb  %rcx,%rax
ret

LLVM IR (-O0):
define i8* @mapping(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = icmp ult i64 %5, 524288
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i64, i64* %2
%9 = shl i64 %8, 12
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
br label %19
11: ; preds = %1
%12 = load i64, i64* %2
%13 = and i64 %12, 524287
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = add i64 %14, 524288
store i64 %15, i64* %4
%16 = load i64, i64* %4
%17 = shl i64 %16, 12
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %3
br label %19
19: ; preds = %11, %7
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @mapping(i64 %0) {
%2 = icmp ult i64 %0, 524288
%3 = shl i64 %0, 12
%4 = and i64 %3, 2147479552
%5 = or i64 %4, 2147483648
%6 = select i1 %2, i64 %3, i64 %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
void delay(int amount) {
  for (int i = 0; i < amount * 10; i++) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   $0xa,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1130 <delay+0x30>
jmp    1122 <delay+0x22>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <delay+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
void charatatime(char *str) {
  char *ptr;
  char c;
  setbuf(stdout, NULL);
  for (ptr = str; c = *ptr++;)
    putc(c, stdout);
}


x86 assembly (clang, -O0):
<charatatime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     117b <charatatime+0x5b>
mov    -0x11(%rbp),%al
mov    0x2e74(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1040 <putc@plt>
jmp    1146 <charatatime+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charatatime>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
xor    %esi,%esi
call   1030 <setbuf@plt>
mov    (%rbx),%al
test   %al,%al
je     1166 <charatatime+0x46>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%esi
movsbl %al,%edi
call   1040 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <charatatime+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
define void @charatatime(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i32, i32* @stdout
%6 = call i32 @setbuf(i32 %5, i32* null)
%7 = load i8*, i8** %2
store i8* %7, i8** %3
br label %8
8: ; preds = %13, %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
store i8 %11, i8* %4
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %8
%14 = load i8, i8* %4
%15 = load i32, i32* @stdout
%16 = call i32 @putc(i8 signext %14, i32 %15)
br label %8
17: ; preds = %8
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @charatatime(i8* nocapture %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i8 [ %12, %6 ], [ %4, %1 ]
%8 = phi i8* [ %9, %6 ], [ %0, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i32, i32* @stdout
%11 = tail call i32 @putc(i8 signext %7, i32 %10)
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret void
}
/* Variables and functions */
size_t maxSize(size_t a, size_t b) { return (a > b ? a : b); }


x86 assembly (clang, -O0):
<maxSize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <maxSize+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <maxSize+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxSize>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @maxSize(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp ugt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @maxSize(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void test_info_err_warn() {
  ;
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @test_info_err_warn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LZ4_compressBound(int);
int LZ4_compress_fast_extState(void *, char const *, char *, int,
                               int /*<<< orphan*/, int);
int LZ4_compress_withState(void *state, const char *src, char *dst,
                           int srcSize) {
  return LZ4_compress_fast_extState(state, src, dst, srcSize,
                                    LZ4_compressBound(srcSize), 1);
}


x86 assembly (clang, -O0):
<LZ4_compress_withState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <LZ4_compressBound@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    %eax,%r8d
mov    $0x1,%r9d
call   1040 <LZ4_compress_fast_extState@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compress_withState>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
mov    %ecx,%edi
call   1030 <LZ4_compressBound@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebx,%ecx
mov    %eax,%r8d
mov    $0x1,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <LZ4_compress_fast_extState@plt>

LLVM IR (-O0):
define i32 @LZ4_compress_withState(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = load i32, i32* %8
%14 = call i32 @LZ4_compressBound(i32 %13)
%15 = call i32 @LZ4_compress_fast_extState(i8* %9, i8* %10, i8* %11, i32 %12, i32 %14, i32 1)
ret i32 %15
}

LLVM IR (-O2):
define i32 @LZ4_compress_withState(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @LZ4_compressBound(i32 %3)
%6 = tail call i32 @LZ4_compress_fast_extState(i8* %0, i8* %1, i8* %2, i32 %3, i32 %5, i32 1)
ret i32 %6
}
double my_alg(double u) { return (u * 2.0); }


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

x86 assembly (clang, -O2):
<my_alg>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @my_alg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 2.000000e+00
ret double %4
}

LLVM IR (-O2):
define double @my_alg(double %0) {
%2 = fmul double %0, 2.000000e+00
ret double %2
}
/* Type definitions */
struct Stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clearStack(struct Stack *);
int /*<<< orphan*/ free(struct Stack *);
void freeStack(struct Stack **stack) {
  if (stack == NULL || *stack == NULL)
    return;
  clearStack(*stack);
  free(*stack);
  *stack = NULL;
}


x86 assembly (clang, -O0):
<freeStack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <freeStack+0x25>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    114a <freeStack+0x2a>
jmp    116d <freeStack+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <clearStack@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeStack>:
push   %rbx
test   %rdi,%rdi
je     1145 <freeStack+0x25>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1145 <freeStack+0x25>
call   1040 <clearStack@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.Stack = type { i32 }
define void @freeStack(%struct.Stack** %0) {
%2 = icmp eq %struct.Stack** %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load %struct.Stack*, %struct.Stack** %0
%5 = icmp eq %struct.Stack* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @clearStack(%struct.Stack* %4)
%8 = load %struct.Stack*, %struct.Stack** %0
%9 = tail call i32 @free(%struct.Stack* %8)
store %struct.Stack* null, %struct.Stack** %0
br label %10
10: ; preds = %1, %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENODEV;
int /*<<< orphan*/ errno;
int open(const char *name, int flags, ...) {
  (void)name;
  (void)flags;
  errno = ENODEV;
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec5(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
@errno = global i32 0
define i32 @open(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 = load i32, i32* @ENODEV
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENODEV = global i32 0
@errno = global i32 0
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @ENODEV
store i32 %3, i32* @errno
ret i32 -1
}
int main(void) {
  int x = 10;
  int *a;
  long *b;
  void *p;
  a = &x;
  p = a;
  b = p;
  *b;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ nosmime();
FILE *smime_encrypt(FILE *fp, const char *certfile, const char *to) {
  nosmime();
  return NULL;
}


x86 assembly (clang, -O0):
<smime_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1030 <nosmime@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smime_encrypt>:
push   %rax
xor    %eax,%eax
call   1030 <nosmime@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32* @smime_encrypt(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 (...) @nosmime()
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @smime_encrypt(i32* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (...) @nosmime()
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ add_loose_entry(unsigned char *, size_t);
void mark_for_packing(const unsigned char *sha1, size_t size) {
  add_loose_entry((unsigned char *)sha1, size);
}


x86 assembly (clang, -O0):
<mark_for_packing>:
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 <add_loose_entry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_for_packing>:
jmp    1030 <add_loose_entry@plt>

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

LLVM IR (-O2):
define void @mark_for_packing(i8* %0, i64 %1) {
%3 = tail call i32 @add_loose_entry(i8* %0, i64 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void XRaySetAnnotationFilter(uint32_t filter) {}


x86 assembly (clang, -O0):
<XRaySetAnnotationFilter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @XRaySetAnnotationFilter(i32 %0) {
ret void
}
int _decreasing_float(const void *a, const void *b) {
  if ((*(float *)b) > (*(float *)a))
    return (1);
  else if ((*(float *)b) < (*(float *)a))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<_decreasing_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    112d <_decreasing_float+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    115e <_decreasing_float+0x5e>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1152 <_decreasing_float+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <_decreasing_float+0x5e>
jmp    1157 <_decreasing_float+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_decreasing_float>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_decreasing_float(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** %5
%7 = bitcast i8* %6 to float*
%8 = load float, float* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
%12 = fcmp ogt float %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = bitcast i8* %15 to float*
%17 = load float, float* %16
%18 = load i8*, i8** %4
%19 = bitcast i8* %18 to float*
%20 = load float, float* %19
%21 = fcmp olt float %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 -1, i32* %3
br label %25
23: ; preds = %14
br label %24
24: ; preds = %23
store i32 0, i32* %3
br label %25
25: ; preds = %24, %22, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @_decreasing_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to float*
%4 = load float, float* %3
%5 = bitcast i8* %0 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %4, %6
%8 = fcmp olt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
int a(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9,
      int i10) {
  return i10;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a>:
mov    0x20(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @a(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%21 = load i32, i32* %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 returned %9) {
ret i32 %9
}
void foo(int x) {
bad1:
#pragma omp taskgroup
  goto bad1;
  goto bad2;
#pragma omp taskgroup
  {
  bad2:;
  }
#pragma omp taskgroup
  {
    int i;
    goto ok1;
    for (i = 0; i < 10; ++i) {
    ok1:
      break;
    }
  }
  switch (x) {
#pragma omp taskgroup
    { case 0:; }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <foo+0x7>

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

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

LLVM IR (-O2):
define void @foo(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ kill_pppd_by_cmd(int /*<<< orphan*/);
scalar_t__ kill_pppd_by_pid(int /*<<< orphan*/);
void stop_primary_session(void) {
  if (kill_pppd_by_pid(0) == 0)
    kill_pppd_by_cmd(0);
}


x86 assembly (clang, -O0):
<stop_primary_session>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <kill_pppd_by_pid@plt>
cmp    $0x0,%rax
jne    113c <stop_primary_session+0x1c>
xor    %edi,%edi
call   1040 <kill_pppd_by_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_primary_session>:
push   %rax
xor    %edi,%edi
call   1030 <kill_pppd_by_pid@plt>
test   %rax,%rax
je     112f <stop_primary_session+0xf>
pop    %rax
ret
xor    %edi,%edi
pop    %rax
jmp    1040 <kill_pppd_by_cmd@plt>

LLVM IR (-O0):
define void @stop_primary_session() {
%1 = call i64 @kill_pppd_by_pid(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @kill_pppd_by_cmd(i32 0)
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @stop_primary_session() {
%1 = tail call i64 @kill_pppd_by_pid(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @kill_pppd_by_cmd(i32 0)
br label %5
5: ; preds = %3, %0
ret void
}