xunge/DecIR huggingface dataset:
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, ...);
void child_process(int fpid) {
  printf("======================Child Process======================\n");
  printf("My PID is %d\n", getpid());
  printf("=========================================================\n\n");
}


x86 assembly (clang, -O0):
<child_process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_process>:
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeed(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"======================Child Process======================\0A\00"
@.str.1 = [14 x i8] c"My PID is %d\0A\00"
@.str.2 = [60 x i8] c"=========================================================\0A\0A\00"
define void @child_process(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @getpid()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"My PID is %d\0A\00"
@str = [58 x i8] c"======================Child Process======================\00"
@str.3 = [59 x i8] c"=========================================================\0A\00"
define void @child_process(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.3, i64 0, i64 0))
ret void
}
void ARGBCopyAlphaRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBCopyAlphaRow_Any_SSE2() {
ret void
}
/* Type definitions */
typedef int __v4si;
typedef scalar_t__ __m128d;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_andnot_pd(__m128d a, __m128d b) {
  return (__m128d)(~(__v4si)a & (__v4si)b);
}


x86 assembly (clang, -O0):
<_mm_andnot_pd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    $0xffffffff,%eax
mov    -0x10(%rbp),%rcx
and    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_andnot_pd>:
not    %edi
and    %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @_mm_andnot_pd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = xor i32 %6, -1
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = and i32 %7, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @_mm_andnot_pd(i64 %0, i64 %1) {
%3 = xor i64 %0, -1
%4 = and i64 %3, %1
%5 = shl i64 %4, 32
%6 = ashr exact i64 %5, 32
ret i64 %6
}
double rng_drand(struct anon$18 *rngh) {
  unsigned int return_value_rng_urand$1;
  return_value_rng_urand$1 = rng_urand(rngh);
  return (double)return_value_rng_urand$1 / 4.294967e+9;
}


x86 assembly (clang, -O0):
<rng_drand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
call   1030 <rng_urand@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_drand>:
push   %rax
xor    %eax,%eax
call   1030 <rng_urand@plt>
mov    %eax,%eax
cvtsi2sd %rax,%xmm0
divsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%"struct.anon$18" = type opaque
define double @rng_drand(%"struct.anon$18"* %0) {
%2 = alloca %"struct.anon$18"*
%3 = alloca i32
store %"struct.anon$18"* %0, %"struct.anon$18"** %2
%4 = load %"struct.anon$18"*, %"struct.anon$18"** %2
%5 = call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = uitofp i32 %6 to double
%8 = fdiv double %7, 0x41EFFFFFDB000000
ret double %8
}

