xunge/DecIR huggingface dataset:
/* Type definitions */
struct ADrawTag {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ getSvgPen(struct ADrawTag *);
int /*<<< orphan*/ svgRect(struct ADrawTag *, int /*<<< orphan*/, unsigned int,
                           unsigned int, unsigned int, unsigned int);
void SvgFilledRectangle(struct ADrawTag *ctx, unsigned int x1, unsigned int y1,
                        unsigned int x2, unsigned int y2) {
  svgRect(ctx, getSvgPen(ctx), x1, y1, x2, y2);
}


x86 assembly (clang, -O0):
<SvgFilledRectangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getSvgPen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
call   1040 <svgRect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SvgFilledRectangle>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <getSvgPen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <svgRect@plt>

LLVM IR (-O0):
%struct.ADrawTag = type { i32 }
define void @SvgFilledRectangle(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.ADrawTag*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.ADrawTag* %0, %struct.ADrawTag** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%12 = load %struct.ADrawTag*, %struct.ADrawTag** %6
%13 = call i32 @getSvgPen(%struct.ADrawTag* %12)
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = call i32 @svgRect(%struct.ADrawTag* %11, i32 %13, i32 %14, i32 %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
%struct.ADrawTag = type { i32 }
define void @SvgFilledRectangle(%struct.ADrawTag* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @getSvgPen(%struct.ADrawTag* %0)
%7 = tail call i32 @svgRect(%struct.ADrawTag* %0, i32 %6, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ putchar(int);
int main() {
  int c = (getchar() != EOF);
  while (c != 1) {
    putchar(c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eab(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     1162 <main+0x42>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    114b <main+0x2b>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
cmp    (%rcx),%rax
jne    1149 <main+0x29>
xor    %edi,%edi
call   1030 <putchar@plt>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <putchar@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = zext i1 %5 to i32
store i32 %6, i32* %2
br label %7
7: ; preds = %10, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32 @putchar(i32 %11)
br label %7
13: ; preds = %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@EOF = global i64 0
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i32 @putchar(i32 0)
br label %6
6: ; preds = %6, %4
%7 = tail call i32 @putchar(i32 0)
br label %6
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cio_byteout(unsigned char);
void cio_write(long long v, int n) {
  int i;
  for (i = n - 1; i >= 0; i--) {
    cio_byteout((unsigned char)((v >> (i << 3)) & 0xff));
  }
}


x86 assembly (clang, -O0):
<cio_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     115d <cio_write+0x4d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
mov    %ecx,%ecx
sar    %cl,%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <cio_byteout@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <cio_write+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cio_write>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1151 <cio_write+0x41>
mov    %rdi,%r14
mov    %esi,%r15d
lea    -0x8(,%r15,8),%rbx
ff
add    $0x1,%r15
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ecx
and    $0xf8,%cl
mov    %r14,%rax
sar    %cl,%rax
movzbl %al,%edi
call   1030 <cio_byteout@plt>
add    $0xffffffffffffffff,%r15
add    $0xfffffffffffffff8,%rbx
cmp    $0x1,%r15
ja     1130 <cio_write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @cio_write(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
store i32 %7, i32* %5
br label %8
8: ; preds = %20, %2
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %8
%12 = load i64, i64* %3
%13 = load i32, i32* %5
%14 = shl i32 %13, 3
%15 = zext i32 %14 to i64
%16 = ashr i64 %12, %15
%17 = and i64 %16, 255
%18 = trunc i64 %17 to i8
%19 = call i32 @cio_byteout(i8 zeroext %18)
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, -1
store i32 %22, i32* %5
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @cio_write(i64 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = shl i64 %8, 3
%10 = and i64 %9, 4294967288
%11 = ashr i64 %0, %10
%12 = trunc i64 %11 to i8
%13 = tail call i32 @cio_byteout(i8 zeroext %12)
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %2
ret void
}
/* Type definitions */
struct inode {
  int dummy;
};

/* Variables and functions */
struct inode *au_h_iptr_i(struct inode *, int /*<<< orphan*/);
int /*<<< orphan*/ ibstart(struct inode *);
struct inode *au_h_iptr(struct inode *inode) {
  return au_h_iptr_i(inode, ibstart(inode));
}


x86 assembly (clang, -O0):
<au_h_iptr>:
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   1030 <ibstart@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <au_h_iptr_i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<au_h_iptr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <ibstart@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <au_h_iptr_i@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
define %struct.inode* @au_h_iptr(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
%3 = load %struct.inode*, %struct.inode** %2
%4 = load %struct.inode*, %struct.inode** %2
%5 = call i32 @ibstart(%struct.inode* %4)
%6 = call %struct.inode* @au_h_iptr_i(%struct.inode* %3, i32 %5)
ret %struct.inode* %6
}

LLVM IR (-O2):
%struct.inode = type { i32 }
define %struct.inode* @au_h_iptr(%struct.inode* %0) {
%2 = tail call i32 @ibstart(%struct.inode* %0)
%3 = tail call %struct.inode* @au_h_iptr_i(%struct.inode* %0, i32 %2)
ret %struct.inode* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void copy_header(FILE *f) {
  fprintf(
      f,
      "/******************************************************************/\n");
  fprintf(
      f,
      "/* THIS IS AN AUTOMATICALLY GENERATED FILE.  DO NOT EDIT IT!!!!!! */\n");
  fprintf(
      f,
      "/******************************************************************/\n");
}


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

x86 assembly (clang, -O2):
<copy_header>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%r14
mov    $0x45,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xf0c(%rip),%rdi
mov    $0x45,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
mov    $0x45,%esi
mov    $0x1,%edx
mov    %r14,%rdi
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [70 x i8] c"/******************************************************************/\0A\00"
@.str.1 = [70 x i8] c"/* THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT!!!!!! */\0A\00"
define void @copy_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [70 x i8] c"/******************************************************************/\0A\00"
@.str.1 = [70 x i8] c"/* THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT IT!!!!!! */\0A\00"
define void @copy_header(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i64 69, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.1, i64 0, i64 0), i64 69, i64 1, i32* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i64 69, i64 1, i32* %0)
ret void
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
char *getusername() {
  char *user = 0;
  struct passwd *pw = getpwuid(getuid());
  if (pw)
    user = pw->pw_name;
  return user;
}


x86 assembly (clang, -O0):
<getusername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1158 <getusername+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getusername>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1139 <getusername+0x19>
mov    (%rax),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i8* }
define i8* @getusername() {
%1 = alloca i8*
%2 = alloca %struct.passwd*
store i8* null, i8** %1
%3 = call i32 (...) @getuid()
%4 = call %struct.passwd* @getpwuid(i32 %3)
store %struct.passwd* %4, %struct.passwd** %2
%5 = load %struct.passwd*, %struct.passwd** %2
%6 = icmp ne %struct.passwd* %5, null
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load %struct.passwd*, %struct.passwd** %2
%9 = getelementptr inbounds %struct.passwd, %struct.passwd* %8, i32 0, i32 0
%10 = load i8*, i8** %9
store i8* %10, i8** %1
br label %11
11: ; preds = %7, %0
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
define i8* @getusername() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %0
%8 = phi i8* [ %6, %4 ], [ null, %0 ]
ret i8* %8
}
int trans_4_x(int x, int y) { return -x; }


x86 assembly (clang, -O0):
<trans_4_x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @trans_4_x(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %0
ret i32 %3
}
float getArrayF(float *arr, int idx) { return arr[idx]; }


x86 assembly (clang, -O0):
<getArrayF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArrayF>:
movslq %esi,%rax
movss  (%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @getArrayF(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds float, float* %5, i64 %7
%9 = load float, float* %8
ret float %9
}

LLVM IR (-O2):
define float @getArrayF(float* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds float, float* %0, i64 %3
%5 = load float, float* %4
ret float %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int refine_root(int n, int *m, double *c) {
  int *a, fail;
  int b[2];
  b[0] = n;
  b[1] = *m;
  fail = _ada_use_c2phc(149, a, b, c, 0);
  *m = b[1];
  return fail;
}


x86 assembly (clang, -O0):
<refine_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x95,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<refine_root>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %edi,0x8(%rsp)
mov    (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdx
mov    $0x95,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @refine_root(i32 %0, i32* %1, double* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [2 x i32]
store i32 %0, i32* %4
store i32* %1, i32** %5
store double* %2, double** %6
%10 = load i32, i32* %4
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
store i32 %13, i32* %14
%15 = load i32*, i32** %7
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%17 = load double*, double** %6
%18 = call i32 @_ada_use_c2phc(i32 149, i32* %15, i32* %16, double* %17, i32 0)
store i32 %18, i32* %8
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 1
%20 = load i32, i32* %19
%21 = load i32*, i32** %5
store i32 %20, i32* %21
%22 = load i32, i32* %8
ret i32 %22
}

LLVM IR (-O2):
define i32 @refine_root(i32 %0, i32* nocapture %1, double* %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = load i32, i32* %1
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %7, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 149, i32* undef, i32* %6, double* %2, i32 0)
%10 = load i32, i32* %8
store i32 %10, i32* %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ test_case();
int main() {
  int n;
  scanf("%d", &n);
  while (n--)
    test_case();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%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     115f <main+0x3f>
mov    $0x0,%al
call   1030 <test_case@plt>
jmp    113f <main+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x4(%rsp)
jb     114e <main+0x2e>
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <test_case@plt>
subl   $0x1,0x4(%rsp)
jae    1140 <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 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 (...) @test_case()
br label %4
10: ; preds = %4
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, -1
store i32 %5, i32* %1
%6 = icmp eq i32 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %0, %7
%8 = call i32 (...) @test_case()
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glEnd();
void EndPrim(void) { glEnd(); }


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

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

LLVM IR (-O0):
define void @EndPrim() {
%1 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
define void @EndPrim() {
%1 = tail call i32 (...) @glEnd()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void USBPHYPowerOff(uint32_t ui32Base) {
  (*((volatile uint8_t *)(ui32Base + 0x00000001))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<USBPHYPowerOff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%ecx
or     $0x1,%ecx
mov    %ecx,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBPHYPowerOff>:
orl    $0x1,0x1(%rdi)
ret

LLVM IR (-O0):
define void @USBPHYPowerOff(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = or i32 %6, 1
store volatile i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @USBPHYPowerOff(i64 %0) {
%2 = add nsw i64 %0, 1
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
%5 = or i32 %4, 1
store volatile i32 %5, i32* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t align(uint32_t size, uint32_t alignment) {
  return ((size + alignment - 1) / alignment) * alignment;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @align(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
%8 = sub nsw i32 %7, 1
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @align(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = srem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
/* Variables and functions */
long long WaitMsg259(unsigned long);
long long waitmsg(unsigned long uM) { return WaitMsg259(uM); }


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

x86 assembly (clang, -O2):
<waitmsg>:
jmp    1030 <WaitMsg259@plt>

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

LLVM IR (-O2):
define i64 @waitmsg(i64 %0) {
%2 = tail call i64 @WaitMsg259(i64 %0)
ret i64 %2
}
/* Variables and functions */
int sqrt(int);
bool issquare(int x) {
  int s = sqrt(x);
  return s * s == x;
}


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

x86 assembly (clang, -O2):
<issquare>:
push   %rbx
mov    %edi,%ebx
call   1030 <sqrt@plt>
imul   %eax,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @issquare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sqrt(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = load i32, i32* %2
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @issquare(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = mul nsw i32 %2, %2
%4 = icmp eq i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun3(int a) { printf("Value of a is %d\n", a + 2); }


x86 assembly (clang, -O0):
<fun3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
add    $0x2,%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun3>:
lea    0x2(%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Value of a is %d\0A\00"
define void @fun3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Value of a is %d\0A\00"
define void @fun3(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int readstring(readbuffer)
char *readbuffer;
{
  int c_max;
  c_max = read(1, readbuffer, 512);
  if (c_max <= 0) {
    exit(0);
  }
  return c_max;
}


x86 assembly (clang, -O0):
<readstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
mov    $0x200,%edx
mov    $0x0,%al
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1155 <readstring+0x35>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readstring>:
push   %rax
mov    %rdi,%rsi
mov    $0x1,%edi
mov    $0x200,%edx
xor    %eax,%eax
call   1030 <read@plt>
test   %eax,%eax
jle    113b <readstring+0x1b>
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @readstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %4, i32 512)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
unreachable
9: ; preds = %1
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @readstring(i8* %0) {
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %0, i32 512)
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %1
tail call void @exit(i32 0)
unreachable
5: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int XTL_SubVars_GetValueInt(char *);
int XTL_SubVars_UpdateInt(char *, int);
int XTL_SubVars_IncrementValue(char *key) {
  int retval;
  retval = XTL_SubVars_GetValueInt(key);
  if (retval == -9999)
    return -1;
  ++retval;
  return XTL_SubVars_UpdateInt(key, retval);
}


x86 assembly (clang, -O0):
<XTL_SubVars_IncrementValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <XTL_SubVars_GetValueInt@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffd8f1,-0x14(%rbp)
jne    1151 <XTL_SubVars_IncrementValue+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <XTL_SubVars_IncrementValue+0x49>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <XTL_SubVars_UpdateInt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XTL_SubVars_IncrementValue>:
push   %rbx
mov    %rdi,%rbx
call   1040 <XTL_SubVars_GetValueInt@plt>
cmp    $0xffffd8f1,%eax
jne    1137 <XTL_SubVars_IncrementValue+0x17>
mov    $0xffffffff,%eax
pop    %rbx
ret
add    $0x1,%eax
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <XTL_SubVars_UpdateInt@plt>

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

LLVM IR (-O2):
define i32 @XTL_SubVars_IncrementValue(i8* %0) {
%2 = tail call i32 @XTL_SubVars_GetValueInt(i8* %0)
%3 = icmp eq i32 %2, -9999
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nsw i32 %2, 1
%6 = tail call i32 @XTL_SubVars_UpdateInt(i8* %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char);
void PrintBite(int x, FILE *f) {
  if (x < 10) {
    fprintf(f, "%c", '0' + x);
  } else {
    int y = x - 10;
    fprintf(f, "%c", 'A' + y);
  }
}


x86 assembly (clang, -O0):
<PrintBite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1147 <PrintBite+0x37>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%eax
add    $0x30,%eax
lea    0xec6(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
jmp    1169 <PrintBite+0x59>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%eax
add    $0x41,%eax
lea    0xe9f(%rip),%rsi
movsbl %al,%edx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintBite>:
mov    %edi,%eax
shl    $0x18,%eax
lea    0x37000000(%rax),%ecx
add    $0x30000000,%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
sar    $0x18,%eax
mov    %eax,%edi
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @PrintBite(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 10
%4 = shl i32 %0, 24
%5 = select i1 %3, i32 805306368, i32 922746880
%6 = add i32 %4, %5
%7 = ashr exact i32 %6, 24
%8 = tail call i32 @fputc(i32 %7, i32* %1)
ret void
}
/* Variables and functions */
int fab(int);
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int k = 12;
  printf("fabonacci[%d]=%d\n", k, fab(k));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fab@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <fab@plt>
lea    0xece(%rip),%rdi
mov    $0xc,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"fabonacci[%d]=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 12, i32* %1
%2 = load i32, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @fab(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"fabonacci[%d]=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fab(i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 12, i32 %1)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int a;
  int b;
  a = __VERIFIER_nondet_int();
  b = __VERIFIER_nondet_int();
  if (a == b) {
    goto ERROR;
  } else {
    a = b;
  }
  if (a == b) {
    return 0;
  } else {
  ERROR:
    return -1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1144 <main+0x34>
jmp    1167 <main+0x57>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1162 <main+0x52>
movl   $0x0,-0x4(%rbp)
jmp    116e <main+0x5e>
jmp    1167 <main+0x57>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %1, %2
%4 = sext i1 %3 to i32
ret i32 %4
}
void RTThreadCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadCreate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ croak(char *, char *);
int not_here(char *s) {
  croak("%s not implemented on this architecture", s);
  return -1;
}


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

x86 assembly (clang, -O2):
<not_here>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <croak@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"%s not implemented on this architecture\00"
define i32 @not_here(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @croak(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 -1
}

LLVM IR (-O2):
@.str = [40 x i8] c"%s not implemented on this architecture\00"
define i32 @not_here(i8* %0) {
%2 = tail call i32 @croak(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void main() { print("hello world!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world!\00"
define void @main() {
%1 = call i32 @print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world!\00"
define void @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbg_break();
int /*<<< orphan*/ dbg_msg(char *, char *, char const *, int, char const *);
void dbg_assert_imp(const char *filename, int line, int test, const char *msg) {
  if (!test) {
    dbg_msg("assert", "%s(%d): %s", filename, line, msg);
    dbg_break();
  }
}


x86 assembly (clang, -O0):
<dbg_assert_imp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1165 <dbg_assert_imp+0x45>
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeae(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1040 <dbg_msg@plt>
mov    $0x0,%al
call   1030 <dbg_break@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_assert_imp>:
test   %edx,%edx
je     1125 <dbg_assert_imp+0x5>
ret
push   %rax
mov    %rcx,%r8
mov    %esi,%ecx
mov    %rdi,%rax
lea    0xecb(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    %rax,%rdx
call   1040 <dbg_msg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <dbg_break@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"assert\00"
@.str.1 = [11 x i8] c"%s(%d): %s\00"
define void @dbg_assert_imp(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 @dbg_msg(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1, i8* %3)
%8 = tail call i32 (...) @dbg_break()
br label %9
9: ; preds = %6, %4
ret void
}
void delay(void) {
  volatile double d = 1.0;
  int i;
  for (i = 0; i < 10000; i++) {
    d = d * d + d / d;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1158 <delay+0x58>
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <delay+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movabs $0x3ff0000000000000,%rax
mov    %rax,-0x8(%rsp)
mov    $0x2710,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  -0x8(%rsp),%xmm0
mulsd  -0x8(%rsp),%xmm0
movsd  -0x8(%rsp),%xmm1
divsd  -0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
mulsd  -0x8(%rsp),%xmm0
movsd  -0x8(%rsp),%xmm1
divsd  -0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rsp)
add    $0xfffffffe,%eax
jne    1120 <delay+0x20>
ret

LLVM IR (-O0):
define void @delay() {
%1 = alloca double
%2 = alloca i32
store volatile double 1.000000e+00, double* %1
store i32 0, i32* %2
br label %3
3: ; preds = %13, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = load volatile double, double* %1
%8 = load volatile double, double* %1
%9 = load volatile double, double* %1
%10 = load volatile double, double* %1
%11 = fdiv double %9, %10
%12 = call double @llvm.fmuladd.f64(double %7, double %8, double %11)
store volatile double %12, double* %1
br label %13
13: ; preds = %6
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %3
16: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store volatile double 1.000000e+00, double* %1
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %17, %3 ]
%5 = load volatile double, double* %1
%6 = load volatile double, double* %1
%7 = load volatile double, double* %1
%8 = load volatile double, double* %1
%9 = fdiv double %7, %8
%10 = tail call double @llvm.fmuladd.f64(double %5, double %6, double %9)
store volatile double %10, double* %1
%11 = load volatile double, double* %1
%12 = load volatile double, double* %1
%13 = load volatile double, double* %1
%14 = load volatile double, double* %1
%15 = fdiv double %13, %14
%16 = tail call double @llvm.fmuladd.f64(double %11, double %12, double %15)
store volatile double %16, double* %1
%17 = add nuw nsw i32 %4, 2
%18 = icmp eq i32 %17, 10000
br i1 %18, label %19, label %3
19: ; preds = %3
ret void
}
int __dlclose(void *fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @__dlclose(i8* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
struct kdtree {
  int dummy;
};
struct kdres {
  int dummy;
};

/* Variables and functions */
struct kdres *kd_nearest3_w_filter(struct kdtree *, double, double, double,
                                   int /*<<< orphan*/ *);
struct kdres *kd_nearest3(struct kdtree *tree, double x, double y, double z) {
  return kd_nearest3_w_filter(tree, x, y, z, NULL);
}


x86 assembly (clang, -O0):
<kd_nearest3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
xor    %eax,%eax
mov    %eax,%esi
call   1030 <kd_nearest3_w_filter@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_nearest3>:
xor    %esi,%esi
jmp    1030 <kd_nearest3_w_filter@plt>

LLVM IR (-O0):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest3(%struct.kdtree* %0, double %1, double %2, double %3) {
%5 = alloca %struct.kdtree*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store %struct.kdtree* %0, %struct.kdtree** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load %struct.kdtree*, %struct.kdtree** %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call %struct.kdres* @kd_nearest3_w_filter(%struct.kdtree* %9, double %10, double %11, double %12, i32* null)
ret %struct.kdres* %13
}

LLVM IR (-O2):
%struct.kdres = type { i32 }
%struct.kdtree = type { i32 }
define %struct.kdres* @kd_nearest3(%struct.kdtree* %0, double %1, double %2, double %3) {
%5 = tail call %struct.kdres* @kd_nearest3_w_filter(%struct.kdtree* %0, double %1, double %2, double %3, i32* null)
ret %struct.kdres* %5
}
/* Variables and functions */
int /*<<< orphan*/ afficher();
int /*<<< orphan*/ lirePlateau();
int /*<<< orphan*/ sleep(int);
void afficherPlateau() {
  lirePlateau();
  afficher();
  sleep(3);
}


x86 assembly (clang, -O0):
<afficherPlateau>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lirePlateau@plt>
mov    $0x0,%al
call   1030 <afficher@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherPlateau>:
push   %rax
xor    %eax,%eax
call   1040 <lirePlateau@plt>
xor    %eax,%eax
call   1030 <afficher@plt>
mov    $0x3,%edi
pop    %rax
jmp    1050 <sleep@plt>

LLVM IR (-O0):
define void @afficherPlateau() {
%1 = call i32 (...) @lirePlateau()
%2 = call i32 (...) @afficher()
%3 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
define void @afficherPlateau() {
%1 = tail call i32 (...) @lirePlateau()
%2 = tail call i32 (...) @afficher()
%3 = tail call i32 @sleep(i32 3)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int binary_search() { return EXIT_SUCCESS; }


x86 assembly (clang, -O0):
<binary_search>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_search>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @binary_search() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @binary_search() {
%1 = load i32, i32* @EXIT_SUCCESS
ret i32 %1
}
void peripheral_modules_enable(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @debug_pos_asserv() {
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int globcmp(const void *a, const void *b) {
  return strcmp(*(char **)a, *(char **)b);
}


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

x86 assembly (clang, -O2):
<globcmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @globcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
char *ReverseArr(char *x, int size) { int i; }


x86 assembly (clang, -O0):
<ReverseArr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8* @ReverseArr(i8* nocapture readnone %0, i32 %1) {
ret i8* undef
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int /*<<< orphan*/ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int main(void) {
  struct stat buf;
  if (stat(".", &buf) || !S_ISDIR(buf.st_mode))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jne    115a <main+0x3a>
mov    -0x8(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%eax
jne    1166 <main+0x46>
movl   $0x1,-0x4(%rbp)
jmp    116d <main+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113f <main+0x1f>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = call i64 @stat(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %struct.stat* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISDIR(i32 %7)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %0
%12 = phi i32 [ 1, %0 ], [ %10, %5 ]
ret i32 %12
}