xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ x3;
typedef int /*<<< orphan*/ x2;
typedef int /*<<< orphan*/ x1;
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_cas_32(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ atomic_cas_64(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int /*<<< orphan*/ memset(int /*<<< orphan*/ *, int, int);
int main(int argc, char **argv) {
  pthread_t x1;
  pthread_t x2;
  pthread_t x3;
  memset(&x1, 0x0, sizeof(x1));
  memset(&x2, 0x0, sizeof(x2));
  memset(&x3, 0x0, sizeof(x3));
  if (sizeof(pthread_t) == 4) {
    atomic_cas_32(&x1, x2, x3);
  } else if (sizeof(pthread_t) == 8) {
    atomic_cas_64(&x1, x2, x3);
  } else {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x1c(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    -0x14(%rbp),%rdi
call   1030 <atomic_cas_32@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @memset(i32* %6, i32 0, i32 4)
%10 = call i32 @memset(i32* %7, i32 0, i32 4)
%11 = call i32 @memset(i32* %8, i32 0, i32 4)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @atomic_cas_32(i32* %6, i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i32 @memset(i32* %3, i32 0, i32 4)
%10 = call i32 @memset(i32* %4, i32 0, i32 4)
%11 = call i32 @memset(i32* %5, i32 0, i32 4)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @atomic_cas_32(i32* %3, i32 %12, i32 %13)
ret i32 0
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int wctob(wint_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @wctob(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int libCMP0060();
int main(void) { return libCMP0060(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @libCMP0060()
ret i32 %1
}
void f2(void) {
  goto start;
  {
    int a[1 && 1];
    int b[1 || 1];
    int c[1 ? 1 : 1];
  start:
    a[0] = 0;
    b[0] = 0;
    c[0] = 0;
  }
}


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

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = alloca [1 x i32]
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 0, i32* %7
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
/* Variables and functions */
double stress_funccall_double_1(double const);
double stress_funcdeep_double_5(double const, double const, double const,
                                double const, double const);
double __attribute__((no))
stress_funcdeep_double_6(const double a, const double b, const double c,
                         const double d, const double e, const double f) {
  return stress_funcdeep_double_5(f, e, d, c, b) + stress_funccall_double_1(a);
}


x86 assembly (clang, -O0):
<stress_funcdeep_double_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm3
movsd  -0x10(%rbp),%xmm4
call   1030 <stress_funcdeep_double_5@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <stress_funccall_double_1@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcdeep_double_6>:
sub    $0x18,%rsp
movaps %xmm2,%xmm6
movaps %xmm1,%xmm7
movsd  %xmm0,0x10(%rsp)
movaps %xmm5,%xmm0
movaps %xmm4,%xmm1
movaps %xmm3,%xmm2
movaps %xmm6,%xmm3
movaps %xmm7,%xmm4
call   1030 <stress_funcdeep_double_5@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <stress_funccall_double_1@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @stress_funcdeep_double_6(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call double @stress_funcdeep_double_5(double %5, double %4, double %3, double %2, double %1)
%8 = tail call double @stress_funccall_double_1(double %0)
%9 = fadd double %7, %8
ret double %9
}
unsigned long int cast_ushort_ulong_fast(unsigned short int x) {
  return (unsigned long int)x;
}


x86 assembly (clang, -O0):
<cast_ushort_ulong_fast>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @cast_ushort_ulong_fast(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @cast_ushort_ulong_fast(i16 zeroext %0) {
%2 = zext i16 %0 to i64
ret i64 %2
}
int test_imm_06int8_reg(signed char val) {
  return ((val) & (-0x06 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_06int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xfffffffa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_06int8_reg>:
test   $0xfa,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_06int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -6
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_06int8_reg(i8 signext %0) {
%2 = and i8 %0, -6
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_58uint8_reg(unsigned char val) {
  return ((val) & (-0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffa8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_58uint8_reg>:
test   $0xa8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_58uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -88
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_58uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -88
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ sleep(int);
void signal_handler(int signo) {
  if (signo == SIGINT) {
    while (1) {
      sleep(1000);
    }
  }
}


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1141 <signal_handler+0x31>
jmp    1132 <signal_handler+0x22>
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    1132 <signal_handler+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
mov    0x2ed0(%rip),%rax
cmp    %edi,(%rax)
jne    112c <signal_handler+0x1c>
nopl   0x0(%rax)
mov    $0x3e8,%edi
call   1030 <sleep@plt>
jmp    1120 <signal_handler+0x10>
pop    %rax
ret

LLVM IR (-O0):
@SIGINT = global i32 0
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %1
br label %7
7: ; preds = %6, %7
%8 = call i32 @sleep(i32 1000)
br label %7
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @signal_handler(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1, %4
%5 = tail call i32 @sleep(i32 1000)
br label %4
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UART_DEB_UartStop();
void UART_DEB_ScbModeStop(void) { UART_DEB_UartStop(); }


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

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

LLVM IR (-O0):
define void @UART_DEB_ScbModeStop() {
%1 = call i32 (...) @UART_DEB_UartStop()
ret void
}

LLVM IR (-O2):
define void @UART_DEB_ScbModeStop() {
%1 = tail call i32 (...) @UART_DEB_UartStop()
ret void
}
/* Type definitions */
struct lat_vec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct lat_vec *);
void lat_vec_free(struct lat_vec *v) { free(v); }


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

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

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

LLVM IR (-O2):
%struct.lat_vec = type { i32 }
define void @lat_vec_free(%struct.lat_vec* nocapture %0) {
%2 = tail call i32 @free(%struct.lat_vec* %0)
ret void
}
int test_imm_2Eint64_lowword_reg(long long val) {
  return ((val) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Eint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x2e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Eint64_lowword_reg>:
test   $0x2e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Eint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 46
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_2Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 46
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int distance = 100;
  printf("You are %i miles away.\n", distance);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"You are %i miles away.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"You are %i miles away.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(char *, int const, int, int /*<<< orphan*/ *);
int _read_be_field(FILE *ptr, char *dest, const int length) {
  if (fread(dest, length, 1, ptr) != 1) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<_read_be_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     114d <_read_be_field+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <_read_be_field+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_read_be_field>:
push   %rax
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    %edx,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_read_be_field(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @fread(i8* %1, i32 %2, i32 1, i32* %0)
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ read_tlb();
int /*<<< orphan*/ write_tlb(int /*<<< orphan*/);
void flush_tlb() { write_tlb(read_tlb()); }


x86 assembly (clang, -O0):
<flush_tlb>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <read_tlb@plt>
mov    %eax,%edi
call   1030 <write_tlb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_tlb>:
push   %rax
xor    %eax,%eax
call   1040 <read_tlb@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <write_tlb@plt>

LLVM IR (-O0):
define void @flush_tlb() {
%1 = call i32 (...) @read_tlb()
%2 = call i32 @write_tlb(i32 %1)
ret void
}

LLVM IR (-O2):
define void @flush_tlb() {
%1 = tail call i32 (...) @read_tlb()
%2 = tail call i32 @write_tlb(i32 %1)
ret void
}
/* Variables and functions */
int FatorialRec(int);
int FatorialR(int n) {
  if (n < 0)
    return 0;
  else if (n == 0 || n == 1)
    return 1;
  else
    return n * FatorialRec(n - 1);
}


x86 assembly (clang, -O0):
<FatorialR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <FatorialR+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116d <FatorialR+0x5d>
cmpl   $0x0,-0x8(%rbp)
je     1145 <FatorialR+0x35>
cmpl   $0x1,-0x8(%rbp)
jne    1151 <FatorialR+0x41>
movl   $0x1,-0x4(%rbp)
jmp    116d <FatorialR+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <FatorialRec@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FatorialR>:
push   %rbx
test   %edi,%edi
js     112e <FatorialR+0x1e>
mov    %edi,%ebx
mov    $0x1,%eax
cmp    $0x2,%edi
jb     112c <FatorialR+0x1c>
lea    -0x1(%rbx),%edi
call   1030 <FatorialRec@plt>
imul   %ebx,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @FatorialR(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = add nsw i32 %0, -1
%7 = tail call i32 @FatorialRec(i32 %6)
%8 = mul nsw i32 %7, %0
br label %9
9: ; preds = %3, %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ], [ 1, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ _event(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  return (_event(argv[0]) == 0) ? 0 : 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_event@plt>
mov    %rax,%rdx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    (%rsi),%rdi
call   1030 <_event@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i64 @_event(i8* %9)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 2
ret i32 %13
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @_event(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 0, i32 2
ret i32 %6
}
int f(int a, int b, int c) {
  a += (short)b * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cwtl
mov    -0x10(%rbp),%ecx
sar    $0x10,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <f+0x36>
movl   $0xa,-0x4(%rbp)
jmp    113c <f+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movswl %si,%ecx
sar    $0x10,%edx
imul   %edx,%ecx
add    %edi,%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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 = load i32, i32* %6
%9 = trunc i32 %8 to i16
%10 = sext i16 %9 to i32
%11 = load i32, i32* %7
%12 = ashr i32 %11, 16
%13 = mul nsw i32 %10, %12
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %3
store i32 10, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %18
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 16
%5 = ashr exact i32 %4, 16
%6 = ashr i32 %2, 16
%7 = mul nsw i32 %5, %6
%8 = add nsw i32 %7, %0
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 10, i32 %8
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ DATA_toolconn();
int /*<<< orphan*/ LibraryHeader(char *, char *);
int /*<<< orphan*/ STARTUP_toolconn();
LIBRARY_toolconn() {
  LibraryHeader("toolconn", "Sat Feb  1 10:41:08 2014 ");
  DATA_toolconn();
  STARTUP_toolconn();
}


x86 assembly (clang, -O0):
<LIBRARY_toolconn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1040 <LibraryHeader@plt>
mov    $0x0,%al
call   1050 <DATA_toolconn@plt>
mov    $0x0,%al
call   1030 <STARTUP_toolconn@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBRARY_toolconn>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <LibraryHeader@plt>
xor    %eax,%eax
call   1050 <DATA_toolconn@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <STARTUP_toolconn@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"toolconn\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:08 2014 \00"
define i32 @LIBRARY_toolconn() {
%1 = alloca i32
%2 = call i32 @LibraryHeader(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @DATA_toolconn()
%4 = call i32 (...) @STARTUP_toolconn()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"toolconn\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:08 2014 \00"
define i32 @LIBRARY_toolconn() {
%1 = tail call i32 @LibraryHeader(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @DATA_toolconn()
%3 = tail call i32 (...) @STARTUP_toolconn()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct xdf_file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *xdf_read_chunk_data(struct xdf_file *, int /*<<< orphan*/);
int dump_text(struct xdf_file *xf, uint64_t size) {
  char *buf;
  buf = xdf_read_chunk_data(xf, size);
  if (buf == NULL)
    return 1;
  printf("%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<dump_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <xdf_read_chunk_data@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1156 <dump_text+0x36>
movl   $0x1,-0x4(%rbp)
jmp    116d <dump_text+0x4d>
mov    -0x20(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_text>:
push   %rax
call   1030 <xdf_read_chunk_data@plt>
test   %rax,%rax
je     113e <dump_text+0x1e>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.xdf_file = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @dump_text(%struct.xdf_file* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.xdf_file*
%5 = alloca i32
%6 = alloca i8*
store %struct.xdf_file* %0, %struct.xdf_file** %4
store i32 %1, i32* %5
%7 = load %struct.xdf_file*, %struct.xdf_file** %4
%8 = load i32, i32* %5
%9 = call i8* @xdf_read_chunk_data(%struct.xdf_file* %7, i32 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %16
13: ; preds = %2
%14 = load i8*, i8** %6
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.xdf_file = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
define i32 @dump_text(%struct.xdf_file* %0, i32 %1) {
%3 = tail call i8* @xdf_read_chunk_data(%struct.xdf_file* %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
float get_float(void) {
  static float num;
  float val = num;
  num++;
  if (num >= 4.0)
    num = 0.0;
  return val;
}


x86 assembly (clang, -O0):
<get_float>:
push   %rbp
mov    %rsp,%rbp
movss  0x2f18(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
addss  0x2f03(%rip),%xmm0
movss  %xmm0,0x2efb(%rip)
movss  0x2ef3(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1152 <get_float+0x52>
xorps  %xmm0,%xmm0
movss  %xmm0,0x2ed2(%rip)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float>:
movss  0x2f1c(%rip),%xmm0
movss  0xef0(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xee8(%rip),%xmm2
cmpnless %xmm1,%xmm2
andps  %xmm1,%xmm2
movss  %xmm2,0x2ef8(%rip)
ret

LLVM IR (-O0):
@get_float.num = internal global float 0.000000e+00
define float @get_float() {
%1 = alloca float
%2 = load float, float* @get_float.num
store float %2, float* %1
%3 = load float, float* @get_float.num
%4 = fadd float %3, 1.000000e+00
store float %4, float* @get_float.num
%5 = load float, float* @get_float.num
%6 = fpext float %5 to double
%7 = fcmp oge double %6, 4.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %0
store float 0.000000e+00, float* @get_float.num
br label %9
9: ; preds = %8, %0
%10 = load float, float* %1
ret float %10
}

LLVM IR (-O2):
@get_float.num = internal unnamed_addr global float 0.000000e+00
define float @get_float() {
%1 = load float, float* @get_float.num
%2 = fadd float %1, 1.000000e+00
%3 = fcmp ult float %2, 4.000000e+00
%4 = select i1 %3, float %2, float 0.000000e+00
store float %4, float* @get_float.num
ret float %1
}
/* Variables and functions */
scalar_t__ _syscall5(int, void *, void *, void *, void *, void *);
int errno;
int fsync(int fd) {
  int ret = (int)_syscall5(34, (void *)fd, ((void *)0), ((void *)0),
                           ((void *)0), ((void *)0));
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<fsync>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rsi
mov    $0x22,%edi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <_syscall5@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115e <fsync+0x4e>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
mov    0x2e90(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1164 <fsync+0x54>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsync>:
push   %rax
movslq %edi,%rsi
mov    $0x22,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <_syscall5@plt>
test   %eax,%eax
js     112e <fsync+0x1e>
pop    %rcx
ret
neg    %eax
mov    0x2ea9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @fsync(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = call i64 @_syscall5(i32 34, i8* %7, i8* null, i8* null, i8* null, i8* null)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i32, i32* %4
%14 = sub nsw i32 0, %13
store i32 %14, i32* @errno
store i32 -1, i32* %2
br label %17
15: ; preds = %1
%16 = load i32, i32* %4
store i32 %16, i32* %2
br label %17
17: ; preds = %15, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @fsync(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i64 @_syscall5(i32 34, i8* %3, i8* null, i8* null, i8* null, i8* null)
%5 = trunc i64 %4 to i32
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = sub nsw i32 0, %5
store i32 %8, i32* @errno
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ -1, %7 ], [ %5, %1 ]
ret i32 %10
}
/* Variables and functions */
char *environ___NativeString_get_environ___impl(char *);
char *core__environ___NativeString___get_environ(char *self) {
  char *var;
  char *var1;
  var1 = environ___NativeString_get_environ___impl(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core__environ___NativeString___get_environ>:
jmp    1030 <environ___NativeString_get_environ___impl@plt>

LLVM IR (-O0):
define i8* @core__environ___NativeString___get_environ(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @environ___NativeString_get_environ___impl(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %3
br label %8
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @core__environ___NativeString___get_environ(i8* %0) {
%2 = tail call i8* @environ___NativeString_get_environ___impl(i8* %0)
ret i8* %2
}
__attribute__((always_)) void clear_all_latency_tracing(struct task_struct *p) {
}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @clear_all_latency_tracing(%struct.task_struct* nocapture %0) {
ret void
}
void d(unsigned long x) {
  if (x < 0)
    return;
  if (x >= 0)
    return;
  if (0 > x)
    return;
  if (0 <= x)
    return;
}


x86 assembly (clang, -O0):
<d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jae    1118 <d+0x18>
jmp    114a <d+0x4a>
cmpq   $0x0,-0x8(%rbp)
jb     1128 <d+0x28>
jmp    114a <d+0x4a>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jbe    1139 <d+0x39>
jmp    114a <d+0x4a>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
ja     114a <d+0x4a>
jmp    114a <d+0x4a>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @d(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %18
6: ; preds = %1
%7 = load i64, i64* %2
%8 = icmp uge i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %18
10: ; preds = %6
%11 = load i64, i64* %2
%12 = icmp ugt i64 0, %11
br i1 %12, label %13, label %14
13: ; preds = %10
br label %18
14: ; preds = %10
%15 = load i64, i64* %2
%16 = icmp ule i64 0, %15
br i1 %16, label %17, label %18
17: ; preds = %14
br label %18
18: ; preds = %5, %9, %13, %17, %14
ret void
}

LLVM IR (-O2):
define void @d(i64 %0) {
ret void
}
long char_putsymp(px, py, sym)
long px, py;
char sym[];
{
  long char_setcursor(), char_putsym();
  if (char_setcursor(px, py) == 0)
    return (0);
  if (char_putsym(sym) == 0)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<char_putsymp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <char_setcursor@plt>
cmp    $0x0,%rax
jne    115a <char_putsymp+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1184 <char_putsymp+0x64>
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <char_putsym@plt>
cmp    $0x0,%rax
jne    117c <char_putsymp+0x5c>
movq   $0x0,-0x8(%rbp)
jmp    1184 <char_putsymp+0x64>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_putsymp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <char_setcursor@plt>
test   %rax,%rax
je     1147 <char_putsymp+0x27>
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <char_putsym@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @char_putsymp(i64 %0, i64 %1, i8* %2) {
%4 = tail call i64 (i64, i64, ...) bitcast (i64 (...)* @char_setcursor to i64 (i64, i64, ...)*)(i64 %0, i64 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 (i8*, ...) bitcast (i64 (...)* @char_putsym to i64 (i8*, ...)*)(i8* %2)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
br label %10
10: ; preds = %6, %3
%11 = phi i64 [ 0, %3 ], [ %9, %6 ]
ret i64 %11
}
int fib(int n) {
  if (n <= 0) {
    return (0);
  } else if (n == 1) {
    return (1);
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116f <fib+0x5f>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116f <fib+0x5f>
jmp    114c <fib+0x3c>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    1140 <fib+0x30>
mov    %edi,%ebx
lea    -0x1(%rbx),%ebp
xor    %r14d,%r14d
test   %ebp,%ebp
je     1145 <fib+0x35>
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%r14d
add    $0xfffffffe,%ebp
cmp    $0x2,%ebx
mov    %ecx,%ebx
ja     1120 <fib+0x10>
xor    %eax,%eax
jmp    114a <fib+0x3a>
xor    %r14d,%r14d
jmp    114d <fib+0x3d>
mov    $0x1,%eax
add    %eax,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp eq i32 %4, 1
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @fib(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
%12 = icmp ult i32 %4, 3
br i1 %12, label %13, label %3
13: ; preds = %3, %7
%14 = phi i32 [ %11, %7 ], [ %5, %3 ]
%15 = phi i32 [ 0, %7 ], [ 1, %3 ]
%16 = add nsw i32 %15, %14
br label %17
17: ; preds = %13, %1
%18 = phi i32 [ %16, %13 ], [ 0, %1 ]
ret i32 %18
}
int test_06(unsigned int a) { return a < 0x80000000; }


x86 assembly (clang, -O0):
<test_06>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80000000,-0x4(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_06>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @test_06(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, -2147483648
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_06(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ foo(int **);
int main() {
  int x;
  int *y = &x;
  foo(&y);
  assert(x == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <foo@plt>
cmpl   $0x3,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1040 <foo@plt>
xor    %edi,%edi
cmpl   $0x3,0xc(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %3
%4 = call i32 @foo(i32** %3)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 3
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32** %2 to i8*
store i32* %1, i32** %2
%5 = call i32 @foo(i32** %2)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 3
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
struct tm *localtime(int /*<<< orphan*/ *);
struct tm *time2tm(time_t unixtime, int localzone) {
  struct tm *tm;
  if (localzone || !(tm = gmtime(&unixtime)))
    tm = localtime(&unixtime);
  return tm;
}


x86 assembly (clang, -O0):
<time2tm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    114f <time2tm+0x2f>
lea    -0x4(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    115c <time2tm+0x3c>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time2tm>:
push   %rax
mov    %edi,0x4(%rsp)
test   %esi,%esi
jne    113a <time2tm+0x1a>
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
test   %rax,%rax
je     113a <time2tm+0x1a>
pop    %rcx
ret
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @time2tm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.tm*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %9, %struct.tm** %5
%10 = icmp ne %struct.tm* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8, %2
%12 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %12, %struct.tm** %5
br label %13
13: ; preds = %11, %8
%14 = load %struct.tm*, %struct.tm** %5
ret %struct.tm* %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @time2tm(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = call %struct.tm* @gmtime(i32* %3)
%7 = icmp eq %struct.tm* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5, %2
%9 = call %struct.tm* @localtime(i32* %3)
br label %10
10: ; preds = %8, %5
%11 = phi %struct.tm* [ %9, %8 ], [ %6, %5 ]
ret %struct.tm* %11
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syspool_dobldobl_size(int *n) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(316, n, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syspool_dobldobl_size>:
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    $0x13c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syspool_dobldobl_size>:
mov    %rdi,%rsi
mov    $0x13c,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syspool_dobldobl_size(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_c2phc4c(i32 316, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @syspool_dobldobl_size(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 316, i32* %0, i32* undef, double* undef, i32 0)
ret i32 %2
}
int test_imm_28uint32_reg(unsigned int val) {
  return ((val) & (0x28 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_28uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x28,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_28uint32_reg>:
test   $0x28,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_28uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 40
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_28uint32_reg(i32 %0) {
%2 = and i32 %0, 40
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int __api(int, unsigned long);
int rt_set_server(unsigned long server_id) {
  return (__api(12, server_id) == 1) ? 0 : 1;
}


x86 assembly (clang, -O0):
<rt_set_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xc,%edi
call   1030 <__api@plt>
mov    %eax,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_set_server>:
push   %rax
mov    %rdi,%rsi
mov    $0xc,%edi
call   1030 <__api@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rt_set_server(i64 %0) {
%2 = tail call i32 @__api(i32 12, i64 %0)
%3 = icmp ne i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ quit(int /*<<< orphan*/);
int quitgame() {
  quit(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @quitgame() {
%1 = call i32 @quit(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @quitgame() {
%1 = tail call i32 @quit(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ funArea();
int /*<<< orphan*/ funTrianlge();
int main() {
  funArea();
  funTrianlge();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @funArea()
%2 = tail call i32 (...) @funTrianlge()
ret i32 0
}
int btrfs_init_test_fs(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @btrfs_init_test_fs() {
ret i32 0
}

LLVM IR (-O2):
define i32 @btrfs_init_test_fs() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int real_main(int, char **, char **);
int wrapper_main(int argc, char **argv, char **envp) {
  int n;
  n = real_main(argc, argv, envp);
  exit(n);
  return 122;
}


x86 assembly (clang, -O0):
<wrapper_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <real_main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wrapper_main>:
push   %rax
call   1030 <real_main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @wrapper_main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i32, i32* %4
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = call i32 @real_main(i32 %8, i8** %9, i8** %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
define i32 @wrapper_main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @real_main(i32 %0, i8** %1, i8** %2)
%5 = tail call i32 @exit(i32 %4)
unreachable
}