LLVM IR (-O2):
%"struct.anon$18" = type opaque
define double @rng_drand(%"struct.anon$18"* %0) {
%2 = tail call i32 (%"struct.anon$18"*, ...) bitcast (i32 (...)* @rng_urand to i32 (%"struct.anon$18"*, ...)*)(%"struct.anon$18"* %0)
%3 = uitofp i32 %2 to double
%4 = fdiv double %3, 0x41EFFFFFDB000000
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ f4(int);
int f5(int /*<<< orphan*/);
int f6(unsigned int x) {
  f4(x < (1 != f5(0)));
  return x;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <f5@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%eax
mov    $0x1,%ecx
cmp    %edx,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <f4@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <f5@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
xor    %edi,%edi
cmp    %ebx,%ecx
seta   %dil
call   1040 <f4@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f5(i32 0)
%5 = icmp ne i32 1, %4
%6 = zext i1 %5 to i32
%7 = icmp ult i32 %3, %6
%8 = zext i1 %7 to i32
%9 = call i32 @f4(i32 %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @f6(i32 returned %0) {
%2 = tail call i32 @f5(i32 0)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
%5 = icmp ugt i32 %4, %0
%6 = zext i1 %5 to i32
%7 = tail call i32 @f4(i32 %6)
ret i32 %0
}
__attribute__((no, noclone)) void clear_stack(void) {
  char a[128 * 1024 + 128];
  __builtin_memset(a + 128 * 1024, 0, 128);
}


x86 assembly (clang, -O0):
<clear_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20080,%rsp
lea    -0x20080(%rbp),%rdi
add    $0x20000,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
add    $0x20080,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @clear_stack() {
%1 = alloca [131200 x i8]
%2 = getelementptr inbounds [131200 x i8], [131200 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds i8, i8* %2, i64 131072
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ _mm_div_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_div_ps(__m128 A, __m128 B) { return _mm_div_ps(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_div_ps>:
jmp    1030 <_mm_div_ps@plt>

LLVM IR (-O0):
define i32 @test_mm_div_ps(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 = call i32 @_mm_div_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_div_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_div_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *fun1(void *arg) {
  while (1) {
    printf("in fun1\n");
    sleep(1);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    112c <fun1+0xc>

x86 assembly (clang, -O2):
<fun1>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1130 <fun1+0x10>

LLVM IR (-O0):
@.str = [9 x i8] c"in fun1\0A\00"
define i8* @fun1(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@str = [8 x i8] c"in fun1\00"
define noalias i8* @fun1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 1)
br label %2
}
/* Type definitions */
struct utimbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int utime(const char *file, const struct utimbuf *times) {
  if (file == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <utime+0x35>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <utime+0x4a>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
push   %rax
test   %rdi,%rdi
jne    111f <utime+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <utime+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utimbuf = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.utimbuf*
store i8* %0, i8** %4
store %struct.utimbuf* %1, %struct.utimbuf** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load i32, i32* @ENOSYS
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.utimbuf = type { i32 }
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @utime(i8* readnone %0, %struct.utimbuf* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
%4 = load i32, i32* @EINVAL
%5 = load i32, i32* @ENOSYS
%6 = select i1 %3, i32 %4, i32 %5
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
int __pstart(int *, int *, int *, void *);
int __pdosst32(int i1, int i2, int i3, void *exep) {
  int rc;
  rc = __pstart(&i1, &i2, &i3, exep);
  return (rc);
}


x86 assembly (clang, -O0):
<__pdosst32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <__pstart@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pdosst32>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1030 <__pstart@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @__pdosst32(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %8
%11 = call i32 @__pstart(i32* %5, i32* %6, i32* %7, i8* %10)
store i32 %11, i32* %9
%12 = load i32, i32* %9
ret i32 %12
}

LLVM IR (-O2):
define i32 @__pdosst32(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = call i32 @__pstart(i32* %5, i32* %6, i32* %7, i8* %3)
ret i32 %8
}
/* Variables and functions */
unsigned int GET32(int);
int /*<<< orphan*/ PUT32(int, int);
void leds_off(void) {
  unsigned int ra;
  ra = GET32(0x3F200010);
  ra &= ~(7 << 21);
  ra |= 1 << 21;
  PUT32(0x3F200010, ra);
  ra = GET32(0x3F20000C);
  ra &= ~(7 << 15);
  ra |= 1 << 15;
  PUT32(0x3F20000C, ra);
  PUT32(0x3F20002C, 1 << (47 - 32));
  PUT32(0x3F20002C, 1 << (35 - 32));
}


x86 assembly (clang, -O0):
<leds_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3f200010,%edi
call   1040 <GET32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff1fffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x200000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3f200010,%edi
call   1030 <PUT32@plt>
mov    $0x3f20000c,%edi
call   1040 <GET32@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffc7fff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x8000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x3f20000c,%edi
call   1030 <PUT32@plt>
mov    $0x3f20002c,%edi
mov    $0x8000,%esi
call   1030 <PUT32@plt>
mov    $0x3f20002c,%edi
mov    $0x8,%esi
call   1030 <PUT32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leds_off>:
push   %rax
mov    $0x3f200010,%edi
call   1040 <GET32@plt>
and    $0xff1fffff,%eax
lea    0x200000(%rax),%esi
mov    $0x3f200010,%edi
call   1030 <PUT32@plt>
mov    $0x3f20000c,%edi
call   1040 <GET32@plt>
and    $0xfffc7fff,%eax
lea    0x8000(%rax),%esi
mov    $0x3f20000c,%edi
call   1030 <PUT32@plt>
mov    $0x3f20002c,%edi
mov    $0x8000,%esi
call   1030 <PUT32@plt>
mov    $0x3f20002c,%edi
mov    $0x8,%esi
pop    %rax
jmp    1030 <PUT32@plt>

LLVM IR (-O0):
define void @leds_off() {
%1 = alloca i32
%2 = call i32 @GET32(i32 1059061776)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -14680065
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = or i32 %5, 2097152
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = call i32 @PUT32(i32 1059061776, i32 %7)
%9 = call i32 @GET32(i32 1059061772)
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = and i32 %10, -229377
store i32 %11, i32* %1
%12 = load i32, i32* %1
%13 = or i32 %12, 32768
store i32 %13, i32* %1
%14 = load i32, i32* %1
%15 = call i32 @PUT32(i32 1059061772, i32 %14)
%16 = call i32 @PUT32(i32 1059061804, i32 32768)
%17 = call i32 @PUT32(i32 1059061804, i32 8)
ret void
}

LLVM IR (-O2):
define void @leds_off() {
%1 = tail call i32 @GET32(i32 1059061776)
%2 = and i32 %1, -14680065
%3 = or i32 %2, 2097152
%4 = tail call i32 @PUT32(i32 1059061776, i32 %3)
%5 = tail call i32 @GET32(i32 1059061772)
%6 = and i32 %5, -229377
%7 = or i32 %6, 32768
%8 = tail call i32 @PUT32(i32 1059061772, i32 %7)
%9 = tail call i32 @PUT32(i32 1059061804, i32 32768)
%10 = tail call i32 @PUT32(i32 1059061804, i32 8)
ret void
}
void gtk_drag_source_set_icon_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gtk_drag_source_set_icon_pixbuf() {
ret void
}
void VDP_waitVSync() {
  volatile unsigned short *pw;
  pw = (unsigned short *)0xC00004;
  while (*pw & (1 << 3))
    ;
  while (!(*pw & (1 << 3)))
    ;
}


x86 assembly (clang, -O0):
<VDP_waitVSync>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc00004,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1128 <VDP_waitVSync+0x28>
jmp    110d <VDP_waitVSync+0xd>
jmp    112d <VDP_waitVSync+0x2d>
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114f <VDP_waitVSync+0x4f>
jmp    1154 <VDP_waitVSync+0x54>
jmp    112d <VDP_waitVSync+0x2d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_waitVSync>:
movzwl 0xc00004,%eax
test   $0x8,%al
jne    1100 <VDP_waitVSync>
nopl   0x0(%rax)
movzwl 0xc00004,%eax
test   $0x8,%al
je     1110 <VDP_waitVSync+0x10>
ret

LLVM IR (-O0):
define void @VDP_waitVSync() {
%1 = alloca i16*
store i16* inttoptr (i64 12582916 to i16*), i16** %1
br label %2
2: ; preds = %8, %0
%3 = load i16*, i16** %1
%4 = load volatile i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %2
9: ; preds = %2
br label %10
10: ; preds = %17, %9
%11 = load i16*, i16** %1
%12 = load volatile i16, i16* %11
%13 = zext i16 %12 to i32
%14 = and i32 %13, 8
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %18
17: ; preds = %10
br label %10
18: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @VDP_waitVSync() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i16, i16* inttoptr (i64 12582916 to i16*)
%3 = and i16 %2, 8
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1, %5
%6 = load volatile i16, i16* inttoptr (i64 12582916 to i16*)
%7 = and i16 %6, 8
%8 = icmp eq i16 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5
ret void
}
/* Type definitions */
struct dynstr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dynstr_append_bytes(struct dynstr *, char const *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
void dynstr_append_string(struct dynstr *v, const char *ptr) {
  dynstr_append_bytes(v, ptr, strlen(ptr));
}


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

x86 assembly (clang, -O2):
<dynstr_append_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dynstr_append_bytes@plt>

LLVM IR (-O0):
%struct.dynstr = type { i32 }
define void @dynstr_append_string(%struct.dynstr* %0, i8* %1) {
%3 = alloca %struct.dynstr*
%4 = alloca i8*
store %struct.dynstr* %0, %struct.dynstr** %3
store i8* %1, i8** %4
%5 = load %struct.dynstr*, %struct.dynstr** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @dynstr_append_bytes(%struct.dynstr* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.dynstr = type { i32 }
define void @dynstr_append_string(%struct.dynstr* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @dynstr_append_bytes(%struct.dynstr* %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void CloseSecret(FILE *fp) { fclose(fp); }


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

x86 assembly (clang, -O2):
<CloseSecret>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @CloseSecret(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
void test4(int **p) {
  if (*p)
    return;
  **p = 1;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     111b <test4+0x1b>
jmp    1128 <test4+0x28>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test4(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp ne i32* %2, null
tail call void @llvm.assume(i1 %3)
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *str) {
  size_t len;
  char *copy;
  len = strlen(str) + 1;
  if ((copy = malloc(len)) == NULL)
    return (NULL);
  memcpy(copy, str, len);
  return (copy);
}


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

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

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
float ass(float x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<ass>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <ass+0x32>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    113c <ass+0x3c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ass>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @ass(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
br label %10
8: ; preds = %1
%9 = load float, float* %2
br label %10
10: ; preds = %8, %5
%11 = phi float [ %7, %5 ], [ %9, %8 ]
ret float %11
}

LLVM IR (-O2):
define float @ass(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
void CM_Shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @CM_Shutdown() {
ret void
}
int filter_terminate(void *user_param) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @filter_terminate(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef unsigned int uint;

/* Variables and functions */
int /*<<< orphan*/ isxdigit(char);
uint hexlen(char *str) {
  unsigned int sum = 0;
  while (1) {
    char chh = *str;
    if (!isxdigit(chh))
      break;
    str++;
    sum++;
  }
  return (sum);
}


x86 assembly (clang, -O0):
<hexlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%eax
jne    1143 <hexlen+0x33>
jmp    115d <hexlen+0x4d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <hexlen+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexlen>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffff,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <isxdigit@plt>
add    $0x1,%rbx
add    $0x1,%ebp
test   %eax,%eax
jne    1120 <hexlen+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i8* [ %0, %1 ], [ %8, %2 ]
%5 = load i8, i8* %4
%6 = tail call i32 @isxdigit(i8 signext %5)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = add i32 %3, 1
br i1 %7, label %10, label %2
10: ; preds = %2
ret i32 %3
}
char *protocol_GetRequest() {
  char *result = socket_ReceiveFromClient();
  if (result[0] != 'I') {
    error(__FUNCTION__, "Server request malformed");
  }
  return result;
}


x86 assembly (clang, -O0):
<protocol_GetRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <socket_ReceiveFromClient@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x49,%eax
je     115a <protocol_GetRequest+0x3a>
lea    0xeb4(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocol_GetRequest>:
push   %rbx
xor    %eax,%eax
call   1030 <socket_ReceiveFromClient@plt>
movslq %eax,%rbx
cmpb   $0x49,(%rbx)
je     1145 <protocol_GetRequest+0x25>
lea    0xec9(%rip),%rdi
lea    0xed6(%rip),%rsi
xor    %eax,%eax
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@__FUNCTION__.protocol_GetRequest = [20 x i8] c"protocol_GetRequest\00"
@.str = [25 x i8] c"Server request malformed\00"
define i8* @protocol_GetRequest() {
%1 = alloca i8*
%2 = call i32 (...) @socket_ReceiveFromClient()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 73
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.protocol_GetRequest, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@__FUNCTION__.protocol_GetRequest = [20 x i8] c"protocol_GetRequest\00"
@.str = [25 x i8] c"Server request malformed\00"
define i8* @protocol_GetRequest() {
%1 = tail call i32 (...) @socket_ReceiveFromClient()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 73
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.protocol_GetRequest, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret i8* %3
}
int main() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void default_deallocate(void *user_data, void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @default_deallocate(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/
deceptiveTrapKTightEncodingFunctionProblemEvaluation(char *, double *, double *,
                                                     int);
void deceptiveTrap5TightEncodingFunctionProblemEvaluation(
    char *parameters, double *objective_value, double *constraint_value) {
  deceptiveTrapKTightEncodingFunctionProblemEvaluation(
      parameters, objective_value, constraint_value, 5);
}


x86 assembly (clang, -O0):
<deceptiveTrap5TightEncodingFunctionProblemEvaluation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x5,%ecx
call   1030 <deceptiveTrapKTightEncodingFunctionProblemEvaluation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deceptiveTrap5TightEncodingFunctionProblemEvaluation>:
mov    $0x5,%ecx
jmp    1030 <deceptiveTrapKTightEncodingFunctionProblemEvaluation@plt>

LLVM IR (-O0):
define void @deceptiveTrap5TightEncodingFunctionProblemEvaluation(i8* %0, double* %1, double* %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
store i8* %0, i8** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load i8*, i8** %4
%8 = load double*, double** %5
%9 = load double*, double** %6
%10 = call i32 @deceptiveTrapKTightEncodingFunctionProblemEvaluation(i8* %7, double* %8, double* %9, i32 5)
ret void
}

LLVM IR (-O2):
define void @deceptiveTrap5TightEncodingFunctionProblemEvaluation(i8* %0, double* %1, double* %2) {
%4 = tail call i32 @deceptiveTrapKTightEncodingFunctionProblemEvaluation(i8* %0, double* %1, double* %2, i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf();
int main() {
  asprintf();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @asprintf()
ret i32 0
}
void init_tty(void) {}


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

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

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

LLVM IR (-O2):
define void @init_tty() {
ret void
}
int removetrailingspaces(char line[], int length) {
  int c;
  while ((c = line[length - 1]) == ' ' || c == '\n' || c == '\t') {
    line[length - 1] = '\0';
    length--;
  }
  return length;
}


x86 assembly (clang, -O0):
<removetrailingspaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%ecx
mov    %ecx,-0x10(%rbp)
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     1146 <removetrailingspaces+0x46>
mov    $0x1,%al
cmpl   $0xa,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     1146 <removetrailingspaces+0x46>
cmpl   $0x9,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1156 <removetrailingspaces+0x56>
jmp    1175 <removetrailingspaces+0x75>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <removetrailingspaces+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<removetrailingspaces>:
mov    %esi,%eax
movslq %esi,%rcx
add    %rdi,%rcx
add    $0xffffffffffffffff,%rcx
movabs $0x100000600,%rdx
cs nopw 0x0(%rax,%rax,1)
movzbl (%rcx),%esi
cmp    $0x20,%rsi
ja     113b <removetrailingspaces+0x3b>
bt     %rsi,%rdx
jae    113b <removetrailingspaces+0x3b>
movb   $0x0,(%rcx)
add    $0xffffffff,%eax
add    $0xffffffffffffffff,%rcx
jmp    1120 <removetrailingspaces+0x20>
ret

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

LLVM IR (-O2):
define i32 @removetrailingspaces(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
switch i8 %8, label %10 [
i8 32, label %9
i8 10, label %9
i8 9, label %9
]
9: ; preds = %4, %4, %4
store i8 0, i8* %7
br label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Type definitions */
struct mtwist_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ mtwist_next(struct mtwist_state *);
float mtwist_float(struct mtwist_state *mtstate) {
  return (float)mtwist_next(mtstate) / (float)0xfffffffeUL;
}


x86 assembly (clang, -O0):
<mtwist_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mtwist_next@plt>
cvtsi2ss %rax,%xmm0
movss  0xece(%rip),%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtwist_float>:
push   %rax
call   1030 <mtwist_next@plt>
cvtsi2ss %rax,%xmm0
mulss  0xedd(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.mtwist_state = type { i32 }
define float @mtwist_float(%struct.mtwist_state* %0) {
%2 = alloca %struct.mtwist_state*
store %struct.mtwist_state* %0, %struct.mtwist_state** %2
%3 = load %struct.mtwist_state*, %struct.mtwist_state** %2
%4 = call i64 @mtwist_next(%struct.mtwist_state* %3)
%5 = sitofp i64 %4 to float
%6 = fdiv float %5, 0x41F0000000000000
ret float %6
}

LLVM IR (-O2):
%struct.mtwist_state = type { i32 }
define float @mtwist_float(%struct.mtwist_state* %0) {
%2 = tail call i64 @mtwist_next(%struct.mtwist_state* %0)
%3 = sitofp i64 %2 to float
%4 = fmul float %3, 0x3DF0000000000000
ret float %4
}
double f(double x) {
  double y;
  y = 2 * x * x - 3.12;
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 2.000000e+00, %4
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double %5, double %6, double -3.120000e+00)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double -3.120000e+00)
ret double %3
}
void spin(unsigned int ticks) {
  volatile unsigned int timer = 0;
  while (timer < ticks)
    ++timer;
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1128 <spin+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <spin+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin>:
movl   $0x0,-0x4(%rsp)
nopl   0x0(%rax,%rax,1)
mov    -0x4(%rsp),%eax
cmp    %edi,%eax
jae    111f <spin+0x1f>
addl   $0x1,-0x4(%rsp)
jmp    1110 <spin+0x10>
ret

LLVM IR (-O0):
define void @spin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load volatile i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ult i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load volatile i32, i32* %3
%10 = add i32 %9, 1
store volatile i32 %10, i32* %3
br label %4
11: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @spin(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 0, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp ult i32 %4, %0
br i1 %5, label %6, label %11
6: ; preds = %1, %6
%7 = load volatile i32, i32* %2
%8 = add i32 %7, 1
store volatile i32 %8, i32* %2
%9 = load volatile i32, i32* %2
%10 = icmp ult i32 %9, %0
br i1 %10, label %6, label %11
11: ; preds = %6, %1
ret void
}
void eapol_sm_notify_tx_eapol_key(struct eapol_sm *sm) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_notify_tx_eapol_key(%struct.eapol_sm* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_nogood() { printf("Try again.\n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"Try again.\0A\00"
define void @print_nogood() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"Try again.\00"
define void @print_nogood() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
char transLettre(char a) {
  if (a >= 'a' && a <= 'z')
    return (a + 'A' - 'a');
  if (a >= 'A' && a <= 'Z')
    return a;
  return a;
}


x86 assembly (clang, -O0):
<transLettre>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1136 <transLettre+0x36>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1136 <transLettre+0x36>
movsbl -0x2(%rbp),%eax
add    $0x41,%eax
sub    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1161 <transLettre+0x61>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115b <transLettre+0x5b>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     115b <transLettre+0x5b>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1161 <transLettre+0x61>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transLettre>:
lea    -0x61(%rdi),%eax
lea    -0x20(%rdi),%ecx
cmp    $0x1a,%al
movzbl %cl,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @transLettre(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %17
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %17
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 65
%15 = sub nsw i32 %14, 97
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %29
17: ; preds = %7, %1
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = icmp sge i32 %19, 65
br i1 %20, label %21, label %27
21: ; preds = %17
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i8, i8* %3
store i8 %26, i8* %2
br label %29
27: ; preds = %21, %17
%28 = load i8, i8* %3
store i8 %28, i8* %2
br label %29
29: ; preds = %27, %25, %11
%30 = load i8, i8* %2
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @transLettre(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  float x = 5.0f / 0.0f;
  int32_t ix = (int32_t)x;
  if (ix == 0) {
    printf("ix is 0\n");
  }
  if (ix != 0) {
    printf("ix is not 0\n");
  }
}


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)
movss  0xed2(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <main+0x44>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x20(%rbp)
je     116b <main+0x5b>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void gtk_clipboard_request_contents() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_request_contents() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, ...);
void log_insert(int fd, char *key, char *value, int k_len, int v_len) {
  write(fd, &k_len, sizeof(int));
  write(fd, &v_len, sizeof(int));
  write(fd, key, k_len);
  write(fd, value, v_len);
}


x86 assembly (clang, -O0):
<log_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_insert>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %ecx,0xc(%rsp)
mov    %r8d,0x8(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <write@plt>
lea    0x8(%rsp),%rsi
mov    $0x4,%edx
mov    %ebp,%edi
xor    %eax,%eax
call   1030 <write@plt>
mov    0xc(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
mov    0x8(%rsp),%edx
mov    %ebp,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @log_insert(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = call i32 (i32, ...) @write(i32 %11, i32* %9, i64 4)
%13 = load i32, i32* %6
%14 = call i32 (i32, ...) @write(i32 %13, i32* %10, i64 4)
%15 = load i32, i32* %6
%16 = load i8*, i8** %7
%17 = load i32, i32* %9
%18 = call i32 (i32, ...) @write(i32 %15, i8* %16, i32 %17)
%19 = load i32, i32* %6
%20 = load i8*, i8** %8
%21 = load i32, i32* %10
%22 = call i32 (i32, ...) @write(i32 %19, i8* %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @log_insert(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
store i32 %3, i32* %6
store i32 %4, i32* %7
%8 = call i32 (i32, ...) @write(i32 %0, i32* %6, i64 4)
%9 = call i32 (i32, ...) @write(i32 %0, i32* %7, i64 4)
%10 = load i32, i32* %6
%11 = call i32 (i32, ...) @write(i32 %0, i8* %1, i32 %10)
%12 = load i32, i32* %7
%13 = call i32 (i32, ...) @write(i32 %0, i8* %2, i32 %12)
ret void
}