xunge/DecIR huggingface dataset:
int test07(int a, int b, int c, int d) {
  int x = a == b;
  int y = c == 0;
  return x | y;
}


x86 assembly (clang, -O0):
<test07>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test07>:
cmp    %esi,%edi
sete   %al
test   %edx,%edx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @test07(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
store i32 %14, i32* %9
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = or i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test07(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = icmp eq i32 %2, 0
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int get_digit(int num) {
  if (num < 0) {
    num = -num;
  }
  int n = 0;
  while (num != 0) {
    num /= 10;
    n++;
  }
  return n;
}


x86 assembly (clang, -O0):
<get_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <get_digit+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <get_digit+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1120 <get_digit+0x20>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_digit>:
test   %edi,%edi
je     1133 <get_digit+0x33>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
nopl   (%rax)
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
add    $0x1,%eax
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <get_digit+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_digit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %9
9: ; preds = %6, %1
store i32 0, i32* %3
br label %10
10: ; preds = %13, %9
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %2
%15 = sdiv i32 %14, 10
store i32 %15, i32* %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %10
18: ; preds = %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @get_digit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %4, %3 ]
%8 = sdiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = add i32 %7, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %5
12: ; preds = %5, %1
%13 = phi i32 [ 0, %1 ], [ %9, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void _glMathAssert(int condition) {
  if (!condition) {
    exit(1);
  }
}


x86 assembly (clang, -O0):
<_glMathAssert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <_glMathAssert+0x1f>
mov    $0x1,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_glMathAssert>:
test   %edi,%edi
je     1115 <_glMathAssert+0x5>
ret
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @_glMathAssert(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
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @_glMathAssert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t get_bit_pu(uint8_t src, uint8_t bit_i) {
  return ((~src) & (1 << bit_i)) > 0;
}


x86 assembly (clang, -O0):
<get_bit_pu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bit_pu>:
mov    %esi,%ecx
mov    $0x1,%edx
shl    %cl,%edx
not    %edi
xor    %eax,%eax
test   %edi,%edx
setg   %al
ret

LLVM IR (-O0):
define i32 @get_bit_pu(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp sgt i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_bit_pu(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = shl nuw i32 1, %1
%5 = and i32 %4, %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void *__memcpy(void *to, void *from, int n) {
  int d0, d1, d2;
  __asm__ __volatile__("rep ; movsl\n\t"
                       "movl %4,%%ecx\n\t"
                       "andl $3,%%ecx\n\t"
                       "rep ; movsb\n\t"
                       : "=&c"(d0), "=&D"(d1), "=&S"(d2)
                       : "0"(n / 4), "g"(n), "1"((long)to), "2"((long)from)
                       : "memory");
  return (to);
}


x86 assembly (clang, -O0):
<__memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    %eax,-0x24(%rbp)
rep movsl %ds:(%rsi),%es:(%rdi)
mov    -0x24(%rbp),%ecx
and    $0x3,%ecx
rep movsb %ds:(%rsi),%es:(%rdi)
mov    %ecx,-0x18(%rbp)
mov    %edi,%eax
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__memcpy>:
lea    0x3(%rdx),%ecx
test   %edx,%edx
cmovns %edx,%ecx
mov    %rdi,%rax
sar    $0x2,%ecx
mov    %edx,-0x4(%rsp)
rep movsl %ds:(%rsi),%es:(%rdi)
mov    -0x4(%rsp),%ecx
and    $0x3,%ecx
rep movsb %ds:(%rsi),%es:(%rdi)
ret

LLVM IR (-O0):
define i8* @__memcpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = sdiv i32 %10, 4
%12 = load i32, i32* %6
%13 = load i8*, i8** %4
%14 = ptrtoint i8* %13 to i64
%15 = load i8*, i8** %5
%16 = ptrtoint i8* %15 to i64
%17 = call { i32, i64, i64 } asm sideeffect "rep ; movsl\0A\09movl $4,%ecx\0A\09andl $$3,%ecx\0A\09rep ; movsb\0A\09", "=&{cx},=&{di},=&{si},0,imr,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %11, i32 %12, i64 %14, i64 %16)
%18 = extractvalue { i32, i64, i64 } %17, 0
%19 = extractvalue { i32, i64, i64 } %17, 1
%20 = extractvalue { i32, i64, i64 } %17, 2
store i32 %18, i32* %7
%21 = trunc i64 %19 to i32
store i32 %21, i32* %8
%22 = trunc i64 %20 to i32
store i32 %22, i32* %9
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @__memcpy(i8* returned %0, i8* %1, i32 %2) {
%4 = sdiv i32 %2, 4
%5 = ptrtoint i8* %0 to i64
%6 = ptrtoint i8* %1 to i64
%7 = tail call { i32, i64, i64 } asm sideeffect "rep ; movsl\0A\09movl $4,%ecx\0A\09andl $$3,%ecx\0A\09rep ; movsb\0A\09", "=&{cx},=&{di},=&{si},0,imr,1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %4, i32 %2, i64 %5, i64 %6)
ret i8* %0
}
/* Variables and functions */
int rand();
int rand_sign() { return (rand() % 2 ? -1 : 1); }


x86 assembly (clang, -O0):
<rand_sign>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_sign>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x1,%eax
neg    %eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_sign() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 2
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 -1, i32 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @rand_sign() {
%1 = tail call i32 (...) @rand()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
const char *pathconN_nm6_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm6_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
test   %eax,%eax
jne    1127 <pathconN_nm6_name_in+0x27>
jmp    1117 <pathconN_nm6_name_in+0x17>
lea    0xee2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <pathconN_nm6_name_in+0x2f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm6_name_in>:
xor    %eax,%eax
test   %edi,%edi
lea    0xef5(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm6_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 0, label %5
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %7
6: ; preds = %1
store i8* null, i8** %2
br label %7
7: ; preds = %6, %5
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
define i8* @pathconN_nm6_name_in(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %3
}
/* Variables and functions */
int main() {
  char *p = NULL;
  *p = 'c';
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x63,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %2
%3 = load i8*, i8** %2
store i8 99, i8* %3
ret i32 0
}

LLVM IR (-O2):
void gtk_label_set_width_chars() {}


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

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

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

LLVM IR (-O2):
define void @gtk_label_set_width_chars() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int);
long ftell(int /*<<< orphan*/ *);
long flen(FILE *file) {
  long pos;
  long len;
  pos = ftell(file);
  fseek(file, 0, 2);
  len = ftell(file);
  fseek(file, pos, 0);
  return (len);
}


x86 assembly (clang, -O0):
<flen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x2,%edx
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flen>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @flen(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = call i32 @fseek(i32* %7, i64 0, i32 2)
%9 = load i32*, i32** %2
%10 = call i64 @ftell(i32* %9)
store i64 %10, i64* %4
%11 = load i32*, i32** %2
%12 = load i64, i64* %3
%13 = call i32 @fseek(i32* %11, i64 %12, i32 0)
%14 = load i64, i64* %4
ret i64 %14
}

LLVM IR (-O2):
define i64 @flen(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = tail call i32 @fseek(i32* %0, i64 0, i32 2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @fseek(i32* %0, i64 %2, i32 0)
ret i64 %4
}
int convertCharToWchar(char c) { return (unsigned char)c; }


x86 assembly (clang, -O0):
<convertCharToWchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertCharToWchar>:
movzbl %dil,%eax
ret

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

LLVM IR (-O2):
define i32 @convertCharToWchar(i8 signext %0) {
%2 = zext i8 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int get_number(int /*<<< orphan*/ *);
unsigned int get_number255(FILE *fp, unsigned int maxval) {
  unsigned int val = get_number(fp);
  return (255 * val + maxval / 2) / maxval;
}


x86 assembly (clang, -O0):
<get_number255>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_number@plt>
mov    %eax,-0x10(%rbp)
imul   $0xff,-0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number255>:
push   %rbx
mov    %esi,%ebx
call   1030 <get_number@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
sub    %eax,%ecx
mov    %ebx,%eax
shr    %eax
add    %ecx,%eax
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_number255(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @get_number(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = mul i32 255, %8
%10 = load i32, i32* %4
%11 = udiv i32 %10, 2
%12 = add i32 %9, %11
%13 = load i32, i32* %4
%14 = udiv i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_number255(i32* %0, i32 %1) {
%3 = tail call i32 @get_number(i32* %0)
%4 = mul i32 %3, 255
%5 = lshr i32 %1, 1
%6 = add i32 %4, %5
%7 = udiv i32 %6, %1
ret i32 %7
}
int skip_prefix(const char *str, const char *prefix, const char **out) {
  do {
    if (!*prefix) {
      *out = str;
      return 1;
    }
  } while (*str++ == *prefix++);
  return 0;
}


x86 assembly (clang, -O0):
<skip_prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1134 <skip_prefix+0x34>
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    116c <skip_prefix+0x6c>
jmp    1139 <skip_prefix+0x39>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1110 <skip_prefix+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_prefix>:
movzbl (%rsi),%eax
test   %al,%al
je     1119 <skip_prefix+0x19>
lea    0x1(%rdi),%rcx
add    $0x1,%rsi
cmp    %al,(%rdi)
mov    %rcx,%rdi
je     1100 <skip_prefix>
xor    %eax,%eax
ret
mov    %rdi,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @skip_prefix(i8* %0, i8* nocapture %1, i8** nocapture writeonly %2) {
br label %4
4: ; preds = %10, %3
%5 = phi i8* [ %0, %3 ], [ %11, %10 ]
%6 = phi i8* [ %1, %3 ], [ %13, %10 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
store i8* %5, i8** %2
br label %15
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = icmp eq i8 %12, %7
br i1 %14, label %4, label %15
15: ; preds = %10, %9
%16 = phi i32 [ 1, %9 ], [ 0, %10 ]
ret i32 %16
}
void baz(void) { (volatile int){4} / (volatile int){0}; }


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
movl   $0x4,-0x4(%rsp)
mov    -0x4(%rsp),%eax
movl   $0x0,-0x8(%rsp)
mov    -0x8(%rsp),%eax
ret

LLVM IR (-O0):
define void @baz() {
%1 = alloca i32
%2 = alloca i32
store i32 4, i32* %1
%3 = load volatile i32, i32* %1
store i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = sdiv i32 %3, %4
ret void
}

LLVM IR (-O2):
define void @baz() {
%1 = alloca i32
%2 = alloca i32
store i32 4, i32* %1
%3 = load volatile i32, i32* %1
store i32 0, i32* %2
%4 = load volatile i32, i32* %2
ret void
}
void TIM1_UP_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM1_UP_IRQHandler() {
ret void
}
int clauselen(int *ptr) { return ptr[-1]; }


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

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

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

LLVM IR (-O2):
define i32 @clauselen(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
%3 = load i32, i32* %2
ret i32 %3
}
void lcd_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @lcd_disable() {
ret void
}
void HMAC_CTX_init(void) {}


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

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

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

LLVM IR (-O2):
define void @HMAC_CTX_init() {
ret void
}
/* Variables and functions */
int OddsCounter(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int arr[5] = {3, 4, 1, 2, 5};
  printf("the number of odd number in the array is %d\n", OddsCounter(arr, 5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <OddsCounter@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <OddsCounter@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 3, i32 4, i32 1, i32 2, i32 5]
@.str = [45 x i8] c"the number of odd number in the array is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @OddsCounter(i32* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 3, i32 4, i32 1, i32 2, i32 5]
@.str = [45 x i8] c"the number of odd number in the array is %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @OddsCounter(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_dcl_code() {
  test_parser_verify_parse(test_parser_sourcefile("dcl", "$code"), "dcl",
                           "$code", "", 0);
}


x86 assembly (clang, -O0):
<test_dcl_code>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebd(%rip),%rdx
lea    0xebb(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dcl_code>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
lea    0xed2(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %r8d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dcl\00"
@.str.1 = [6 x i8] c"$code\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_dcl_code() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dcl\00"
@.str.1 = [6 x i8] c"$code\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_dcl_code() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_dobldobl_polynomials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(332, length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_dobldobl_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x14c,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_dobldobl_polynomials>:
mov    %rdi,%rsi
mov    $0x14c,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @syscon_number_of_dobldobl_polynomials(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 332, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_number_of_dobldobl_polynomials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 332, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int A, B;
  scanf("%d %d", &A, &B);
  printf("A=%d\n B=%d\n A-B=%d\n", A, B, A - B);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %esi,%ecx
sub    %edx,%ecx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [20 x i8] c"A=%d\0A B=%d\0A A-B=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
uid_t getuid(void) { return 5001; }


x86 assembly (clang, -O0):
<getuid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1389,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getuid() {
ret i32 5001
}

LLVM IR (-O2):
define i32 @getuid() {
ret i32 5001
}
int _ht_cmp_real(void *d1, void *d2) {
  float r1 = *(float *)d1;
  float r2 = *(float *)d2;
  float r = r1 - r2;
  int result = 0;
  if (r < 0.0f) {
    result = -1;
  } else if (r > 0.0f) {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<_ht_cmp_real>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1155 <_ht_cmp_real+0x55>
movl   $0xffffffff,-0x20(%rbp)
jmp    1172 <_ht_cmp_real+0x72>
movss  -0x1c(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    116d <_ht_cmp_real+0x6d>
movl   $0x1,-0x20(%rbp)
jmp    1172 <_ht_cmp_real+0x72>
mov    -0x20(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ht_cmp_real>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
mov    $0xffffffff,%eax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
ja     1121 <_ht_cmp_real+0x21>
xor    %eax,%eax
ucomiss %xmm1,%xmm0
jbe    1121 <_ht_cmp_real+0x21>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_ht_cmp_real(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to float*
%11 = load float, float* %10
store float %11, float* %5
%12 = load i8*, i8** %4
%13 = bitcast i8* %12 to float*
%14 = load float, float* %13
store float %14, float* %6
%15 = load float, float* %5
%16 = load float, float* %6
%17 = fsub float %15, %16
store float %17, float* %7
store i32 0, i32* %8
%18 = load float, float* %7
%19 = fcmp olt float %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %2
store i32 -1, i32* %8
br label %26
21: ; preds = %2
%22 = load float, float* %7
%23 = fcmp ogt float %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 1, i32* %8
br label %25
25: ; preds = %24, %21
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %8
ret i32 %27
}

LLVM IR (-O2):
define i32 @_ht_cmp_real(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fsub float %4, %6
%8 = fcmp olt float %7, 0.000000e+00
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = fcmp ogt float %7, 0.000000e+00
br i1 %10, label %11, label %12
11: ; preds = %9
br label %12
12: ; preds = %2, %9, %11
%13 = phi i32 [ 1, %11 ], [ 0, %9 ], [ -1, %2 ]
ret i32 %13
}
/* Type definitions */
typedef int mode_t;

/* Variables and functions */
int S_IFIFO;
int mknod(char const *, int, int /*<<< orphan*/);
int mkfifo(const char *path, mode_t mode) {
  return mknod(path, mode | S_IFIFO, 0);
}


x86 assembly (clang, -O0):
<mkfifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2eb3(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
call   1030 <mknod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkfifo>:
mov    0x2ec9(%rip),%rax
or     (%rax),%esi
xor    %edx,%edx
jmp    1030 <mknod@plt>

LLVM IR (-O0):
@S_IFIFO = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = load i32, i32* @S_IFIFO
%8 = or i32 %6, %7
%9 = call i32 @mknod(i8* %5, i32 %8, i32 0)
ret i32 %9
}

LLVM IR (-O2):
@S_IFIFO = global i32 0
define i32 @mkfifo(i8* %0, i32 %1) {
%3 = load i32, i32* @S_IFIFO
%4 = or i32 %3, %1
%5 = tail call i32 @mknod(i8* %0, i32 %4, i32 0)
ret i32 %5
}
/* Variables and functions */
int crc32c_partial(void const *, int, int);
unsigned compute_crc32c(const void *data, int len) {
  return crc32c_partial(data, len, -1) ^ -1;
}


x86 assembly (clang, -O0):
<compute_crc32c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%edx
call   1030 <crc32c_partial@plt>
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_crc32c>:
push   %rax
mov    $0xffffffff,%edx
call   1030 <crc32c_partial@plt>
not    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @compute_crc32c(i8* %0, i32 %1) {
%3 = tail call i32 @crc32c_partial(i8* %0, i32 %1, i32 -1)
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
char *getenv(char *);
char *libc_getenv(char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<libc_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @libc_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ KillPCB(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  if (argc == 3) {
    if (!strcmp(argv[1], "-9")) {
      KillPCB(atoi(argv[2]));
    }
  }
  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    %rdx,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    118a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9d(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1185 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <KillPCB@plt>
jmp    118a <main+0x5a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x3,%edi
jne    115d <main+0x2d>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xebc(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    115d <main+0x2d>
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <KillPCB@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-9\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 3
br i1 %9, label %10, label %23
10: ; preds = %3
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %22, label %16
16: ; preds = %10
%17 = load i8**, i8*** %6
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
%21 = call i32 @KillPCB(i32 %20)
br label %22
22: ; preds = %16, %10
br label %23
23: ; preds = %22, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-9\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp eq i32 %0, 3
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %7, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i32 @KillPCB(i32 %13)
br label %15
15: ; preds = %5, %10, %3
ret i32 0
}
int _evbuffer_testing_use_linear_file_access(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @_evbuffer_testing_use_linear_file_access() {
ret i32 1
}

LLVM IR (-O2):
define i32 @_evbuffer_testing_use_linear_file_access() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_ndac(int);
int /*<<< orphan*/ parallel_set_ndac(int);
void parallel_drv3_set_ndac(unsigned char val) {
  if (val) {
    parallel_set_ndac(0x20);
  } else {
    parallel_clr_ndac(~0x20);
  }
}


x86 assembly (clang, -O0):
<parallel_drv3_set_ndac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_drv3_set_ndac+0x27>
mov    $0x20,%edi
call   1040 <parallel_set_ndac@plt>
jmp    1151 <parallel_drv3_set_ndac+0x31>
mov    $0xffffffdf,%edi
call   1030 <parallel_clr_ndac@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_drv3_set_ndac>:
test   %edi,%edi
je     112e <parallel_drv3_set_ndac+0xe>
mov    $0x20,%edi
jmp    1040 <parallel_set_ndac@plt>
mov    $0xffffffdf,%edi
jmp    1030 <parallel_clr_ndac@plt>

LLVM IR (-O0):
define void @parallel_drv3_set_ndac(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @parallel_set_ndac(i32 32)
br label %9
7: ; preds = %1
%8 = call i32 @parallel_clr_ndac(i32 -33)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @parallel_drv3_set_ndac(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_ndac(i32 32)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_ndac(i32 -33)
br label %7
7: ; preds = %5, %3
ret void
}
void callee_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @callee_1_2_2() {
ret void
}
void troca(float *a, float *b) {
  float tmp;
  tmp = *a;
  *a = *b;
  *b = tmp;
}


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

x86 assembly (clang, -O2):
<troca>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
movss  %xmm1,(%rdi)
movss  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @troca(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** %3
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = load float*, float** %3
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @troca(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
store float %4, float* %0
store float %3, float* %1
ret void
}
/* Variables and functions */
double log(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double ln, x;
  for (x = 0.1; x < 6.0; x += 0.1) {
    ln = log(x);
    printf("ln(%.1f) = %f\n", x, ln);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec4(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    118b <main+0x6b>
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe84(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113c <main+0x1c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movsd  0xed3(%rip),%xmm0
lea    0xedc(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe90(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xe8a(%rip),%xmm0
ucomisd 0x8(%rsp),%xmm0
movsd  0x8(%rsp),%xmm0
ja     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ln(%.1f) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e-01, double* %3
br label %4
4: ; preds = %13, %0
%5 = load double, double* %3
%6 = fcmp olt double %5, 6.000000e+00
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load double, double* %3
%9 = call double @log(double %8)
store double %9, double* %2
%10 = load double, double* %3
%11 = load double, double* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %10, double %11)
br label %13
13: ; preds = %7
%14 = load double, double* %3
%15 = fadd double %14, 1.000000e-01
store double %15, double* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"ln(%.1f) = %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ 1.000000e-01, %0 ], [ %5, %1 ]
%3 = tail call double @log(double %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %2, double %3)
%5 = fadd double %2, 1.000000e-01
%6 = fcmp olt double %5, 6.000000e+00
br i1 %6, label %1, label %7
7: ; preds = %1
ret i32 0
}
int fb_SGNSingle(float x) {
  if (x == 0.0)
    return 0;
  else if (x > 0.0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<fb_SGNSingle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1131 <fb_SGNSingle+0x31>
jp     1131 <fb_SGNSingle+0x31>
movl   $0x0,-0x4(%rbp)
jmp    115a <fb_SGNSingle+0x5a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1153 <fb_SGNSingle+0x53>
movl   $0x1,-0x4(%rbp)
jmp    115a <fb_SGNSingle+0x5a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_SGNSingle>:
xor    %eax,%eax
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fb_SGNSingle(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp oeq double %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fcmp ogt double %10, 0.000000e+00
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fb_SGNSingle(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
%3 = fcmp ogt float %0, 0.000000e+00
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, float *);
void main(void) {
  int x;
  float y[10];
  foo(x, y);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
call   1030 <foo@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rsi
call   1030 <foo@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define void @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call i32 @foo(i32 undef, float* %3)
ret void
}
int Find(int *set, int p) {
  if (set[p] == p) {
    return p;
  }
  int root = Find(set, set[p]);
  set[p] = root;
  return root;
}


x86 assembly (clang, -O0):
<Find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    113e <Find+0x2e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <Find+0x59>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <Find@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Find>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%eax
movslq %esi,%rbx
mov    (%rdi,%rbx,4),%esi
cmp    %ebx,%esi
je     112c <Find+0x1c>
mov    %rdi,%r14
call   1030 <Find@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @Find(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, %1
br i1 %6, label %7, label %9
7: ; preds = %2, %9
%8 = phi i32 [ %10, %9 ], [ %1, %2 ]
ret i32 %8
9: ; preds = %2
%10 = tail call i32 @Find(i32* %0, i32 %5)
store i32 %10, i32* %4
br label %7
}