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

/* Variables and functions */
struct clad_test *clad_test_assert(struct clad_test *, int /*<<< orphan*/,
                                   char *, void *, char const *);
struct clad_test *clad_test_null(struct clad_test *test, void *ptr,
                                 const char *explain) {
  return clad_test_assert(test, ptr == NULL, "Pointer should be null: %p; %s",
                          ptr, explain);
}


x86 assembly (clang, -O0):
<clad_test_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xebc(%rip),%rdx
call   1030 <clad_test_assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clad_test_null>:
mov    %rdx,%r8
mov    %rsi,%rcx
xor    %esi,%esi
test   %rcx,%rcx
sete   %sil
lea    0xeda(%rip),%rdx
jmp    1030 <clad_test_assert@plt>

LLVM IR (-O0):
%struct.clad_test = type { i32 }
@.str = [31 x i8] c"Pointer should be null: %p; %s\00"
define %struct.clad_test* @clad_test_null(%struct.clad_test* %0, i8* %1, i8* %2) {
%4 = alloca %struct.clad_test*
%5 = alloca i8*
%6 = alloca i8*
store %struct.clad_test* %0, %struct.clad_test** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.clad_test*, %struct.clad_test** %4
%8 = load i8*, i8** %5
%9 = icmp eq i8* %8, null
%10 = zext i1 %9 to i32
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call %struct.clad_test* @clad_test_assert(%struct.clad_test* %7, i32 %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
ret %struct.clad_test* %13
}

LLVM IR (-O2):
%struct.clad_test = type { i32 }
@.str = [31 x i8] c"Pointer should be null: %p; %s\00"
define %struct.clad_test* @clad_test_null(%struct.clad_test* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, null
%5 = zext i1 %4 to i32
%6 = tail call %struct.clad_test* @clad_test_assert(%struct.clad_test* %0, i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret %struct.clad_test* %6
}
int IntMin(int x, int y) {
  if (x < y)
    return (x);
  else
    return (y);
}


x86 assembly (clang, -O0):
<IntMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <IntMin+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <IntMin+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntMin>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @IntMin(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 = icmp slt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @IntMin(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
signed long long signedlonglong_ignoring_unsignedlong(signed long long x,
                                                      unsigned long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlonglong_ignoring_unsignedlong>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @signedlonglong_ignoring_unsignedlong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char a[10], b[10];
  scanf("%s", a);
  scanf("%s", b);
  printf("%s%s", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0xa(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x14(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
lea    -0xa(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
lea    0xed2(%rip),%rbx
lea    0x16(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%s%s\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
ret void
}
unsigned long get_user_long(const int *addr) { return *addr; }


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

x86 assembly (clang, -O2):
<get_user_long>:
movslq (%rdi),%rax
ret

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

LLVM IR (-O2):
define i64 @get_user_long(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
float stress_funccall_float_1(float const);
float stress_funcdeep_float_5(float const, float const, float const,
                              float const, float const);
float __attribute__((no))
stress_funcdeep_float_6(const float a, const float b, const float c,
                        const float d, const float e, const float f) {
  return stress_funcdeep_float_5(f, e, d, c, b) + stress_funccall_float_1(a);
}


x86 assembly (clang, -O0):
<stress_funcdeep_float_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
movss  -0xc(%rbp),%xmm3
movss  -0x8(%rbp),%xmm4
call   1030 <stress_funcdeep_float_5@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <stress_funccall_float_1@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcdeep_float_6>:
push   %rax
movaps %xmm2,%xmm6
movaps %xmm1,%xmm7
movss  %xmm0,0x4(%rsp)
movaps %xmm5,%xmm0
movaps %xmm4,%xmm1
movaps %xmm3,%xmm2
movaps %xmm6,%xmm3
movaps %xmm7,%xmm4
call   1030 <stress_funcdeep_float_5@plt>
movss  %xmm0,(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <stress_funccall_float_1@plt>
addss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @stress_funcdeep_float_6(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %12
%14 = load float, float* %11
%15 = load float, float* %10
%16 = load float, float* %9
%17 = load float, float* %8
%18 = call float @stress_funcdeep_float_5(float %13, float %14, float %15, float %16, float %17)
%19 = load float, float* %7
%20 = call float @stress_funccall_float_1(float %19)
%21 = fadd float %18, %20
ret float %21
}

LLVM IR (-O2):
define float @stress_funcdeep_float_6(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call float @stress_funcdeep_float_5(float %5, float %4, float %3, float %2, float %1)
%8 = tail call float @stress_funccall_float_1(float %0)
%9 = fadd float %7, %8
ret float %9
}
int compare(const void *a, const void *b) {
  return *((int *)a) > *((int *)b) ? 1 : -1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @compare(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 i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 -1
ret i32 %13
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = select i1 %7, i32 1, i32 -1
ret i32 %8
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
int main(void) {
  char ch;
  ch = getchar();
  while (ch != '\n') {
    putchar(ch);
    ch = getchar();
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     116e <main+0x3e>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
jmp    1149 <main+0x19>
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1145 <main+0x25>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = icmp eq i8 %1, 10
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @putchar(i8 signext %4)
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %3
8: ; preds = %3, %0
%9 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret i32 0
}
/* Variables and functions */
int PAPI_unregister_thread();
void papif_unregster_thread_(int *check) { *check = PAPI_unregister_thread(); }


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

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

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

LLVM IR (-O2):
define void @papif_unregster_thread_(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_unregister_thread()
store i32 %2, i32* %0
ret void
}
/* Variables and functions */
int hash_unsigned_pair(unsigned int, int);
unsigned bdd_ite_hash(unsigned p, unsigned t, unsigned f) {
  return hash_unsigned_pair(p, hash_unsigned_pair(t, f));
}


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

x86 assembly (clang, -O2):
<bdd_ite_hash>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <hash_unsigned_pair@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <hash_unsigned_pair@plt>

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

LLVM IR (-O2):
define i32 @bdd_ite_hash(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @hash_unsigned_pair(i32 %1, i32 %2)
%5 = tail call i32 @hash_unsigned_pair(i32 %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ MCUSendCmdShockDetectionSensitivity(int);
void MCUSendCmdShockDetectionSensitivityL() {
  MCUSendCmdShockDetectionSensitivity(0x00);
}


x86 assembly (clang, -O0):
<MCUSendCmdShockDetectionSensitivityL>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <MCUSendCmdShockDetectionSensitivity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCUSendCmdShockDetectionSensitivityL>:
xor    %edi,%edi
jmp    1030 <MCUSendCmdShockDetectionSensitivity@plt>

LLVM IR (-O0):
define void @MCUSendCmdShockDetectionSensitivityL() {
%1 = call i32 @MCUSendCmdShockDetectionSensitivity(i32 0)
ret void
}

LLVM IR (-O2):
define void @MCUSendCmdShockDetectionSensitivityL() {
%1 = tail call i32 @MCUSendCmdShockDetectionSensitivity(i32 0)
ret void
}
void StereoProj(u, v, x, y, z) double *u, *v, x, y, z;
{
  *u = x / (1 + z);
  *v = y / (1 + z);
}


x86 assembly (clang, -O0):
<StereoProj>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed8(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
addsd  -0x28(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<StereoProj>:
addsd  0xef8(%rip),%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,(%rdi)
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @StereoProj(double* %0, double* %1, double %2, double %3, double %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %6
store double* %1, double** %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %8
%12 = load double, double* %10
%13 = fadd double 1.000000e+00, %12
%14 = fdiv double %11, %13
%15 = load double*, double** %6
store double %14, double* %15
%16 = load double, double* %9
%17 = load double, double* %10
%18 = fadd double 1.000000e+00, %17
%19 = fdiv double %16, %18
%20 = load double*, double** %7
store double %19, double* %20
ret void
}

LLVM IR (-O2):
define void @StereoProj(double* nocapture writeonly %0, double* nocapture writeonly %1, double %2, double %3, double %4) {
%6 = fadd double %4, 1.000000e+00
%7 = fdiv double %2, %6
store double %7, double* %0
%8 = fdiv double %3, %6
store double %8, double* %1
ret void
}
/* Type definitions */
struct sigaction {
  int /*<<< orphan*/ sa_handler;
  int /*<<< orphan*/ sa_flags;
};
typedef int /*<<< orphan*/ sig;

/* Variables and functions */
int /*<<< orphan*/ SA_RESTART;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigs_set(struct sigaction *);
void sigs_restore(void) {
  struct sigaction sig;
  memset(&sig, 0, sizeof(sig));
  sig.sa_flags = SA_RESTART;
  sig.sa_handler = SIG_DFL;
  sigs_set(&sig);
}


x86 assembly (clang, -O0):
<sigs_restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <sigs_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigs_restore>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <sigs_set@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sigaction = type { i32, i32 }
@SA_RESTART = global i32 0
@SIG_DFL = global i32 0
define void @sigs_restore() {
%1 = alloca %struct.sigaction
%2 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 8)
%3 = load i32, i32* @SA_RESTART
%4 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 1
store i32 %3, i32* %4
%5 = load i32, i32* @SIG_DFL
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i32 0, i32 0
store i32 %5, i32* %6
%7 = call i32 @sigs_set(%struct.sigaction* %1)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { i32, i32 }
@SA_RESTART = global i32 0
@SIG_DFL = global i32 0
define void @sigs_restore() {
%1 = alloca %struct.sigaction
%2 = bitcast %struct.sigaction* %1 to i8*
%3 = call i32 @memset(%struct.sigaction* %1, i32 0, i32 8)
%4 = load i32, i32* @SA_RESTART
%5 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 1
store i32 %4, i32* %5
%6 = load i32, i32* @SIG_DFL
%7 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %1, i64 0, i32 0
store i32 %6, i32* %7
%8 = call i32 @sigs_set(%struct.sigaction* %1)
ret void
}
/* Variables and functions */
int rand();
int nested_nores(void) {
  int err = 0;
  int foo = rand();
  if (foo == 0) {
    err = 1;
  } else {
    int bar = rand();
    if (bar == 0) {
      err = 2;
    } else {
      int baz = rand();
      if (baz == 0) {
        err = 3;
      }
    }
  }
  return err;
}


x86 assembly (clang, -O0):
<nested_nores>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113f <nested_nores+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1184 <nested_nores+0x74>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115f <nested_nores+0x4f>
movl   $0x2,-0x4(%rbp)
jmp    117f <nested_nores+0x6f>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    117a <nested_nores+0x6a>
movl   $0x3,-0x4(%rbp)
jmp    117f <nested_nores+0x6f>
jmp    1184 <nested_nores+0x74>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nested_nores>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
je     113a <nested_nores+0x2a>
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
je     1141 <nested_nores+0x31>
xor    %eax,%eax
call   1030 <rand@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,2),%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @nested_nores() {
%1 = tail call i32 (...) @rand()
%2 = icmp eq i32 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i32 (...) @rand()
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 (...) @rand()
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 3, i32 0
br label %10
10: ; preds = %6, %3, %0
%11 = phi i32 [ 1, %0 ], [ %9, %6 ], [ 2, %3 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int,
                           char *);
char *pS(char *);
void genPostfix(FILE *out, char *op, int left, int prior, char *cmt) {
  fprintf(out, "  pstOp(\'%s\',%d,%d).\t\t-- %s\n", pS(op), left, prior, cmt);
}


x86 assembly (clang, -O0):
<genPostfix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <pS@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rdx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x20(%rbp),%r9
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genPostfix>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1040 <pS@plt>
lea    0xebf(%rip),%rsi
mov    %rbp,%rdi
mov    %rax,%rdx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c" pstOp('%s',%d,%d).\09\09-- %s\0A\00"
define void @genPostfix(i32* %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32*, i32** %6
%12 = load i8*, i8** %7
%13 = call i8* @pS(i8* %12)
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i8*, i8** %10
%17 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c" pstOp('%s',%d,%d).\09\09-- %s\0A\00"
define void @genPostfix(i32* nocapture %0, i8* %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i8* @pS(i8* %1)
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %2, i32 %3, i8* %4)
ret void
}
/* Variables and functions */
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int main() {
  int var;
  int mypid = getpid();
  printf("Before My pid is %d\n", mypid);
  sleep(1);
  int nowp = fork();
  nowp = 1;
  printf("After: my pid is %d, fork() said %d\n", getpid(), nowp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    $0x0,%al
call   1060 <fork@plt>
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
call   1060 <fork@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Before My pid is %d\0A\00"
@.str.1 = [37 x i8] c"After: my pid is %d, fork() said %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @getpid()
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @sleep(i32 1)
%9 = call i32 (...) @fork()
store i32 %9, i32* %4
store i32 1, i32* %4
%10 = call i32 (...) @getpid()
%11 = load i32, i32* %4
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Before My pid is %d\0A\00"
@.str.1 = [37 x i8] c"After: my pid is %d, fork() said %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 (...) @fork()
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 1)
ret i32 0
}
int addDigits(int num) { return num - (num - 1) / 9 * 9; }


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x9,%ecx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
add    $0xffffffff,%edi
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = srem i32 %2, 9
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void freeMat(double *mat) { free(mat); }


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

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

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

LLVM IR (-O2):
define void @freeMat(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int /*<<< orphan*/ invoke_sprintf(char *, int);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
void test_sprintf() {
  assertTrue("strcmp(invoke_sprintf(\"Bob\", 99), \"Hello Bob, you have 99 "
             "messages\") == 0",
             strcmp(invoke_sprintf("Bob", 99),
                    "Hello Bob, you have 99 messages") == 0);
  ;
}


x86 assembly (clang, -O0):
<test_sprintf>:
push   %rbp
mov    %rsp,%rbp
lea    0xf0f(%rip),%rdi
mov    $0x63,%esi
call   1050 <invoke_sprintf@plt>
mov    %eax,%edi
lea    0xf00(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9a(%rip),%rdi
call   1030 <assertTrue@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sprintf>:
push   %rax
lea    0xf12(%rip),%rdi
mov    $0x63,%esi
call   1050 <invoke_sprintf@plt>
lea    0xf05(%rip),%rsi
mov    %eax,%edi
call   1040 <strcmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xea0(%rip),%rdi
pop    %rax
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [74 x i8] c"strcmp(invoke_sprintf(\22Bob\22, 99), \22Hello Bob, you have 99 messages\22) == 0\00"
@.str.1 = [4 x i8] c"Bob\00"
@.str.2 = [32 x i8] c"Hello Bob, you have 99 messages\00"
define void @test_sprintf() {
%1 = call i32 @invoke_sprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 99)
%2 = call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assertTrue(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [74 x i8] c"strcmp(invoke_sprintf(\22Bob\22, 99), \22Hello Bob, you have 99 messages\22) == 0\00"
@.str.1 = [4 x i8] c"Bob\00"
@.str.2 = [32 x i8] c"Hello Bob, you have 99 messages\00"
define void @test_sprintf() {
%1 = tail call i32 @invoke_sprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 99)
%2 = tail call i64 @strcmp(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assertTrue(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
void set_curr_task_fair(struct rq *rq) {}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
define void @set_curr_task_fair(%struct.rq* nocapture %0) {
ret void
}
void permut_cell_list(struct cell_t ***t1, struct cell_t ***t2) {
  struct cell_t **tmp;
  tmp = *t1;
  *t1 = *t2;
  *t2 = tmp;
}


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

x86 assembly (clang, -O2):
<permut_cell_list>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
%struct.cell_t = type opaque
define void @permut_cell_list(%struct.cell_t*** %0, %struct.cell_t*** %1) {
%3 = alloca %struct.cell_t***
%4 = alloca %struct.cell_t***
%5 = alloca %struct.cell_t**
store %struct.cell_t*** %0, %struct.cell_t**** %3
store %struct.cell_t*** %1, %struct.cell_t**** %4
%6 = load %struct.cell_t***, %struct.cell_t**** %3
%7 = load %struct.cell_t**, %struct.cell_t*** %6
store %struct.cell_t** %7, %struct.cell_t*** %5
%8 = load %struct.cell_t***, %struct.cell_t**** %4
%9 = load %struct.cell_t**, %struct.cell_t*** %8
%10 = load %struct.cell_t***, %struct.cell_t**** %3
store %struct.cell_t** %9, %struct.cell_t*** %10
%11 = load %struct.cell_t**, %struct.cell_t*** %5
%12 = load %struct.cell_t***, %struct.cell_t**** %4
store %struct.cell_t** %11, %struct.cell_t*** %12
ret void
}

LLVM IR (-O2):
%struct.cell_t = type opaque
define void @permut_cell_list(%struct.cell_t*** nocapture %0, %struct.cell_t*** nocapture %1) {
%3 = load %struct.cell_t**, %struct.cell_t*** %0
%4 = load %struct.cell_t**, %struct.cell_t*** %1
store %struct.cell_t** %4, %struct.cell_t*** %0
store %struct.cell_t** %3, %struct.cell_t*** %1
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int IsADir(const char *name) {
  struct stat info;
  return ((stat(name, &info) == 0) && (S_ISDIR(info.st_mode))) ? 1 : 0;
}


x86 assembly (clang, -O0):
<IsADir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <IsADir+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsADir>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <IsADir+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @IsADir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @IsADir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ skip_quoted(char const **);
int /*<<< orphan*/ skip_word(char const **);
void skip_quoted_ifquoted(const char **pp, char qchar) {
  const char *p = *pp;
  if (*p == qchar)
    skip_quoted(pp);
  else
    skip_word(pp);
}


x86 assembly (clang, -O0):
<skip_quoted_ifquoted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    115e <skip_quoted_ifquoted+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <skip_quoted@plt>
jmp    1167 <skip_quoted_ifquoted+0x47>
mov    -0x8(%rbp),%rdi
call   1040 <skip_word@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_quoted_ifquoted>:
mov    (%rdi),%rax
cmp    %sil,(%rax)
jne    112d <skip_quoted_ifquoted+0xd>
jmp    1030 <skip_quoted@plt>
jmp    1040 <skip_word@plt>

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

LLVM IR (-O2):
define void @skip_quoted_ifquoted(i8** %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @skip_quoted(i8** %0)
br label %10
8: ; preds = %2
%9 = tail call i32 @skip_word(i8** %0)
br label %10
10: ; preds = %8, %6
ret void
}
int is_valid_input(int input) {
  if ((input >= -9999) && (input <= 9999)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_valid_input>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xffffd8f1,-0x8(%rbp)
jl     112d <is_valid_input+0x2d>
cmpl   $0x270f,-0x8(%rbp)
jg     112d <is_valid_input+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <is_valid_input+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_input>:
add    $0x270f,%edi
xor    %eax,%eax
cmp    $0x4e1f,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_valid_input(i32 %0) {
%2 = add i32 %0, 9999
%3 = icmp ult i32 %2, 19999
%4 = zext i1 %3 to i32
ret i32 %4
}
long int computeHash(char *name) {
  int hash = 7;
  while (*name)
    hash += 17 * *name++;
  return hash;
}


x86 assembly (clang, -O0):
<computeHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <computeHash+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
imul   $0x11,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <computeHash+0xf>
movslq -0xc(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<computeHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <computeHash+0x2a>
add    $0x1,%rdi
mov    $0x7,%eax
nop
movsbl %cl,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%edx
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <computeHash+0x10>
cltq
ret
mov    $0x7,%eax
ret

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

LLVM IR (-O2):
define i64 @computeHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 7, %1 ]
%7 = phi i8* [ %8, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %5 to i32
%10 = mul nsw i32 %9, 17
%11 = add nsw i32 %10, %6
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = sext i32 %11 to i64
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 7, %1 ], [ %15, %14 ]
ret i64 %17
}
/* Variables and functions */
scalar_t__ INT_MAX;
int main(void) { INT_MAX + 1; }


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

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

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @main() {
%1 = load i64, i64* @INT_MAX
%2 = add nsw i64 %1, 1
ret i32 0
}

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

/* Variables and functions */
int sem_post(sem_t *sem) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sem_post(i32* nocapture readnone %0) {
ret i32 1
}
void UARTDivisorLatchDisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0xC)))) &= ~((0x00000080u));
}


x86 assembly (clang, -O0):
<UARTDivisorLatchDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDivisorLatchDisable>:
add    $0xc,%edi
andl   $0xffffff7f,(%rdi)
ret

LLVM IR (-O0):
define void @UARTDivisorLatchDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 12
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -129
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @UARTDivisorLatchDisable(i32 %0) {
%2 = add i32 %0, 12
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -129
store volatile i32 %6, i32* %4
ret void
}
void SWI_Handler(void) {}


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

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

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

LLVM IR (-O2):
define void @SWI_Handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cleaner(int i, void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cleaner(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pendfunc1(int x) {
  int y = x + 4;
  printf("in pendfunc1, x is %d\n", x);
}


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

x86 assembly (clang, -O2):
<pendfunc1>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"in pendfunc1, x is %d\0A\00"
define void @pendfunc1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wdctl_command(int);
void wdctl_add_trusted_pan_domains(void) { wdctl_command(28); }


x86 assembly (clang, -O0):
<wdctl_add_trusted_pan_domains>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1c,%edi
call   1030 <wdctl_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wdctl_add_trusted_pan_domains>:
mov    $0x1c,%edi
jmp    1030 <wdctl_command@plt>

LLVM IR (-O0):
define void @wdctl_add_trusted_pan_domains() {
%1 = call i32 @wdctl_command(i32 28)
ret void
}

LLVM IR (-O2):
define void @wdctl_add_trusted_pan_domains() {
%1 = tail call i32 @wdctl_command(i32 28)
ret void
}
/* Variables and functions */
float remquof(float, float, int *);
float remainderf(float x, float y) {
  int q;
  return remquof(x, y, &q);
}


x86 assembly (clang, -O0):
<remainderf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    -0xc(%rbp),%rdi
call   1030 <remquof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainderf>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <remquof@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @remainderf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @remquof(float %6, float %7, i32* %5)
ret float %8
}

LLVM IR (-O2):
define float @remainderf(float %0, float %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call float @remquof(float %0, float %1, i32* %3)
ret float %5
}
/* Variables and functions */
int syscall(int, char *, char **);
int mount(char *dev, char **mpt) { return syscall(45, dev, mpt); }


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

x86 assembly (clang, -O2):
<mount>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2d,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @mount(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 = load i8**, i8*** %4
%7 = call i32 @syscall(i32 45, i8* %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mount(i8* %0, i8** %1) {
%3 = tail call i32 @syscall(i32 45, i8* %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ wait(int *);
void fastcgi_cleanup() {
  int status = 0;
  wait(&status);
}


x86 assembly (clang, -O0):
<fastcgi_cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <wait@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastcgi_cleanup>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <wait@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @fastcgi_cleanup() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @wait(i32* %1)
ret void
}