xunge/DecIR huggingface dataset:
/* Variables and functions */
int atoi(char *);
int calc_nipib(int);
int /*<<< orphan*/ printf(char *, int, int, int);
main(int argc, char *argv[]) {
  int size = atoi(argv[1]);
  int nipib = calc_nipib(size);
  printf("%d %d %d\n", size, nipib, size * nipib);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <calc_nipib@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
imul   -0x18(%rbp),%ecx
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <calc_nipib@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @calc_nipib(i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @calc_nipib(i32 %5)
%7 = mul nsw i32 %6, %5
%8 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
float fmod(float, int);
float diff_angles_deg(float a, float b) {
  float result = fmod(b - a + 180, 360);
  if (result < 0) {
    result += 360;
  }
  return result - 180;
}


x86 assembly (clang, -O0):
<diff_angles_deg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xecc(%rip),%xmm1
addss  %xmm1,%xmm0
mov    $0x168,%edi
call   1030 <fmod@plt>
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1166 <diff_angles_deg+0x56>
movss  0xea8(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe8d(%rip),%xmm1
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_angles_deg>:
push   %rax
subss  %xmm0,%xmm1
addss  0xee3(%rip),%xmm1
movaps %xmm1,%xmm0
mov    $0x168,%edi
call   1030 <fmod@plt>
movss  0xed2(%rip),%xmm2
addss  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
addss  0xeb6(%rip),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @diff_angles_deg(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = fsub float %6, %7
%9 = fadd float %8, 1.800000e+02
%10 = call float @fmod(float %9, i32 360)
store float %10, float* %5
%11 = load float, float* %5
%12 = fcmp olt float %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load float, float* %5
%15 = fadd float %14, 3.600000e+02
store float %15, float* %5
br label %16
16: ; preds = %13, %2
%17 = load float, float* %5
%18 = fsub float %17, 1.800000e+02
ret float %18
}

LLVM IR (-O2):
define float @diff_angles_deg(float %0, float %1) {
%3 = fsub float %1, %0
%4 = fadd float %3, 1.800000e+02
%5 = tail call float @fmod(float %4, i32 360)
%6 = fcmp olt float %5, 0.000000e+00
%7 = fadd float %5, 3.600000e+02
%8 = select i1 %6, float %7, float %5
%9 = fadd float %8, -1.800000e+02
ret float %9
}
int test8(int x) { return x / -10 <= 0; }


x86 assembly (clang, -O0):
<test8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test8>:
xor    %eax,%eax
cmp    $0xfffffff7,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @test8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp sle i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test8(i32 %0) {
%2 = icmp sgt i32 %0, -10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_good4() {
  int src[3];
  int dst[3];
  memcpy(dst, src, sizeof(dst));
}


x86 assembly (clang, -O0):
<memcpy_good4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_good4>:
sub    $0x18,%rsp
mov    %rsp,%rdi
lea    0xc(%rsp),%rsi
mov    $0xc,%edx
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @memcpy_good4() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @memcpy(i32* %3, i32* %4, i32 12)
ret void
}

LLVM IR (-O2):
define void @memcpy_good4() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 12)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
void verrorf(const char *msg, va_list ap) {
  fputs("error: ", stderr);
  vfprintf(stderr, msg, ap);
  fputc('\n', stderr);
}


x86 assembly (clang, -O0):
<verrorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <vfprintf@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verrorf>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ea0(%rip),%r14
mov    (%r14),%esi
lea    0xeb6(%rip),%rdi
call   1030 <fputs@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1050 <vfprintf@plt>
mov    (%r14),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"error: \00"
@stderr = global i32 0
define void @verrorf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
%11 = load i32, i32* @stderr
%12 = call i32 @fputc(i8 signext 10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"error: \00"
@stderr = global i32 0
define void @verrorf(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @vfprintf(i32 %5, i8* %0, i32 %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputc(i8 signext 10, i32 %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glVertex3d(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void Vertex3d(GLdouble x, GLdouble y, GLdouble z) { glVertex3d(x, y, z); }


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

x86 assembly (clang, -O2):
<Vertex3d>:
jmp    1030 <glVertex3d@plt>

LLVM IR (-O0):
define void @Vertex3d(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 @glVertex3d(i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @Vertex3d(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glVertex3d(i32 %0, i32 %1, i32 %2)
ret void
}
int bis(int x, int m) { return x | m; }


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

x86 assembly (clang, -O2):
<bis>:
mov    %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bis(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
main() {
  float radius, area;
  printf("Radius? =");
  scanf("%f", &radius);
  area = 3.14159 * radius * radius;
  printf("Area=%f", area);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeae(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Radius? =\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [8 x i8] c"Area=%f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double 3.141590e+00, %6
%8 = load float, float* %1
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
store float %11, float* %2
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Radius? =\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [8 x i8] c"Area=%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 3.141590e+00
%8 = fmul double %7, %6
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %10)
ret i32 0
}
void RTTcpServerDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpServerDestroy() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ReadData(char *, int /*<<< orphan*/);
int /*<<< orphan*/ ReadUint8();
int /*<<< orphan*/ printf(char *, char, char);
void TestStackCheck(uint8_t i) {
  char szTemp[32];
  if (i > 0) {
    uint32_t readValue = ReadUint8();
    ReadData(szTemp, readValue);
    printf("%d%d\n", szTemp[30], szTemp[31]);
  }
}


x86 assembly (clang, -O0):
<TestStackCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1173 <TestStackCheck+0x43>
mov    $0x0,%al
call   1040 <ReadUint8@plt>
mov    %eax,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1050 <ReadData@plt>
mov    -0x12(%rbp),%al
lea    0xe99(%rip),%rdi
movsbl %al,%esi
movsbl -0x11(%rbp),%edx
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestStackCheck>:
test   %rdi,%rdi
jle    1164 <TestStackCheck+0x34>
sub    $0x28,%rsp
xor    %eax,%eax
call   1040 <ReadUint8@plt>
mov    %rsp,%rdi
mov    %eax,%esi
call   1050 <ReadData@plt>
movsbl 0x1e(%rsp),%esi
movsbl 0x1f(%rsp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d%d\0A\00"
define void @TestStackCheck(i64 %0) {
%2 = alloca i64
%3 = alloca [32 x i8]
%4 = alloca i32
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = call i32 (...) @ReadUint8()
store i32 %8, i32* %4
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %4
%11 = call i32 @ReadData(i8* %9, i32 %10)
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 30
%13 = load i8, i8* %12
%14 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 31
%15 = load i8, i8* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %13, i8 signext %15)
br label %17
17: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d%d\0A\00"
define void @TestStackCheck(i64 %0) {
%2 = alloca [32 x i8]
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i64 %0, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = tail call i32 (...) @ReadUint8()
%7 = call i32 @ReadData(i8* %3, i32 %6)
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 30
%9 = load i8, i8* %8
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 31
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext %9, i8 signext %11)
br label %13
13: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_sink_input_info() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_sink_input_info"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"NOT IMPLEMENTED:pa_context_get_sink_input_info\0A\00"
define i32 @pa_context_get_sink_input_info() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [47 x i8] c"NOT IMPLEMENTED:pa_context_get_sink_input_info\00"
define i32 @pa_context_get_sink_input_info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct comp {
  int dummy;
};
struct BrzFetchPush_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SEND_REQDOWN_DELAYED(int, int);
void BrzFetchPush_ackup(struct comp *comp, int port) {
  struct BrzFetchPush_ *c = (struct BrzFetchPush_ *)comp;
  SEND_REQDOWN_DELAYED(2, 1);
}


x86 assembly (clang, -O0):
<BrzFetchPush_ackup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
call   1030 <SEND_REQDOWN_DELAYED@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzFetchPush_ackup>:
mov    $0x2,%edi
mov    $0x1,%esi
jmp    1030 <SEND_REQDOWN_DELAYED@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
%struct.BrzFetchPush_ = type { i32 }
define void @BrzFetchPush_ackup(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
%5 = alloca %struct.BrzFetchPush_*
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%6 = load %struct.comp*, %struct.comp** %3
%7 = bitcast %struct.comp* %6 to %struct.BrzFetchPush_*
store %struct.BrzFetchPush_* %7, %struct.BrzFetchPush_** %5
%8 = call i32 @SEND_REQDOWN_DELAYED(i32 2, i32 1)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzFetchPush_ackup(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @SEND_REQDOWN_DELAYED(i32 2, i32 1)
ret void
}
int integers_cmp(int first, int second) { return (first - second); }


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

x86 assembly (clang, -O2):
<integers_cmp>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @integers_cmp(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void gtk_table_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_table_get_type() {
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
int is_dirent_targets_dir(struct dirent const *);
int data_is_dir_entry(const struct dirent *d) {
  return is_dirent_targets_dir(d);
}


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

x86 assembly (clang, -O2):
<data_is_dir_entry>:
jmp    1030 <is_dirent_targets_dir@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @data_is_dir_entry(%struct.dirent* %0) {
%2 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %2
%3 = load %struct.dirent*, %struct.dirent** %2
%4 = call i32 @is_dirent_targets_dir(%struct.dirent* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @data_is_dir_entry(%struct.dirent* %0) {
%2 = tail call i32 @is_dirent_targets_dir(%struct.dirent* %0)
ret i32 %2
}
/* Type definitions */
struct stack_st_X509_NAME {
  int dummy;
};

/* Variables and functions */
scalar_t__ OPENSSL_sk_new_null();
struct stack_st_X509_NAME *sk_X509_NAME_new_null(void) {
  return (struct stack_st_X509_NAME *)OPENSSL_sk_new_null();
}


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

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

LLVM IR (-O0):
%struct.stack_st_X509_NAME = type { i32 }
define %struct.stack_st_X509_NAME* @sk_X509_NAME_new_null() {
%1 = call i64 (...) @OPENSSL_sk_new_null()
%2 = inttoptr i64 %1 to %struct.stack_st_X509_NAME*
ret %struct.stack_st_X509_NAME* %2
}

LLVM IR (-O2):
%struct.stack_st_X509_NAME = type { i32 }
define %struct.stack_st_X509_NAME* @sk_X509_NAME_new_null() {
%1 = tail call i64 (...) @OPENSSL_sk_new_null()
%2 = inttoptr i64 %1 to %struct.stack_st_X509_NAME*
ret %struct.stack_st_X509_NAME* %2
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *, int);
void shm_name(char *buf, size_t max_len, pid_t pid) {
  snprintf(buf, max_len, "%s_%d", "/shared_events", pid);
}


x86 assembly (clang, -O0):
<shm_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%r8d
lea    0xeca(%rip),%rdx
lea    0xec9(%rip),%rcx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shm_name>:
mov    %edx,%r8d
lea    0xee6(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s_%d\00"
@.str.1 = [15 x i8] c"/shared_events\00"
define void @shm_name(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %7, i64 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s_%d\00"
@.str.1 = [15 x i8] c"/shared_events\00"
define void @shm_name(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int INT_MAX;
int AdditionWillOverflow(int a, int b) { return (b > 0) && (a > INT_MAX - b); }


x86 assembly (clang, -O0):
<AdditionWillOverflow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1130 <AdditionWillOverflow+0x30>
mov    -0x4(%rbp),%eax
mov    0x2ec5(%rip),%rcx
mov    (%rcx),%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdditionWillOverflow>:
test   %esi,%esi
setg   %al
mov    0x2edc(%rip),%rcx
mov    (%rcx),%ecx
sub    %esi,%ecx
cmp    %edi,%ecx
setl   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @AdditionWillOverflow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* @INT_MAX
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = icmp sgt i32 %8, %11
br label %13
13: ; preds = %7, %2
%14 = phi i1 [ false, %2 ], [ %12, %7 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @AdditionWillOverflow(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = load i32, i32* @INT_MAX
%5 = sub nsw i32 %4, %1
%6 = icmp slt i32 %5, %0
%7 = select i1 %3, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
bool leapyear(int year) {
  year -= 100;
  return ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0));
}


x86 assembly (clang, -O0):
<leapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x64,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113d <leapyear+0x3d>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1151 <leapyear+0x51>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leapyear>:
lea    -0x64(%rdi),%ecx
test   $0x3,%dil
jne    1135 <leapyear+0x35>
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0x64,%eax,%eax
neg    %eax
lea    (%rdi,%rax,1),%edx
add    $0xffffff9c,%edx
mov    $0x1,%eax
test   %edx,%edx
je     1135 <leapyear+0x35>
ret
imul   $0xc28f5c29,%ecx,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @leapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 100
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = srem i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 100
%11 = icmp ne i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8, %1
%13 = load i32, i32* %2
%14 = srem i32 %13, 400
%15 = icmp eq i32 %14, 0
br label %16
16: ; preds = %12, %8
%17 = phi i1 [ true, %8 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
%2 = add nsw i32 %0, -100
%3 = and i32 %0, 3
%4 = icmp ne i32 %3, 0
%5 = srem i32 %2, 100
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = srem i32 %2, 400
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %8
%13 = phi i32 [ %11, %8 ], [ 1, %1 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef scalar_t__ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ pthread_self();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  pthread_t id;
  time_t t;
  time(&t);
  id = pthread_self();
  printf("%X\n", (unsigned int)id);
  printf("im a virus, you are pwned\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <time@plt>
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%esi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <time@plt>
xor    %eax,%eax
call   1060 <pthread_self@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%X\0A\00"
@.str.1 = [27 x i8] c"im a virus, you are pwned\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32* %7)
%9 = call i64 (...) @pthread_self()
store i64 %9, i64* %6
%10 = load i64, i64* %6
%11 = trunc i64 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%X\0A\00"
@str = [26 x i8] c"im a virus, you are pwned\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call i64 (...) @pthread_self()
%7 = trunc i64 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ jump_HL_indirect_test();
int /*<<< orphan*/ restart_test();
int main(int argc, const char *argv[]) {
  restart_test();
  jump_HL_indirect_test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <restart_test@plt>
mov    $0x0,%al
call   1030 <jump_HL_indirect_test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @restart_test()
%6 = call i32 (...) @jump_HL_indirect_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @restart_test()
%4 = tail call i32 (...) @jump_HL_indirect_test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char *);
int /*<<< orphan*/ read_write(char *);
int /*<<< orphan*/ setup();
int main(int argc, char *argv[]) {
  if (argc < 2)
    fatal_error("Usage: %s <file_path>\n", argv[0]);
  setup();
  read_write(argv[1]);
  return 0;
}


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)
cmpl   $0x2,-0x8(%rbp)
jge    1163 <main+0x33>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <fatal_error@plt>
mov    $0x0,%al
call   1050 <setup@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <read_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1148 <main+0x18>
mov    (%rbx),%rsi
lea    0xebd(%rip),%rdi
call   1030 <fatal_error@plt>
xor    %eax,%eax
call   1050 <setup@plt>
mov    0x8(%rbx),%rdi
call   1040 <read_write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: %s <file_path>\0A\00"
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @fatal_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %8, %2
%14 = call i32 (...) @setup()
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @read_write(i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: %s <file_path>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @fatal_error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %7
7: ; preds = %4, %2
%8 = tail call i32 (...) @setup()
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @read_write(i8* %10)
ret i32 0
}
int h1(int a, int b) { return b + 7; }


x86 assembly (clang, -O0):
<h1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h1>:
lea    0x7(%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @h1(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 7
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ system_start();
int main(int argc, char *argv[]) {
  system_start();
  return 0;
}


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   1030 <system_start@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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 (...) @system_start()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @system_start()
ret i32 0
}
/* Variables and functions */
char *malloc(size_t);
char *memcpy(char *, char *, size_t);
int strlen(char *);
char *str_dup(char *arg) {
  size_t len = strlen(arg) + 1;
  char *copy = malloc(len);
  return copy ? memcpy(copy, arg, len) : NULL;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1180 <str_dup+0x50>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x20(%rbp)
jmp    118b <str_dup+0x5b>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    118b <str_dup+0x5b>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <str_dup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i8* @memcpy(i8* %14, i8* %15, i64 %16)
br label %19
18: ; preds = %1
br label %19
19: ; preds = %18, %13
%20 = phi i8* [ %17, %13 ], [ null, %18 ]
ret i8* %20
}

LLVM IR (-O2):
define noalias i8* @str_dup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %5, i8* align 1 %0, i64 %4, i1 false)
br label %8
8: ; preds = %1, %7
ret i8* %5
}
int most(int x) { return (0xFF000000 & x); }


x86 assembly (clang, -O0):
<most>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<most>:
mov    %edi,%eax
and    $0xff000000,%eax
ret

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

LLVM IR (-O2):
define i32 @most(i32 %0) {
%2 = and i32 %0, -16777216
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long glongand(long x, long y) {
  x &= y;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<glongand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <glongand+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glongand>:
push   %rbx
mov    %rdi,%rbx
and    %rsi,%rbx
jne    1120 <glongand+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @glongand(i64 %0, i64 %1) {
%3 = and i64 %1, %0
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ init_crc32_table();
int /*<<< orphan*/ print_crc32_table();
int main(void) {
  init_crc32_table();
  print_crc32_table();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init_crc32_table()
%3 = call i32 (...) @print_crc32_table()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init_crc32_table()
%2 = tail call i32 (...) @print_crc32_table()
ret i32 0
}
/* Type definitions */
typedef char *int64_t;

/* Variables and functions */
int64_t zero_sub16(int64_t in) {
  int64_t out;
  asm("sub %%ax, %%bx" : "=b"(out) : "a"(in), "0"(0));
  return out;
}


x86 assembly (clang, -O0):
<zero_sub16>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%ebx
sub    %ax,%bx
mov    %rbx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_sub16>:
push   %rbx
mov    %rdi,%rax
xor    %ebx,%ebx
sub    %ax,%bx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @zero_sub16(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "sub %ax, %bx", "={bx},{ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %4, i64 0)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @zero_sub16(i8* readnone %0) {
%2 = tail call i8* asm "sub %ax, %bx", "={bx},{ax},0,~{dirflag},~{fpsr},~{flags}"(i8* %0, i64 0)
ret i8* %2
}
/* Variables and functions */
int sleep(unsigned int);
int usleep(unsigned int usec) {
  unsigned int seconds = usec / 1000000;
  seconds += (usec % 1000000 > 0);
  return sleep(seconds);
}


x86 assembly (clang, -O0):
<usleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usleep>:
mov    %edi,%eax
imul   $0x431bde83,%rax,%rax
imul   $0x68c26139,%edi,%ecx
ror    $0x6,%ecx
shr    $0x32,%rax
cmp    $0x10c7,%ecx
sbb    $0xffffffff,%eax
mov    %eax,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define i32 @usleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000000
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = urem i32 %6, 1000000
%8 = icmp ugt i32 %7, 0
%9 = zext i1 %8 to i32
%10 = load i32, i32* %3
%11 = add i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @sleep(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @usleep(i32 %0) {
%2 = udiv i32 %0, 1000000
%3 = urem i32 %0, 1000000
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nuw nsw i32 %2, %5
%7 = tail call i32 @sleep(i32 %6)
ret i32 %7
}
void clearBit(unsigned char *c, unsigned index) { *c &= ~(1 << index); }


x86 assembly (clang, -O0):
<clearBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBit>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
not    %al
and    %al,(%rdi)
ret

LLVM IR (-O0):
define void @clearBit(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 = shl i32 1, %5
%7 = xor i32 %6, -1
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, %7
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
ret void
}

LLVM IR (-O2):
define void @clearBit(i8* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i8, i8* %0
%5 = trunc i32 %3 to i8
%6 = xor i8 %5, -1
%7 = and i8 %4, %6
store i8 %7, i8* %0
ret void
}
int gcd(int x, int y) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
ret i32 -1
}
void __VERIFIER_assert(int cond) {
  if (!(cond)) {
  ERROR:
    goto ERROR;
  }
  return;
}


x86 assembly (clang, -O0):
<__VERIFIER_assert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <__VERIFIER_assert+0x1b>
jmp    1116 <__VERIFIER_assert+0x16>
jmp    1116 <__VERIFIER_assert+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_assert>:
test   %edi,%edi
je     1110 <__VERIFIER_assert+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <__VERIFIER_assert+0x10>

LLVM IR (-O0):
define void @__VERIFIER_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
br label %6
6: ; preds = %6, %5
br label %6
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @__VERIFIER_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
double dotvv(const double *s1, const double *s2) {
  return (double)(s1[0] * s2[0] + s1[1] * s2[1] + s1[2] * s2[2]);
}


x86 assembly (clang, -O0):
<dotvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotvv>:
movsd  0x8(%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  (%rdi),%xmm1
mulsd  (%rsi),%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
addsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @dotvv(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %0, i64 1
%6 = load double, double* %5
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = fmul double %6, %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %9)
%11 = getelementptr inbounds double, double* %0, i64 2
%12 = load double, double* %11
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = tail call double @llvm.fmuladd.f64(double %12, double %14, double %10)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int __test_nulls() {
  void;
  if ((memcmp(0, 0, 0)) == (0))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<__test_nulls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1138 <__test_nulls+0x28>
movl   $0x0,-0x4(%rbp)
jmp    113f <__test_nulls+0x2f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_nulls>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__test_nulls() {
%1 = alloca i32
%2 = call i32 @memcmp(i32 0, i32 0, i32 0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @__test_nulls() {
%1 = tail call i32 @memcmp(i32 0, i32 0, i32 0)
%2 = icmp ne i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}