xunge/DecIR huggingface dataset:
unsigned char GetBit(unsigned char byte, unsigned char val) {
  return ((byte & (0x01 << val)) != 0);
}


x86 assembly (clang, -O0):
<GetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBit>:
bt     %esi,%edi
setb   %al
ret

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

LLVM IR (-O2):
define zeroext i8 @GetBit(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %3
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ checkTainted(char **);
int /*<<< orphan*/ checkUntainted(char **);
void test2(char **def) {
  checkUntainted(def);
  checkTainted(def);
}


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

x86 assembly (clang, -O2):
<test2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <checkUntainted@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <checkTainted@plt>

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

LLVM IR (-O2):
define void @test2(i8** %0) {
%2 = tail call i32 @checkUntainted(i8** %0)
%3 = tail call i32 @checkTainted(i8** %0)
ret void
}
/* Variables and functions */
float sqrt(float const);
float vlength(const float v[3]) {
  return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<vlength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlength>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <vlength+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @vlength(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call float @sqrt(float %23)
ret float %24
}

LLVM IR (-O2):
define float @vlength(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrt(float %9)
ret float %10
}
/* Type definitions */
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char a;
  int b;
  double c;
  printf("%d\n", sizeof(a));
  printf("%d\n", sizeof(b));
  printf("%d\n", sizeof(c));
  printf("%d\n", sizeof(!a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
char *allocate(int /*<<< orphan*/, int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *copystr(const char *s) {
  char *c;
  c = allocate(0, (strlen(s) + 1) * sizeof(s[0]));
  strcpy(c, s);
  return c;
}


x86 assembly (clang, -O0):
<copystr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
xor    %edi,%edi
call   1050 <allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copystr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%esi
xor    %edi,%edi
call   1050 <allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copystr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @allocate(i32 0, i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @copystr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @allocate(i32 0, i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int socketcall(int (*)(int, int, int, void const *, int /*<<< orphan*/), int,
               int, int, void const *, int /*<<< orphan*/, int /*<<< orphan*/);
int setsockopt(int fd, int level, int optname, const void *optval,
               socklen_t optlen) {
  return socketcall(setsockopt, fd, level, optname, optval, optlen, 0);
}


x86 assembly (clang, -O0):
<setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    0x2ea7(%rip),%rdi
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1030 <socketcall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsockopt>:
push   %rax
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movl   $0x0,(%rsp)
mov    0x2ebd(%rip),%rdi
call   1030 <socketcall@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @socketcall(i32 (i32, i32, i32, i8*, i32)* @setsockopt, i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ callee1(int, char *, double);
int /*<<< orphan*/ callme(int);
int /*<<< orphan*/ do_nothing();
main() {
  callee1(2, "A string argument.", 3.5);
  callee1(2, "A string argument.", 3.5);
  do_nothing();
  callme(1);
  callme(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
lea    0xebd(%rip),%rsi
movsd  0xead(%rip),%xmm0
call   1030 <callee1@plt>
mov    $0x2,%edi
lea    0xea4(%rip),%rsi
movsd  0xe94(%rip),%xmm0
call   1030 <callee1@plt>
mov    $0x0,%al
call   1040 <do_nothing@plt>
mov    $0x1,%edi
call   1050 <callme@plt>
mov    $0x2,%edi
call   1050 <callme@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed0(%rip),%rbx
movsd  0xec0(%rip),%xmm0
mov    $0x2,%edi
mov    %rbx,%rsi
call   1030 <callee1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
movsd  0xea3(%rip),%xmm0
call   1030 <callee1@plt>
xor    %eax,%eax
call   1040 <do_nothing@plt>
mov    $0x1,%edi
call   1050 <callme@plt>
mov    $0x2,%edi
call   1050 <callme@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"A string argument.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%4 = call i32 (...) @do_nothing()
%5 = call i32 @callme(i32 1)
%6 = call i32 @callme(i32 2)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"A string argument.\00"
define i32 @main() {
%1 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%2 = tail call i32 @callee1(i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 3.500000e+00)
%3 = tail call i32 (...) @do_nothing()
%4 = tail call i32 @callme(i32 1)
%5 = tail call i32 @callme(i32 2)
ret i32 0
}
/* Type definitions */
struct gengetopt_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct gengetopt_args_info *);
int /*<<< orphan*/ clear_given(struct gengetopt_args_info *);
int /*<<< orphan*/ init_args_info(struct gengetopt_args_info *);
void imagetag_cmdline_init(struct gengetopt_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<imagetag_cmdline_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imagetag_cmdline_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.gengetopt_args_info = type { i32 }
define void @imagetag_cmdline_init(%struct.gengetopt_args_info* %0) {
%2 = alloca %struct.gengetopt_args_info*
store %struct.gengetopt_args_info* %0, %struct.gengetopt_args_info** %2
%3 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %2
%4 = call i32 @clear_given(%struct.gengetopt_args_info* %3)
%5 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %2
%6 = call i32 @clear_args(%struct.gengetopt_args_info* %5)
%7 = load %struct.gengetopt_args_info*, %struct.gengetopt_args_info** %2
%8 = call i32 @init_args_info(%struct.gengetopt_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.gengetopt_args_info = type { i32 }
define void @imagetag_cmdline_init(%struct.gengetopt_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.gengetopt_args_info* %0)
%3 = tail call i32 @clear_args(%struct.gengetopt_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.gengetopt_args_info* %0)
ret void
}
void glmSubtractMatrix2f(float result[4], const float m1[4],
                         const float m2[4]) {
  int i;
  for (i = 0; i < 4; i++)
    result[i] = m1[i] - m2[i];
}


x86 assembly (clang, -O0):
<glmSubtractMatrix2f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    1156 <glmSubtractMatrix2f+0x56>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <glmSubtractMatrix2f+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSubtractMatrix2f>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
movss  0xc(%rsi),%xmm0
subss  0xc(%rdx),%xmm0
movss  %xmm0,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @glmSubtractMatrix2f(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds float, float* %1, i64 3
%20 = load float, float* %19
%21 = getelementptr inbounds float, float* %2, i64 3
%22 = load float, float* %21
%23 = fsub float %20, %22
%24 = getelementptr inbounds float, float* %0, i64 3
store float %23, float* %24
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo_smp();
int main() {
  foo_smp();
#pragma omp taskwait
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @foo_smp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo_smp()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ A1();
int *func1(int *arg) {
  A1();
  return arg;
}


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

x86 assembly (clang, -O2):
<func1>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <A1@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @func1(i32* readnone returned %0) {
%2 = tail call i32 (...) @A1()
ret i32* %0
}
/* Variables and functions */
scalar_t__ pow(int, int);
int sqrt(scalar_t__);
double get_answer_minus(int a, int b, int c) {
  return (-b - sqrt(pow(b, 2) - 4 * a * c)) / 2 * a;
}


x86 assembly (clang, -O0):
<get_answer_minus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x2,%esi
call   1030 <pow@plt>
mov    %rax,%rdi
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
imul   -0xc(%rbp),%eax
cltq
sub    %rax,%rdi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_answer_minus>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r14d
mov    %esi,%edi
mov    $0x2,%esi
call   1030 <pow@plt>
imul   %r14d,%ebp
shl    $0x2,%ebp
movslq %ebp,%rcx
sub    %rcx,%rax
mov    %rax,%rdi
call   1040 <sqrt@plt>
add    %ebx,%eax
mov    %eax,%ecx
neg    %ecx
shr    $0x1f,%ecx
sub    %eax,%ecx
sar    %ecx
imul   %r14d,%ecx
cvtsi2sd %ecx,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define double @get_answer_minus(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %5
%10 = call i64 @pow(i32 %9, i32 2)
%11 = load i32, i32* %4
%12 = mul nsw i32 4, %11
%13 = load i32, i32* %6
%14 = mul nsw i32 %12, %13
%15 = sext i32 %14 to i64
%16 = sub nsw i64 %10, %15
%17 = call i32 @sqrt(i64 %16)
%18 = sub nsw i32 %8, %17
%19 = sdiv i32 %18, 2
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = sitofp i32 %21 to double
ret double %22
}

LLVM IR (-O2):
define double @get_answer_minus(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @pow(i32 %1, i32 2)
%5 = shl nsw i32 %0, 2
%6 = mul nsw i32 %5, %2
%7 = sext i32 %6 to i64
%8 = sub nsw i64 %4, %7
%9 = tail call i32 @sqrt(i64 %8)
%10 = add i32 %9, %1
%11 = sub i32 0, %10
%12 = sdiv i32 %11, 2
%13 = mul nsw i32 %12, %0
%14 = sitofp i32 %13 to double
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ CNFGFlushRender();
int /*<<< orphan*/ CNFGSwapBuffersInternal();
void CNFGSwapBuffers() {
  CNFGFlushRender();
  CNFGSwapBuffersInternal();
}


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

x86 assembly (clang, -O2):
<CNFGSwapBuffers>:
push   %rax
xor    %eax,%eax
call   1030 <CNFGFlushRender@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CNFGSwapBuffersInternal@plt>

LLVM IR (-O0):
define void @CNFGSwapBuffers() {
%1 = call i32 (...) @CNFGFlushRender()
%2 = call i32 (...) @CNFGSwapBuffersInternal()
ret void
}

LLVM IR (-O2):
define void @CNFGSwapBuffers() {
%1 = tail call i32 (...) @CNFGFlushRender()
%2 = tail call i32 (...) @CNFGSwapBuffersInternal()
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ reverse(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char *x = malloc(20);
  strcpy(x, "Hello world!");
  reverse(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <reverse@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 20)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @reverse(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @reverse(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void help(void) {
  printf("usage: %s\n"
         "  -h, --help           show this help\n"
         "  -c, --config <file>  config file\n"
         "  -d, --daemon         daemonize after initialization\n"
         "  --pidfile <file>     PID file, default: /run/sans.pid\n"
         "  --logfile <file>     log file, default: /var/log/sans.log\n"
         "  -v, --verbose        verbose logging\n"
         "  -V, --version        print version and exit\n\n"
         "Bug report: <%s>.\n",
         "sans", "https://github.com/XiaoxiaoPu/sans/issues");
}


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

x86 assembly (clang, -O2):
<help>:
lea    0xee9(%rip),%rdi
lea    0x1048(%rip),%rsi
lea    0x1046(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [358 x i8] c"usage: %s\0A -h, --help show this help\0A -c, --config <file> config file\0A -d, --daemon daemonize after initialization\0A --pidfile <file> PID file, default: /run/sans.pid\0A --logfile <file> log file, default: /var/log/sans.log\0A -v, --verbose verbose logging\0A -V, --version print version and exit\0A\0ABug report: <%s>.\0A\00"
@.str.1 = [5 x i8] c"sans\00"
@.str.2 = [42 x i8] c"https://github.com/XiaoxiaoPu/sans/issues\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([358 x i8], [358 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [358 x i8] c"usage: %s\0A -h, --help show this help\0A -c, --config <file> config file\0A -d, --daemon daemonize after initialization\0A --pidfile <file> PID file, default: /run/sans.pid\0A --logfile <file> log file, default: /var/log/sans.log\0A -v, --verbose verbose logging\0A -V, --version print version and exit\0A\0ABug report: <%s>.\0A\00"
@.str.1 = [5 x i8] c"sans\00"
@.str.2 = [42 x i8] c"https://github.com/XiaoxiaoPu/sans/issues\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([358 x i8], [358 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret void
}
double testfn_I_p(double x, double c2, double c3, double x0) {
  double xo = x - x0;
  return xo * xo * (c2 + xo * c3);
}


x86 assembly (clang, -O0):
<testfn_I_p>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfn_I_p>:
subsd  %xmm3,%xmm0
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @testfn_I_p(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%10 = load double, double* %5
%11 = load double, double* %8
%12 = fsub double %10, %11
store double %12, double* %9
%13 = load double, double* %9
%14 = load double, double* %9
%15 = fmul double %13, %14
%16 = load double, double* %6
%17 = load double, double* %9
%18 = load double, double* %7
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %16)
%20 = fmul double %15, %19
ret double %20
}

LLVM IR (-O2):
define double @testfn_I_p(double %0, double %1, double %2, double %3) {
%5 = fsub double %0, %3
%6 = fmul double %5, %5
%7 = tail call double @llvm.fmuladd.f64(double %5, double %2, double %1)
%8 = fmul double %6, %7
ret double %8
}
__attribute__((always_)) unsigned int endian_fix32(unsigned int x) {
  return (x << 24) + ((x << 8) & 0xff0000) + ((x >> 8) & 0xff00) + (x >> 24);
}


x86 assembly (clang, -O0):
<endian_fix32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endian_fix32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = shl i32 %5, 8
%7 = and i32 %6, 16711680
%8 = add i32 %4, %7
%9 = load i32, i32* %2
%10 = lshr i32 %9, 8
%11 = and i32 %10, 65280
%12 = add i32 %8, %11
%13 = load i32, i32* %2
%14 = lshr i32 %13, 24
%15 = add i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @endian_fix32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
__attribute__((always_)) int pm_generic_runtime_resume(struct device *dev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @pm_generic_runtime_resume(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @pm_generic_runtime_resume(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Foo(int, int, int, int);
int main() {
  Foo(12, 345, 678, 90);
  Foo(11, 22, 33, 44);
  Foo(99, 88, 77, 66);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xc,%edi
mov    $0x159,%esi
mov    $0x2a6,%edx
mov    $0x5a,%ecx
call   1030 <Foo@plt>
mov    $0xb,%edi
mov    $0x16,%esi
mov    $0x21,%edx
mov    $0x2c,%ecx
call   1030 <Foo@plt>
mov    $0x63,%edi
mov    $0x58,%esi
mov    $0x4d,%edx
mov    $0x42,%ecx
call   1030 <Foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
mov    $0x159,%esi
mov    $0x2a6,%edx
mov    $0x5a,%ecx
call   1030 <Foo@plt>
mov    $0xb,%edi
mov    $0x16,%esi
mov    $0x21,%edx
mov    $0x2c,%ecx
call   1030 <Foo@plt>
mov    $0x63,%edi
mov    $0x58,%esi
mov    $0x4d,%edx
mov    $0x42,%ecx
call   1030 <Foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @Foo(i32 12, i32 345, i32 678, i32 90)
%3 = call i32 @Foo(i32 11, i32 22, i32 33, i32 44)
%4 = call i32 @Foo(i32 99, i32 88, i32 77, i32 66)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Foo(i32 12, i32 345, i32 678, i32 90)
%2 = tail call i32 @Foo(i32 11, i32 22, i32 33, i32 44)
%3 = tail call i32 @Foo(i32 99, i32 88, i32 77, i32 66)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
void set_XConfigureRequestEvent_x(void *_p, int _v) {
  ((XConfigureRequestEvent *)_p)->x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XConfigureRequestEvent_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XConfigureRequestEvent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XConfigureRequestEvent_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XConfigureRequestEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "error: out of memory\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"error: out of memory\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"error: out of memory\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ add_sub_of_pi_e();
int /*<<< orphan*/ basic_test();
int /*<<< orphan*/ div_sqr_of_pi();
int /*<<< orphan*/ log_exp_of_pi();
int /*<<< orphan*/ my_sqrt();
int /*<<< orphan*/ qd_write_pi();
int main(void) {
  basic_test();
  add_sub_of_pi_e();
  div_sqr_of_pi();
  log_exp_of_pi();
  my_sqrt();
  qd_write_pi();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <basic_test@plt>
mov    $0x0,%al
call   1080 <add_sub_of_pi_e@plt>
mov    $0x0,%al
call   1050 <div_sqr_of_pi@plt>
mov    $0x0,%al
call   1070 <log_exp_of_pi@plt>
mov    $0x0,%al
call   1060 <my_sqrt@plt>
mov    $0x0,%al
call   1030 <qd_write_pi@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <basic_test@plt>
xor    %eax,%eax
call   1080 <add_sub_of_pi_e@plt>
xor    %eax,%eax
call   1050 <div_sqr_of_pi@plt>
xor    %eax,%eax
call   1070 <log_exp_of_pi@plt>
xor    %eax,%eax
call   1060 <my_sqrt@plt>
xor    %eax,%eax
call   1030 <qd_write_pi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @basic_test()
%2 = call i32 (...) @add_sub_of_pi_e()
%3 = call i32 (...) @div_sqr_of_pi()
%4 = call i32 (...) @log_exp_of_pi()
%5 = call i32 (...) @my_sqrt()
%6 = call i32 (...) @qd_write_pi()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic_test()
%2 = tail call i32 (...) @add_sub_of_pi_e()
%3 = tail call i32 (...) @div_sqr_of_pi()
%4 = tail call i32 (...) @log_exp_of_pi()
%5 = tail call i32 (...) @my_sqrt()
%6 = tail call i32 (...) @qd_write_pi()
ret i32 0
}
int system(char *cmd) {}


x86 assembly (clang, -O0):
<system>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @system(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ text_render_text(char *, int, int);
int text_render_char(const char character, int x, int y) {
  char *temp_str = malloc(sizeof(char) * 2);
  temp_str[0] = character;
  temp_str[1] = '\0';
  text_render_text(temp_str, x, y);
  free(temp_str);
  return 0;
}


x86 assembly (clang, -O0):
<text_render_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x2,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <text_render_text@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_render_char>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
mov    $0x2,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
mov    %bl,(%rax)
movb   $0x0,0x1(%rax)
mov    %rax,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1040 <text_render_text@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @text_render_char(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i8* @malloc(i32 2)
store i8* %8, i8** %7
%9 = load i8, i8* %4
%10 = load i8*, i8** %7
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 0, i8* %13
%14 = load i8*, i8** %7
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @text_render_text(i8* %14, i32 %15, i32 %16)
%18 = load i8*, i8** %7
%19 = call i32 @free(i8* %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @text_render_char(i8 signext %0, i32 %1, i32 %2) {
%4 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
store i8 %0, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %5
%6 = tail call i32 @text_render_text(i8* %4, i32 %1, i32 %2)
%7 = tail call i32 @free(i8* %4)
ret i32 0
}
RX0AR1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (p0[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<RX0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x43d11(%rax),%dl
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AR1>:
mov    0x43d11(%r9),%al
movslq %edx,%rcx
mov    %al,(%r8,%rcx,1)
ret

LLVM IR (-O0):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %13
%17 = getelementptr inbounds i8, i8* %16, i64 277777
%18 = load i8, i8* %17
%19 = load i8*, i8** %12
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @RX0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture %5) {
%7 = getelementptr inbounds i8, i8* %5, i64 277777
%8 = load i8, i8* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %4, i64 %9
store i8 %8, i8* %10
ret i32 undef
}
unsigned xrop3_248_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & S;
  stk1 = T | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_248_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_248_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %edi,%eax
xor    %esi,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_248_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %7
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %6
%30 = and i32 %28, %29
%31 = load i32, i32* %8
%32 = load i32, i32* %7
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = or i32 %30, %34
%36 = load i32, i32* %7
%37 = load i32, i32* %6
%38 = xor i32 %37, -1
%39 = and i32 %36, %38
%40 = load i32, i32* %5
%41 = and i32 %39, %40
%42 = or i32 %35, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @xrop3_248_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %3
%8 = and i32 %7, %4
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ i2c_init();
int /*<<< orphan*/ lsm303dlhc_init();
int /*<<< orphan*/ step();
int /*<<< orphan*/ sys_init();
int /*<<< orphan*/ sys_step();
int /*<<< orphan*/ update_acc();
int main(int argc, char **argv) {
  sys_init();
  i2c_init();
  lsm303dlhc_init();
L:
  update_acc();
  step();
  sys_step();
  goto L;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <sys_init@plt>
mov    $0x0,%al
call   1030 <i2c_init@plt>
mov    $0x0,%al
call   1080 <lsm303dlhc_init@plt>
mov    $0x0,%al
call   1050 <update_acc@plt>
mov    $0x0,%al
call   1060 <step@plt>
mov    $0x0,%al
call   1070 <sys_step@plt>
jmp    118b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sys_init@plt>
xor    %eax,%eax
call   1030 <i2c_init@plt>
xor    %eax,%eax
call   1080 <lsm303dlhc_init@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <update_acc@plt>
xor    %eax,%eax
call   1060 <step@plt>
xor    %eax,%eax
call   1070 <sys_step@plt>
jmp    1180 <main+0x20>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @sys_init()
%7 = call i32 (...) @i2c_init()
%8 = call i32 (...) @lsm303dlhc_init()
br label %9
9: ; preds = %9, %2
%10 = call i32 (...) @update_acc()
%11 = call i32 (...) @step()
%12 = call i32 (...) @sys_step()
br label %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sys_init()
%4 = tail call i32 (...) @i2c_init()
%5 = tail call i32 (...) @lsm303dlhc_init()
br label %6
6: ; preds = %6, %2
%7 = tail call i32 (...) @update_acc()
%8 = tail call i32 (...) @step()
%9 = tail call i32 (...) @sys_step()
br label %6
}
cbuf23(f, n) int f, n;
{ cbuf(f, n, 23); }


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

x86 assembly (clang, -O2):
<cbuf23>:
mov    $0x17,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf23(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 23)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf23(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 23)
ret i32 undef
}
void sdram_special_finishup(void) { return; }


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

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

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

LLVM IR (-O2):
define void @sdram_special_finishup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heapify(int *, int);
int /*<<< orphan*/ sift(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ swap(int *, int /*<<< orphan*/, int);
void heapsort(int a[], int n) {
  heapify(a, n);
  int i = n;
  while (i >= 1) {
    swap(a, 0, i);
    i--;
    sift(a, 0, i);
  }
}


x86 assembly (clang, -O0):
<heapsort>:
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   1040 <heapify@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     1185 <heapsort+0x55>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1050 <swap@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
call   1030 <sift@plt>
jmp    1151 <heapsort+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heapsort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <heapify@plt>
test   %ebx,%ebx
jle    1172 <heapsort+0x42>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <swap@plt>
lea    -0x1(%rbx),%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <sift@plt>
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1150 <heapsort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @heapsort(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 = load i32, i32* %4
%8 = call i32 @heapify(i32* %6, i32 %7)
%9 = load i32, i32* %4
store i32 %9, i32* %5
br label %10
10: ; preds = %13, %2
%11 = load i32, i32* %5
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = call i32 @swap(i32* %14, i32 0, i32 %15)
%17 = load i32, i32* %5
%18 = add nsw i32 %17, -1
store i32 %18, i32* %5
%19 = load i32*, i32** %3
%20 = load i32, i32* %5
%21 = call i32 @sift(i32* %19, i32 0, i32 %20)
br label %10
22: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @heapsort(i32* %0, i32 %1) {
%3 = tail call i32 @heapify(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 @swap(i32* %0, i32 0, i32 %6)
%8 = add nsw i32 %6, -1
%9 = tail call i32 @sift(i32* %0, i32 0, i32 %8)
%10 = icmp ugt i32 %6, 1
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}