xunge/DecIR huggingface dataset:
void *Mem_Alloc(int size) {}


x86 assembly (clang, -O0):
<Mem_Alloc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @Mem_Alloc(i32 %0) {
ret i8* undef
}
/* Variables and functions */
scalar_t__ mock(char *);
char *cf_s_outpkt_mail(char *s) { return (char *)mock(s); }


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

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

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

LLVM IR (-O2):
define i8* @cf_s_outpkt_mail(i8* %0) {
%2 = tail call i64 @mock(i8* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void frint(int jan[], int len) {
  int j;
  for (j = 0; j < len; j++) {
    printf("the mark of [%d] is %d\n", j, jan[j]);
  }
}


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

x86 assembly (clang, -O2):
<frint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <frint+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <frint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"the mark of [%d] is %d\0A\00"
define void @frint(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int partition(int *, int, int);
void __quick_sort(int *arr, int p, int r) {
  int q;
  if (p >= r)
    return;
  q = partition(arr, p, r);
  __quick_sort(arr, p, q - 1);
  __quick_sort(arr, q + 1, r);
}


x86 assembly (clang, -O0):
<__quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1143 <__quick_sort+0x23>
jmp    1179 <__quick_sort+0x59>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <__quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <__quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <__quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <__quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <__quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @__quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @__quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
int pldummy_impress() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_impress() {
ret i32 0
}
void ch_flightstick_pro_write(void *p) {}


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

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

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

LLVM IR (-O2):
define void @ch_flightstick_pro_write(i8* nocapture %0) {
ret void
}
int id_cmp(const void *p1, const void *p2) {
  long id1 = (long)p1;
  long id2 = (long)p2;
  return id1 - id2;
}


x86 assembly (clang, -O0):
<id_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_cmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @id_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = sub nsw i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @id_cmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int embed_dobldobl_Laurent_system(int d) {
  int fail;
  int *b;
  double *c;
  fail = _ada_use_c2phc4c(626, &d, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<embed_dobldobl_Laurent_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x272,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<embed_dobldobl_Laurent_system>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x272,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @embed_dobldobl_Laurent_system(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 626, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @embed_dobldobl_Laurent_system(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 626, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
unsigned months_to_days(unsigned month) { return (month * 3057 - 3007) / 100; }


x86 assembly (clang, -O0):
<months_to_days>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xbf1,-0x4(%rbp),%eax
sub    $0xbbf,%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<months_to_days>:
imul   $0xbf1,%edi,%eax
add    $0xfffff441,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
ret

LLVM IR (-O0):
define i32 @months_to_days(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 3057
%5 = sub i32 %4, 3007
%6 = udiv i32 %5, 100
ret i32 %6
}

LLVM IR (-O2):
define i32 @months_to_days(i32 %0) {
%2 = mul i32 %0, 3057
%3 = add i32 %2, -3007
%4 = udiv i32 %3, 100
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ yyparse();
int main() {
  yyparse();
  printf("No Errors!!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"No Errors!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @yyparse()
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"No Errors!!\00"
define i32 @main() {
%1 = tail call i32 (...) @yyparse()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void malformed_begin(void) {
  printf("uud: malformed begin line\n");
  exit(10);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"uud: malformed begin line\0A\00"
define void @malformed_begin() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 10)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"uud: malformed begin line\00"
define void @malformed_begin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 10)
unreachable
}
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
size_t readlink(char *, char *, int);
int main(void) {
  char buf[1024];
  ssize_t len = readlink("/proc/self/exe", buf, 1023);
  buf[len] = '\0';
  printf("The path to this program is: %s\n", buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x400(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x3ff,%edx
call   1030 <readlink@plt>
mov    %rax,-0x408(%rbp)
mov    -0x408(%rbp),%rax
movb   $0x0,-0x400(%rbp,%rax,1)
lea    -0x400(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
mov    $0x3ff,%edx
call   1030 <readlink@plt>
movb   $0x0,(%rsp,%rax,1)
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [33 x i8] c"The path to this program is: %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3, i32 1023)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %5
store i8 0, i8* %6
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"/proc/self/exe\00"
@.str.1 = [33 x i8] c"The path to this program is: %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i64 @readlink(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %2, i32 1023)
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %3
store i8 0, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ set_binomials();
int /*<<< orphan*/ steps();
int main() {
  set_binomials();
  int n;
  scanf("%d", &n);
  while (n--)
    steps();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <set_binomials@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1176 <main+0x46>
mov    $0x0,%al
call   1030 <steps@plt>
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <set_binomials@plt>
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     115e <main+0x2e>
xor    %eax,%eax
call   1030 <steps@plt>
subl   $0x1,0x4(%rsp)
jae    1150 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 (...) @set_binomials()
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %13, label %8
8: ; preds = %0, %8
%9 = call i32 (...) @steps()
%10 = load i32, i32* %1
%11 = add nsw i32 %10, -1
store i32 %11, i32* %1
%12 = icmp eq i32 %10, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %0
ret i32 0
}
char peek(const char *sp) { return *sp; }


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

x86 assembly (clang, -O2):
<peek>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @peek(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @peek(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Type definitions */
struct ascii85 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _ascii85_write_spaces(struct ascii85 *, unsigned int);
void ascii85_write_spaces(void *ctx, unsigned int z) {
  _ascii85_write_spaces((struct ascii85 *)ctx, z);
}


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

x86 assembly (clang, -O2):
<ascii85_write_spaces>:
jmp    1030 <_ascii85_write_spaces@plt>

LLVM IR (-O0):
%struct.ascii85 = type { i32 }
define void @ascii85_write_spaces(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 = bitcast i8* %5 to %struct.ascii85*
%7 = load i32, i32* %4
%8 = call i32 @_ascii85_write_spaces(%struct.ascii85* %6, i32 %7)
ret void
}

LLVM IR (-O2):
%struct.ascii85 = type { i32 }
define void @ascii85_write_spaces(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to %struct.ascii85*
%4 = tail call i32 @_ascii85_write_spaces(%struct.ascii85* %3, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ is_attr_name(char const);
int __attr_name_len(const char *s) {
  int l;
  for (l = 0; is_attr_name(*s); l++)
    s++;
  return l;
}


x86 assembly (clang, -O0):
<__attr_name_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_attr_name@plt>
cmp    $0x0,%rax
je     1153 <__attr_name_len+0x43>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <__attr_name_len+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__attr_name_len>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsbl (%rdi),%edi
call   1030 <is_attr_name@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1144 <__attr_name_len+0x34>
cs nopw 0x0(%rax,%rax,1)
movsbl 0x1(%r14,%rbx,1),%edi
call   1030 <is_attr_name@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <__attr_name_len+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @__attr_name_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @is_attr_name(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8* [ %8, %5 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = add nuw nsw i32 %6, 1
%10 = load i8, i8* %8
%11 = tail call i64 @is_attr_name(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %14
}
/* Variables and functions */
size_t malloc_usable_size(void *ptr) { return 0; }


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

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

LLVM IR (-O0):
define i64 @malloc_usable_size(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i64 0
}

LLVM IR (-O2):
define i64 @malloc_usable_size(i8* nocapture readnone %0) {
ret i64 0
}
int f(int *restrict a, int *restrict b) {
  (void)a;
  (void)b;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @f(i32* noalias %0, i32* noalias %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @f(i32* noalias nocapture readnone %0, i32* noalias nocapture readnone %1) {
ret i32 0
}
void test_invalid_clause() {
  int i;
#pragma omp target
#pragma omp teams
#pragma omp distribute simd foo bar
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int Serial_Close(int fd) {
  close(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Serial_Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
int test_imm_10int16_reg(short val) {
  return ((val) & (-0x10 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_10int16_reg>:
cmp    $0x10,%di
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_10int16_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, -16
%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_10int16_reg(i16 signext %0) {
%2 = icmp ult i16 %0, 16
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int example_dll_function();
int example_dll_gen_function();
int example_exe_function();
int main(void) {
  return example_dll_function() + example_dll_gen_function() +
         example_exe_function();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <example_dll_function@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <example_dll_gen_function@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <example_exe_function@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <example_dll_function@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <example_dll_gen_function@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1040 <example_exe_function@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @example_dll_function()
%3 = call i32 (...) @example_dll_gen_function()
%4 = add nsw i32 %2, %3
%5 = call i32 (...) @example_exe_function()
%6 = add nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @example_dll_function()
%2 = tail call i32 (...) @example_dll_gen_function()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @example_exe_function()
%5 = add nsw i32 %3, %4
ret i32 %5
}
void SPIM_EnableTxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPIM_EnableTxInt() {
ret void
}
void rec(int **u, int i) {
  if (i >= 2)
    return;
  else {
    rec(u, i + 1);
    if (1) {
      int a;
      (*u) = &a;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jl     112e <rec+0x1e>
jmp    1148 <rec+0x38>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <rec@plt>
mov    -0x8(%rbp),%rax
lea    -0x10(%rbp),%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
cmp    $0x2,%esi
jge    1132 <rec+0x22>
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
add    $0x1,%esi
call   1030 <rec@plt>
lea    0xc(%rsp),%rax
mov    %rax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @rec(i32** nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %6
5: ; preds = %2, %6
ret void
6: ; preds = %2
%7 = add nsw i32 %1, 1
tail call void @rec(i32** %0, i32 %7)
%8 = bitcast i32* %3 to i8*
store i32* %3, i32** %0
br label %5
}
int init_divide_by_zero() {
  int t[2][3][2] = {{{1, 1}, {2, 2}, {3, 3}}, {{4, 4}, {5, 5}, {1, 0}}};
  return t[0][1][0] / t[1][2][1];
}


x86 assembly (clang, -O0):
<init_divide_by_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x30,%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%eax
cltd
idivl  -0x4(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.init_divide_by_zero.t = [2 x [3 x [2 x i32]]] [[3 x [2 x i32]] [[2 x i32] [i32 1, i32 1], [2 x i32] [i32 2, i32 2], [2 x i32] [i32 3, i32 3]], [3 x [2 x i32]] [[2 x i32] [i32 4, i32 4], [2 x i32] [i32 5, i32 5], [2 x i32] [i32 1, i32 0]]]
define i32 @init_divide_by_zero() {
%1 = alloca [2 x [3 x [2 x i32]]]
%2 = bitcast [2 x [3 x [2 x i32]]]* %1 to i8*
%3 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %3, i64 0, i64 1
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x [3 x [2 x i32]]], [2 x [3 x [2 x i32]]]* %1, i64 0, i64 1
%8 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* %7, i64 0, i64 2
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %8, i64 0, i64 1
%10 = load i32, i32* %9
%11 = sdiv i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @init_divide_by_zero() {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(unsigned char);
void print_warning_char(unsigned char byte) { __console_tx_char(byte); }


x86 assembly (clang, -O0):
<print_warning_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_warning_char>:
jmp    1030 <__console_tx_char@plt>

LLVM IR (-O0):
define void @print_warning_char(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @__console_tx_char(i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @print_warning_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void show_version(const char *program) {
  printf("\n%s version : V0.0.1\n", program);
}


x86 assembly (clang, -O0):
<show_version>:
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):
<show_version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [22 x i8] c"\0A%s version : V0.0.1\0A\00"
define void @show_version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ strtoul(char const *, char **, int);
long strtol(const char *str, char **endptr, int base) {
  return (long)strtoul(str, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtol>:
jmp    1030 <strtoul@plt>

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

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void starfree(void *memptr) { free(memptr); }


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

x86 assembly (clang, -O2):
<starfree>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @starfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @starfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int fun115() { return 115; }


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

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

LLVM IR (-O0):
define i32 @fun115() {
ret i32 115
}

LLVM IR (-O2):
define i32 @fun115() {
ret i32 115
}
/* Type definitions */
typedef int u_int64_t;

/* Variables and functions */
size_t bitvector_nwords(u_int64_t nbits) { return ((nbits + 31) >> 5); }


x86 assembly (clang, -O0):
<bitvector_nwords>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1f,%eax
sar    $0x5,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitvector_nwords>:
add    $0x1f,%edi
sar    $0x5,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @bitvector_nwords(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 31
%5 = ashr i32 %4, 5
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @bitvector_nwords(i32 %0) {
%2 = add nsw i32 %0, 31
%3 = ashr i32 %2, 5
%4 = sext i32 %3 to i64
ret i64 %4
}
void D8Led_init(void) { (*(volatile unsigned char *)0x2140000) = ~0; }


x86 assembly (clang, -O0):
<D8Led_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2140000,%eax
movb   $0xff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<D8Led_init>:
movb   $0xff,0x2140000
ff
ret

LLVM IR (-O0):
define void @D8Led_init() {
store volatile i8 -1, i8* inttoptr (i64 34865152 to i8*)
ret void
}

LLVM IR (-O2):
define void @D8Led_init() {
store volatile i8 -1, i8* inttoptr (i64 34865152 to i8*)
ret void
}
int base8() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @base8() {
ret i32 0
}
void decode_eht_entry() {}


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

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

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

LLVM IR (-O2):
define void @decode_eht_entry() {
ret void
}
unsigned char __readb(void *addr) { return *(volatile unsigned char *)addr; }


x86 assembly (clang, -O0):
<__readb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__readb>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @__readb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load volatile i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @__readb(i8* %0) {
%2 = load volatile i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void doHelp(void) {
  (void)printf("control <reset> <flip>   -> <old> <new>    Control filter\n"
               "read                     -> <old>          Read filter\n"
               "set <mask>               -> <old> <new>    Set filter\n"
               "reset <mask>             -> <old> <new>    Reset filter\n"
               "flip <mask>              -> <old> <new>    Toggle filter\n");
  (void)printf("intern <string>          -> <id>           Intern string\n"
               "label <address> <id>                       Label address\n"
               "flush                                      Flush buffer\n"
               "help                                       Print this message\n"
               "quit                                       Quit\n");
}


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

x86 assembly (clang, -O2):
<doHelp>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xff4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [281 x i8] c"control <reset> <flip> -> <old> <new> Control filter\0Aread -> <old> Read filter\0Aset <mask> -> <old> <new> Set filter\0Areset <mask> -> <old> <new> Reset filter\0Aflip <mask> -> <old> <new> Toggle filter\0A\00"
@.str.1 = [281 x i8] c"intern <string> -> <id> Intern string\0Alabel <address> <id> Label address\0Aflush Flush buffer\0Ahelp Print this message\0Aquit Quit\0A\00"
define void @doHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([281 x i8], [281 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([281 x i8], [281 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [280 x i8] c"control <reset> <flip> -> <old> <new> Control filter\0Aread -> <old> Read filter\0Aset <mask> -> <old> <new> Set filter\0Areset <mask> -> <old> <new> Reset filter\0Aflip <mask> -> <old> <new> Toggle filter\00"
@str.2 = [280 x i8] c"intern <string> -> <id> Intern string\0Alabel <address> <id> Label address\0Aflush Flush buffer\0Ahelp Print this message\0Aquit Quit\00"
define void @doHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([280 x i8], [280 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([280 x i8], [280 x i8]* @str.2, i64 0, i64 0))
ret void
}
void v(void) {
  auto int p;
  auto int i;
  auto int q;
  auto int j;
  int l;
}


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

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

LLVM IR (-O0):
define void @v() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
ret void
}

LLVM IR (-O2):
define void @v() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ClearLCD();
int /*<<< orphan*/ PutString2LCD(int, int, int, char *);
int /*<<< orphan*/ PutStringLCD(int, int, int, char *);
void DrawNewGame() {
  ClearLCD();
  PutString2LCD(96, 32, 0xF, "NEW GAME");
  PutStringLCD(84, 112, 0xF, "Waiting player 2...");
  PutStringLCD(116, 192, 0xF, "P) Cancel");
}


x86 assembly (clang, -O0):
<DrawNewGame>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <ClearLCD@plt>
mov    $0x60,%edi
mov    $0x20,%esi
mov    $0xf,%edx
lea    0xeaf(%rip),%rcx
call   1030 <PutString2LCD@plt>
mov    $0x54,%edi
mov    $0x70,%esi
mov    $0xf,%edx
lea    0xe9d(%rip),%rcx
call   1040 <PutStringLCD@plt>
mov    $0x74,%edi
mov    $0xc0,%esi
mov    $0xf,%edx
lea    0xe96(%rip),%rcx
call   1040 <PutStringLCD@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawNewGame>:
push   %rax
xor    %eax,%eax
call   1050 <ClearLCD@plt>
lea    0xec1(%rip),%rcx
mov    $0x60,%edi
mov    $0x20,%esi
mov    $0xf,%edx
call   1030 <PutString2LCD@plt>
lea    0xeaf(%rip),%rcx
mov    $0x54,%edi
mov    $0x70,%esi
mov    $0xf,%edx
call   1040 <PutStringLCD@plt>
lea    0xea8(%rip),%rcx
mov    $0x74,%edi
mov    $0xc0,%esi
mov    $0xf,%edx
pop    %rax
jmp    1040 <PutStringLCD@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"NEW GAME\00"
@.str.1 = [20 x i8] c"Waiting player 2...\00"
@.str.2 = [10 x i8] c"P) Cancel\00"
define void @DrawNewGame() {
%1 = call i32 (...) @ClearLCD()
%2 = call i32 @PutString2LCD(i32 96, i32 32, i32 15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @PutStringLCD(i32 84, i32 112, i32 15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @PutStringLCD(i32 116, i32 192, i32 15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"NEW GAME\00"
@.str.1 = [20 x i8] c"Waiting player 2...\00"
@.str.2 = [10 x i8] c"P) Cancel\00"
define void @DrawNewGame() {
%1 = tail call i32 (...) @ClearLCD()
%2 = tail call i32 @PutString2LCD(i32 96, i32 32, i32 15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @PutStringLCD(i32 84, i32 112, i32 15, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @PutStringLCD(i32 116, i32 192, i32 15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ sin(double);
float my_sinf(float x) { return (float)sin((double)x); }


x86 assembly (clang, -O0):
<my_sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sinf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @my_sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sin(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @my_sinf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sin(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
void ScaleRowDown38_3_Box_C() {}


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

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

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

LLVM IR (-O2):
define void @ScaleRowDown38_3_Box_C() {
ret void
}
/* Variables and functions */
float maxf(float, int /*<<< orphan*/);
int /*<<< orphan*/ minf(float, float);
float clampf(float value, float min_val, float max_val) {
  return maxf(min_val, minf(value, max_val));
}


x86 assembly (clang, -O0):
<clampf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1040 <minf@plt>
movss  -0x10(%rbp),%xmm0
mov    %eax,%edi
call   1030 <maxf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampf>:
push   %rax
movss  %xmm1,0x4(%rsp)
movaps %xmm2,%xmm1
call   1040 <minf@plt>
movss  0x4(%rsp),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1030 <maxf@plt>

LLVM IR (-O0):
define float @clampf(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = load float, float* %6
%10 = call i32 @minf(float %8, float %9)
%11 = call float @maxf(float %7, i32 %10)
ret float %11
}

LLVM IR (-O2):
define float @clampf(float %0, float %1, float %2) {
%4 = tail call i32 @minf(float %0, float %2)
%5 = tail call float @maxf(float %1, i32 %4)
ret float %5
}
TEST_SETUP(atca_cmd_unit_test) { test_assert_interface_init(); }


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

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

LLVM IR (-O0):
define i32 @TEST_SETUP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @test_assert_interface_init()
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @TEST_SETUP(i32 %0) {
%2 = tail call i32 (...) @test_assert_interface_init()
ret i32 undef
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_back_req(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x0080);
}


x86 assembly (clang, -O0):
<ieee80211_is_back_req>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x84,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_back_req>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x84,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_back_req(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 132)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_back_req(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 132)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void popXor() {
  emitln("pop\t%%ebx");
  emitln("xor\t%%ebx,%%eax");
}


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

x86 assembly (clang, -O2):
<popXor>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee6(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"xor\09%%ebx,%%eax\00"
define void @popXor() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"xor\09%%ebx,%%eax\00"
define void @popXor() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WrongAssign(int *);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ printf(char *, int);
void TestWrongAssign(void) {
  int *myint = NULL;
  int i;
  WrongAssign(myint);
  for (i = 0; i < 10; ++i) {
    printf("TestWrongAssign %d\n", myint[i]);
  }
  if (myint != NULL)
    free(myint);
}


x86 assembly (clang, -O0):
<TestWrongAssign>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <WrongAssign@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    117f <TestWrongAssign+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe94(%rip),%rdi
call   1050 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <TestWrongAssign+0x20>
cmpq   $0x0,-0x8(%rbp)
je     1193 <TestWrongAssign+0x63>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @TestWrongAssign() {
%1 = tail call i32 @WrongAssign(i32* null)
unreachable
}