xunge/DecIR huggingface dataset:
/* Variables and functions */
int geteuid();
int /*<<< orphan*/ printf(char *, int);
void main() { printf("geteuid is %d \n", geteuid()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"geteuid is %d \0A\00"
define void @main() {
%1 = call i32 (...) @geteuid()
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"geteuid is %d \0A\00"
define void @main() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *strRSeparator(char const *const);
extern const char *baseFilename(const char *const filePath) {
  const char *tail = strRSeparator(filePath);
  if (tail == NULL)
    tail = filePath;
  else
    ++tail;
  return tail;
}


x86 assembly (clang, -O0):
<baseFilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strRSeparator@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <baseFilename+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114d <baseFilename+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baseFilename>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strRSeparator@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @baseFilename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strRSeparator(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
store i8* %9, i8** %3
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %10, %8
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @baseFilename(i8* %0) {
%2 = tail call i8* @strRSeparator(i8* %0)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
long int functions(int a) {
  if (a > 1) {
    a *= functions(a - 1);
  }
  return a;
}


x86 assembly (clang, -O0):
<functions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    113e <functions+0x2e>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <functions@plt>
mov    %rax,%rcx
movslq -0x4(%rbp),%rax
imul   %rcx,%rax
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functions>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1125 <functions+0x15>
lea    -0x1(%rbx),%edi
call   1030 <functions@plt>
imul   %ebx,%eax
mov    %eax,%ebx
movslq %ebx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @functions(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i64 @functions(i32 %7)
%9 = load i32, i32* %2
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %10, %8
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %5, %1
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
ret i64 %15
}

LLVM IR (-O2):
define i64 @functions(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i64 @functions(i32 %4)
%6 = trunc i64 %5 to i32
%7 = mul i32 %6, %0
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ %7, %3 ], [ %0, %1 ]
%10 = sext i32 %9 to i64
ret i64 %10
}
void init_procv6() {}


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

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

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

LLVM IR (-O2):
define void @init_procv6() {
ret void
}
/* Variables and functions */
unsigned int vcmpges4(unsigned int, unsigned int);
unsigned int vmins4(unsigned int a, unsigned int b) {
  unsigned int r, s;
  s = vcmpges4(b, a);
  r = a & s;
  s = b & ~s;
  r = r | s;
  return r;
}


x86 assembly (clang, -O0):
<vmins4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1030 <vcmpges4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmins4>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    %ebp,%esi
call   1030 <vcmpges4@plt>
xor    %ebx,%ebp
and    %ebp,%eax
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vmins4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @vcmpges4(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %6
%12 = and i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = xor i32 %14, -1
%16 = and i32 %13, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = or i32 %17, %18
store i32 %19, i32* %5
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @vmins4(i32 %0, i32 %1) {
%3 = tail call i32 @vcmpges4(i32 %1, i32 %0)
%4 = and i32 %3, %0
%5 = xor i32 %3, -1
%6 = and i32 %5, %1
%7 = or i32 %4, %6
ret i32 %7
}
/* Type definitions */
struct fext {
  int dummy;
};

/* Variables and functions */
struct fext *findExtensionInMap(char const *, int);
int strlen(char const *);
struct fext *findExtensionType(const char *str) {
  int len = strlen(str);
  return findExtensionInMap(str, len);
}


x86 assembly (clang, -O0):
<findExtensionType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <findExtensionInMap@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.fext = type { i32 }
define %struct.fext* @findExtensionType(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call %struct.fext* @findExtensionInMap(i8* %6, i32 %7)
ret %struct.fext* %8
}

LLVM IR (-O2):
%struct.fext = type { i32 }
define %struct.fext* @findExtensionType(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call %struct.fext* @findExtensionInMap(i8* %0, i32 %2)
ret %struct.fext* %3
}
void close_stdout(struct emitter *emitter) {}


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

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

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

LLVM IR (-O2):
%struct.emitter = type opaque
define void @close_stdout(%struct.emitter* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
scalar_t__ mpz_millerrabin(int /*<<< orphan*/, int);
bool isPrime(mpz_t n) { return mpz_millerrabin(n, 100) ? true : false; }


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x64,%esi
call   1030 <mpz_millerrabin@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rax
mov    $0x64,%esi
call   1030 <mpz_millerrabin@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @mpz_millerrabin(i32 %3, i32 100)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i64 @mpz_millerrabin(i32 %0, i32 100)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank2(int);
void vrc7setParamsB000(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank2(val << 10);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank2@plt>

LLVM IR (-O0):
define void @vrc7setParamsB000(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @vrc7setParamsB000(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank2(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
main() {
  int a, i;
  float e;
  i = 0;
  a = 0;
  while (i < 100) {
    i++;
    while (a < i) {
      a++;
      a *= a;
    }
    e + 1.0 / a;
  }
  printf("%.11f\n", e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1169 <main+0x59>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <main+0x54>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <main+0x30>
jmp    112d <main+0x1d>
movss  -0x10(%rbp),%xmm0
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%.11f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
br label %5
5: ; preds = %21, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %28
8: ; preds = %5
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %11
11: ; preds = %15, %8
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
%18 = load i32, i32* %2
%19 = load i32, i32* %2
%20 = mul nsw i32 %19, %18
store i32 %20, i32* %2
br label %11
21: ; preds = %11
%22 = load float, float* %4
%23 = fpext float %22 to double
%24 = load i32, i32* %2
%25 = sitofp i32 %24 to double
%26 = fdiv double 1.000000e+00, %25
%27 = fadd double %23, %26
br label %5
28: ; preds = %5
%29 = load float, float* %4
%30 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.11f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float undef)
ret i32 0
}
/* Variables and functions */
int m_atoi(char *);
int chrcnv(char *cp) { return *cp != '\\' ? *cp : m_atoi(++cp); }


x86 assembly (clang, -O0):
<chrcnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
je     113b <chrcnv+0x2b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    114f <chrcnv+0x3f>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <m_atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chrcnv>:
movsbl (%rdi),%eax
cmp    $0x5c,%eax
jne    1121 <chrcnv+0x11>
add    $0x1,%rdi
jmp    1030 <m_atoi@plt>
ret

LLVM IR (-O0):
define i32 @chrcnv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 92
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
br label %15
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
%14 = call i32 @m_atoi(i8* %13)
br label %15
15: ; preds = %11, %7
%16 = phi i32 [ %10, %7 ], [ %14, %11 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @chrcnv(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 92
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = sext i8 %2 to i32
br label %9
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i32 @m_atoi(i8* %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ %5, %4 ], [ %8, %6 ]
ret i32 %10
}
/* Variables and functions */
char *getcwd(char *, int);
char *ILibFileDir_GetWorkingDir(char *path, size_t sizeOfBuf) {
  return getcwd(path, (int)sizeOfBuf);
}


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

x86 assembly (clang, -O2):
<ILibFileDir_GetWorkingDir>:
jmp    1030 <getcwd@plt>

LLVM IR (-O0):
define i8* @ILibFileDir_GetWorkingDir(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = call i8* @getcwd(i8* %5, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @ILibFileDir_GetWorkingDir(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i8* @getcwd(i8* %0, i32 %3)
ret i8* %4
}
int iabs(int num) {
  if (num < 0)
    return (-num);
  else
    return (num);
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <iabs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <iabs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int strcmp(void const *, void const *);
int ptrcmp(const void *a, const void *b) { return (strcmp(a, b)); }


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

x86 assembly (clang, -O2):
<ptrcmp>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @ptrcmp(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 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ptrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
struct h2get_h2_header {
  int dummy;
};
struct h2get_ctx {
  int dummy;
};
struct h2get_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ h2get_buf_printf(struct h2get_buf *, char *, char *);
void h2get_frame_render_ping(struct h2get_ctx *ctx, struct h2get_buf *out,
                             struct h2get_h2_header *h, char *p, size_t plen) {
  h2get_buf_printf(out, "\n%s",
                   "h2get_frame_"
                   "ping"
                   "_render");
}


x86 assembly (clang, -O0):
<h2get_frame_render_ping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xec6(%rip),%rdx
call   1030 <h2get_buf_printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2get_frame_render_ping>:
mov    %rsi,%rdi
lea    0xee6(%rip),%rsi
lea    0xee3(%rip),%rdx
jmp    1030 <h2get_buf_printf@plt>

LLVM IR (-O0):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [24 x i8] c"h2get_frame_ping_render\00"
define void @h2get_frame_render_ping(%struct.h2get_ctx* %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* %2, i8* %3, i64 %4) {
%6 = alloca %struct.h2get_ctx*
%7 = alloca %struct.h2get_buf*
%8 = alloca %struct.h2get_h2_header*
%9 = alloca i8*
%10 = alloca i64
store %struct.h2get_ctx* %0, %struct.h2get_ctx** %6
store %struct.h2get_buf* %1, %struct.h2get_buf** %7
store %struct.h2get_h2_header* %2, %struct.h2get_h2_header** %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load %struct.h2get_buf*, %struct.h2get_buf** %7
%12 = call i32 @h2get_buf_printf(%struct.h2get_buf* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.h2get_ctx = type { i32 }
%struct.h2get_buf = type { i32 }
%struct.h2get_h2_header = type { i32 }
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [24 x i8] c"h2get_frame_ping_render\00"
define void @h2get_frame_render_ping(%struct.h2get_ctx* nocapture readnone %0, %struct.h2get_buf* %1, %struct.h2get_h2_header* nocapture readnone %2, i8* nocapture readnone %3, i64 %4) {
%6 = tail call i32 @h2get_buf_printf(%struct.h2get_buf* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ safe_exit(int);
int /*<<< orphan*/ stderr;
void *safe_release_calloc(size_t num, size_t size) {
  void *ptr = calloc(num, size);
  if (!ptr) {
    fprintf(stderr, "Could not zero allocate memory! Out of memory?");
    safe_exit(2);
    return NULL;
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safe_release_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1188 <safe_release_calloc+0x58>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <safe_exit@plt>
movq   $0x0,-0x8(%rbp)
jmp    1190 <safe_release_calloc+0x60>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_release_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115d <safe_release_calloc+0x2d>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <safe_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Could not zero allocate memory! Out of memory?\00"
define i8* @safe_release_calloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = call i8* @calloc(i64 %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @safe_exit(i32 2)
store i8* null, i8** %3
br label %18
16: ; preds = %2
%17 = load i8*, i8** %6
store i8* %17, i8** %3
br label %18
18: ; preds = %16, %12
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Could not zero allocate memory! Out of memory?\00"
define noalias i8* @safe_release_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @safe_exit(i32 2)
br label %9
9: ; preds = %2, %5
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
int main(void) {
  print_hex(strcmp("test", "test"));
  print_hex(strcmp("a", "b"));
  print_hex(strcmp("test2", "test1"));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
mov    %rsi,%rdi
call   1030 <strcmp@plt>
mov    %eax,%edi
call   1040 <print_hex@plt>
lea    0xec4(%rip),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%edi
call   1040 <print_hex@plt>
lea    0xeae(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,%edi
call   1040 <print_hex@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <print_hex@plt>
mov    $0xffffffff,%edi
call   1030 <print_hex@plt>
mov    $0x1,%edi
call   1030 <print_hex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [2 x i8] c"b\00"
@.str.3 = [6 x i8] c"test2\00"
@.str.4 = [6 x i8] c"test1\00"
define i32 @main() {
%1 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_hex(i32 %1)
%3 = call i32 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @print_hex(i32 %3)
%5 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 @print_hex(i32 %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_hex(i32 0)
%2 = tail call i32 @print_hex(i32 -1)
%3 = tail call i32 @print_hex(i32 1)
ret i32 0
}
/* Variables and functions */
int FILENAME_MAX;
int /*<<< orphan*/ dosystem(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void runit(char *prog, char *param) {
  char buf[FILENAME_MAX];
  strcpy(buf, prog);
  strcat(buf, " ");
  strcat(buf, param);
  dosystem(buf);
}


x86 assembly (clang, -O0):
<runit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x28(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x28(%rbp),%rdi
call   1050 <dosystem@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runit>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rsi
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
mov    %rbx,%rdi
call   1050 <dosystem@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@FILENAME_MAX = global i32 0
@.str = [2 x i8] c" \00"
define void @runit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @FILENAME_MAX
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca i8, i64 %8
store i64 %8, i64* %6
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %10, i8* %14)
%16 = call i32 @dosystem(i8* %10)
%17 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
@FILENAME_MAX = global i32 0
@.str = [2 x i8] c" \00"
define void @runit(i8* %0, i8* %1) {
%3 = load i32, i32* @FILENAME_MAX
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @strcpy(i8* %5, i8* %0)
%7 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @strcat(i8* %5, i8* %1)
%9 = call i32 @dosystem(i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __dsb(int /*<<< orphan*/);
void check__dsb(void) { __dsb(0); }


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

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

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

LLVM IR (-O2):
define void @check__dsb() {
%1 = tail call i32 @__dsb(i32 0)
ret void
}
void event_gchord(chord) char *chord;
{}


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

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

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

LLVM IR (-O2):
define void @event_gchord(i8* nocapture %0) {
ret void
}
int f2(int *x, int *y) {
  *x = 3;
  *y = 6;
  return 3;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x6,(%rax)
mov    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movl   $0x3,(%rdi)
movl   $0x6,(%rsi)
mov    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @f2(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
store i32 3, i32* %5
%6 = load i32*, i32** %4
store i32 6, i32* %6
ret i32 3
}

LLVM IR (-O2):
define i32 @f2(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 3, i32* %0
store i32 6, i32* %1
ret i32 3
}
int test_arylen(char *ary[]) {
  int i;
  for (i = 0; ary[i]; i++) {
  };
  return i;
}


x86 assembly (clang, -O0):
<test_arylen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <test_arylen+0x35>
jmp    1127 <test_arylen+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <test_arylen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_arylen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <test_arylen+0x10>
ret

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

LLVM IR (-O2):
define i32 @test_arylen(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_INT1_PIN() { set_io_bit(0x43, 1); }


x86 assembly (clang, -O0):
<TOSH_SET_INT1_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43,%edi
mov    $0x1,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_INT1_PIN>:
mov    $0x43,%edi
mov    $0x1,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_INT1_PIN() {
%1 = call i32 @set_io_bit(i32 67, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_INT1_PIN() {
%1 = tail call i32 @set_io_bit(i32 67, i32 1)
ret void
}
int main(void) {
  struct bar {
    int a;
    int b : 9;
  };
  struct bar a;
  a.b = 0;
  a.a = 4;
  return a.a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0xc(%rbp),%ax
and    $0xfe00,%ax
or     $0x0,%ax
mov    %ax,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bar = type { i32, i16 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.bar
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.bar, %struct.bar* %2, i32 0, i32 1
%4 = load i16, i16* %3
%5 = and i16 %4, -512
%6 = or i16 %5, 0
store i16 %6, i16* %3
%7 = getelementptr inbounds %struct.bar, %struct.bar* %2, i32 0, i32 0
store i32 4, i32* %7
%8 = getelementptr inbounds %struct.bar, %struct.bar* %2, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRD3_set(void) { return U_WMRCORENONE_set("U_WMRD3"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRD3\00"
define i8* @U_WMRD3_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRD3\00"
define i8* @U_WMRD3_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void hal_radio_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @hal_radio_reset() {
ret void
}
short is_prime(unsigned int num) {
  unsigned int i;
  if (num == 1)
    return 0;
  for (i = 2; i < num; i++)
    if (num % i == 0)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111c <is_prime+0x1c>
movw   $0x0,-0x2(%rbp)
jmp    1164 <is_prime+0x64>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    115e <is_prime+0x5e>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    114b <is_prime+0x4b>
movw   $0x0,-0x2(%rbp)
jmp    1164 <is_prime+0x64>
jmp    1150 <is_prime+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <is_prime+0x23>
movw   $0x1,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
cmp    $0x1,%edi
jne    1109 <is_prime+0x9>
xor    %ecx,%ecx
jmp    1131 <is_prime+0x31>
mov    $0x1,%cx
cmp    $0x3,%edi
jb     1131 <is_prime+0x31>
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     1105 <is_prime+0x5>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i16 @is_prime(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp ugt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = urem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i16 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i16 %13
}
/* Variables and functions */
int apply_at_specials(int);
int is_at_equiv(int attr1, int attr2) {
  attr1 = apply_at_specials(attr1);
  attr2 = apply_at_specials(attr2);
  return (attr1 == attr2);
}


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

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

LLVM IR (-O0):
define i32 @is_at_equiv(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 = call i32 @apply_at_specials(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @apply_at_specials(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp eq i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_at_equiv(i32 %0, i32 %1) {
%3 = tail call i32 @apply_at_specials(i32 %0)
%4 = tail call i32 @apply_at_specials(i32 %1)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void foo161(int p) {}


x86 assembly (clang, -O0):
<foo161>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo161(i32 %0) {
ret void
}
char *CopyString(str)
char *str;
{ return strsave(str); }


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

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

LLVM IR (-O0):
define i8* @CopyString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @strsave to i32 (i8*, ...)*)(i8* %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @CopyString(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @strsave to i32 (i8*, ...)*)(i8* %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ gdb_unbuffer_output();
int main(void) {
  int i = 0;
  gdb_unbuffer_output();
  i++;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gdb_unbuffer_output()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_pd(void) { m68ki_write_8(EA_AY_PD_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_pd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_PD_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_pd>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_PD_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_pd() {
%1 = call i32 (...) @EA_AY_PD_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_pd() {
%1 = tail call i32 (...) @EA_AY_PD_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
struct winsize *get_winsize(int /*<<< orphan*/);
int get_height() {
  struct winsize *ws = get_winsize(0);
  return ws->ws_row;
}


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

x86 assembly (clang, -O2):
<get_height>:
push   %rax
xor    %edi,%edi
call   1030 <get_winsize@plt>
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
define i32 @get_height() {
%1 = alloca %struct.winsize*
%2 = call %struct.winsize* @get_winsize(i32 0)
store %struct.winsize* %2, %struct.winsize** %1
%3 = load %struct.winsize*, %struct.winsize** %1
%4 = getelementptr inbounds %struct.winsize, %struct.winsize* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
define i32 @get_height() {
%1 = tail call %struct.winsize* @get_winsize(i32 0)
%2 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int getchar();
void inComment() {
  int c, d;
  c = getchar();
  d = getchar();
  while (c != '*' || d != '/') {
    c = d;
    d = getchar();
  }
}


x86 assembly (clang, -O0):
<inComment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x2a,-0x4(%rbp)
mov    %al,-0x9(%rbp)
jne    1145 <inComment+0x35>
cmpl   $0x2f,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1155 <inComment+0x45>
jmp    116a <inComment+0x5a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
jmp    112c <inComment+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inComment>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2a,%ebx
jne    1120 <inComment+0x10>
cmp    $0x2f,%eax
jne    1120 <inComment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @inComment() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 42
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 47
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = load i32, i32* %2
store i32 %14, i32* %1
%15 = call i32 (...) @getchar()
store i32 %15, i32* %2
br label %5
16: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @inComment() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 (...) @getchar()
%3 = icmp ne i32 %1, 42
%4 = icmp ne i32 %2, 47
%5 = or i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %2, %0 ]
%8 = tail call i32 (...) @getchar()
%9 = icmp ne i32 %7, 42
%10 = icmp ne i32 %8, 47
%11 = or i1 %9, %10
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret void
}
float *Vector3SubtractFromSelf(float v1[3], const float v2[3]) {
  v1[0] -= v2[0];
  v1[1] -= v2[1];
  v1[2] -= v2[2];
  return v1;
}


x86 assembly (clang, -O0):
<Vector3SubtractFromSelf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector3SubtractFromSelf>:
mov    %rdi,%rax
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
subss  (%rsi),%xmm0
movss  %xmm0,(%rdi)
subss  0x4(%rsi),%xmm1
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define float* @Vector3SubtractFromSelf(float* returned %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
%5 = fsub float %4, %3
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds float, float* %0, i64 1
%9 = load float, float* %8
%10 = fsub float %9, %7
store float %10, float* %8
%11 = getelementptr inbounds float, float* %1, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = fsub float %14, %12
store float %15, float* %13
ret float* %0
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  long long ms = (tv.tv_sec * 1000LL) + (tv.tv_usec / 1000);
  return ms;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i64 @now() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
store i64 %11, i64* %2
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}