xunge/DecIR huggingface dataset:
/* Variables and functions */
int intel_ich_gpio_set(int, int);
int intel_ich_gpio16_raise(void) { return intel_ich_gpio_set(16, 1); }


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

x86 assembly (clang, -O2):
<intel_ich_gpio16_raise>:
mov    $0x10,%edi
mov    $0x1,%esi
jmp    1030 <intel_ich_gpio_set@plt>

LLVM IR (-O0):
define i32 @intel_ich_gpio16_raise() {
%1 = call i32 @intel_ich_gpio_set(i32 16, i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @intel_ich_gpio16_raise() {
%1 = tail call i32 @intel_ich_gpio_set(i32 16, i32 1)
ret i32 %1
}
void g_param_spec_ref() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_ref() {
ret void
}
char int2char(int x) {
  char c;
  c = (char)('0' + x);
}


x86 assembly (clang, -O0):
<int2char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x9(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @int2char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 48, %5
%7 = trunc i32 %6 to i8
store i8 %7, i8* %4
%8 = load i8, i8* %2
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @int2char(i32 %0) {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *plaint) {
  fprintf(stderr, "%s\n", plaint);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void test5() {
  struct A {
    _Bool b : 1;
  } a;
  a.b = 100;
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%al
and    $0xfe,%al
or     $0x1,%al
mov    %al,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.A = type { i8 }
define void @test5() {
%1 = alloca %struct.A
%2 = bitcast %struct.A* %1 to i8*
%3 = load i8, i8* %2
%4 = and i8 %3, -2
%5 = or i8 %4, 1
store i8 %5, i8* %2
ret void
}

LLVM IR (-O2):
define void @test5() {
ret void
}
int hputr4(hstring, keyword, rval)
char *hstring;
char *keyword;
float rval;
{
  char value[30];
  sprintf(value, "%f", rval);
  return (hputc(hstring, keyword, value));
}


x86 assembly (clang, -O0):
<hputr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
cvtsd2ss %xmm0,%xmm0
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
lea    -0x40(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb3(%rip),%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x40(%rbp),%rdx
mov    $0x0,%al
call   1030 <hputc@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hputr4>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec2(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <hputc@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @hputr4(i8* %0, i8* %1, double %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca [30 x i8]
%8 = fptrunc double %2 to float
store i8* %0, i8** %4
store i8* %1, i8** %5
store float %8, float* %6
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%10 = load float, float* %6
%11 = fpext float %10 to double
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = getelementptr inbounds [30 x i8], [30 x i8]* %7, i64 0, i64 0
%16 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %13, i8* %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @hputr4(i8* %0, i8* %1, double %2) {
%4 = alloca [30 x i8]
%5 = fptrunc double %2 to float
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%7 = fpext float %5 to double
%8 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %7)
%9 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @hputc to i32 (i8*, i8*, i8*, ...)*)(i8* %0, i8* %1, i8* %6)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_dv(double *v) { free((char *)(v + 1)); }


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

x86 assembly (clang, -O2):
<free_dv>:
add    $0x8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dv(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 1
%5 = bitcast double* %4 to i8*
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @free_dv(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = bitcast double* %2 to i8*
%4 = tail call i32 @free(i8* %3)
ret void
}
int test_imm_41uint8_mem(unsigned char *val) {
  return ((*val) & (0x41 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_41uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x41,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_41uint8_mem>:
testb  $0x41,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_41uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 65
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void pm_debug_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pm_debug_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tmpl(char *);
void main() {
  int n;
  int i = 0;
  int k = 0;
  while (i < n) {
    tmpl("(le(i,j,k,n),le(i,j,k,n))");
    i++;
    k++;
  }
  int j = 0;
  while (j < n) {
    tmpl("(le(i,j,k,n),le(i,j,k,n))");
    if (k <= 0)
    ERROR:;
      j = j + 2;
    k--;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1155 <main+0x45>
lea    0xec7(%rip),%rdi
call   1030 <tmpl@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <main+0x16>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119f <main+0x8f>
lea    0xe91(%rip),%rdi
call   1030 <tmpl@plt>
cmpl   $0x0,-0xc(%rbp)
jg     1188 <main+0x78>
jmp    1183 <main+0x73>
jmp    1188 <main+0x78>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <main+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [26 x i8] c"(le(i,j,k,n),le(i,j,k,n))\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %1
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
store i32 0, i32* %4
br label %16
16: ; preds = %26, %15
%17 = load i32, i32* %4
%18 = load i32, i32* %1
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = call i32 @tmpl(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* %3
%23 = icmp sle i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
br label %25
25: ; preds = %24
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 2
store i32 %28, i32* %4
%29 = load i32, i32* %3
%30 = add nsw i32 %29, -1
store i32 %30, i32* %3
br label %16
31: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
int frozen(struct task_struct *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @frozen(%struct.task_struct* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void SetLimits(double limitLower, double limitHigher) {
  limitLower = limitHigher;
  fprintf(stderr, "NexStar does not support software limits.\n");
}


x86 assembly (clang, -O0):
<SetLimits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetLimits>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"NexStar does not support software limits.\0A\00"
define void @SetLimits(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
store double %5, double* %3
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"NexStar does not support software limits.\0A\00"
define void @SetLimits(double %0, double %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
void EC_KEY_set_conv_form(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_set_conv_form() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() { printf("Version: 1.0.0\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"Version: 1.0.0\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
OP(dd, d2) {
  illegal_1();
  op_d2();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_d2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_d2@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_1()
%7 = call i32 (...) @op_d2()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d2()
ret i32 undef
}
int test_imm_03uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x03 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_03uint64_highword_reg>:
movabs $0x300000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_03uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 3
%6 = icmp ne i64 %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_03uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 12884901888
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ readString();
int main(int argc, char **argv) {
  readString();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @readString()
ret i32 0
}
int fcompare(const double *x, const double *y) {
  if (*x == *y)
    return 0;
  return (*x > *y) ? 1 : -1;
}


x86 assembly (clang, -O0):
<fcompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1134 <fcompare+0x34>
jp     1134 <fcompare+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1158 <fcompare+0x58>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
mov    $0xffffffff,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcompare>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
xor    %ecx,%ecx
ucomisd (%rsi),%xmm0
seta   %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fcompare(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = load double*, double** %5
%9 = load double, double* %8
%10 = fcmp oeq double %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %20
12: ; preds = %2
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = load double*, double** %5
%16 = load double, double* %15
%17 = fcmp ogt double %14, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 -1
store i32 %19, i32* %3
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @fcompare(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp oeq double %3, %4
%6 = fcmp ogt double %3, %4
%7 = select i1 %6, i32 1, i32 -1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
int main() {
  int a = 8;
  int b = 13;
  int c;
  if (a < b) {
    c = a;
  } else {
    c = b;
  }
  if (b < c) {
    c = c + b;
  } else {
    c = c + a;
  }
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0xd,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1130 <main+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <main+0x36>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1150 <main+0x50>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <main+0x59>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 16
}
/* Variables and functions */
char *ptbl_get_cp_path_separeter();
char *strrchr(char *, int);
char *ptbl_get_cp_filename_from_path(char *cp_filepath) {
  char *cp_sepa, *cp_tmp, *cp_comm_body;
  cp_comm_body = cp_filepath;
  cp_sepa = ptbl_get_cp_path_separeter();
  cp_tmp = strrchr(cp_filepath, (int)(cp_sepa[0]));
  if (NULL != cp_tmp) {
    cp_comm_body = &cp_tmp[1];
  }
  return cp_comm_body;
}


x86 assembly (clang, -O0):
<ptbl_get_cp_filename_from_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <ptbl_get_cp_path_separeter@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1040 <strrchr@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x18(%rbp),%rax
je     116b <ptbl_get_cp_filename_from_path+0x4b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptbl_get_cp_filename_from_path>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <ptbl_get_cp_path_separeter@plt>
movsbl (%rax),%esi
mov    %rbx,%rdi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ptbl_get_cp_filename_from_path(i8* %0) {
%2 = tail call i8* (...) @ptbl_get_cp_path_separeter()
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 %4)
%6 = icmp eq i8* %5, null
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = select i1 %6, i8* %0, i8* %7
ret i8* %8
}
/* Variables and functions */
int syscall(int, int, int);
int timerfd_create(int clockid, int flags) {
  return syscall(350, clockid, flags);
}


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

x86 assembly (clang, -O2):
<timerfd_create>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x15e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @timerfd_create(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 @syscall(i32 350, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @timerfd_create(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 350, i32 %0, i32 %1)
ret i32 %3
}
__float128 from_sign_long_load(long *a) { return (__float128)*a; }


x86 assembly (clang, -O0):
<from_sign_long_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1120 <__floatditf>
add    $0x10,%rsp
pop    %rbp
ret
xchg   %ax,%ax

x86 assembly (clang, -O2):
<from_sign_long_load>:
push   %rax
mov    (%rdi),%rdi
call   1110 <__floatditf>
pop    %rax
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @from_sign_long_load(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to fp128
ret fp128 %5
}

LLVM IR (-O2):
define fp128 @from_sign_long_load(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = sitofp i64 %2 to fp128
ret fp128 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_daemon();
int /*<<< orphan*/ test_init(int, char **);
int /*<<< orphan*/ test_msg(char *);
int /*<<< orphan*/ test_waitsig();
int main(int argc, char **argv) {
  test_init(argc, argv);
  test_daemon();
  test_waitsig();
  test_msg("PASS\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <test_init@plt>
mov    $0x0,%al
call   1040 <test_daemon@plt>
mov    $0x0,%al
call   1060 <test_waitsig@plt>
lea    0xe89(%rip),%rdi
call   1050 <test_msg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1040 <test_daemon@plt>
xor    %eax,%eax
call   1060 <test_waitsig@plt>
lea    0xea5(%rip),%rdi
call   1050 <test_msg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @test_init(i32 %6, i8** %7)
%9 = call i32 (...) @test_daemon()
%10 = call i32 (...) @test_waitsig()
%11 = call i32 @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"PASS\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @test_init(i32 %0, i8** %1)
%4 = tail call i32 (...) @test_daemon()
%5 = tail call i32 (...) @test_waitsig()
%6 = tail call i32 @test_msg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rand();
int rand89() { return rand() % 890000; }


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

x86 assembly (clang, -O2):
<rand89>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffff96ce7297,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x13,%ecx
add    %edx,%ecx
imul   $0xd9490,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand89() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 890000
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand89() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 890000
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage : servmulti numero_port_serveur\n"); }


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"usage : servmulti numero_port_serveur\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void inversOn(void) { printf("\x01B[7m"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[7m\00"
define void @inversOn() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[7m\00"
define void @inversOn() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdin;
int vfscanf(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vscanf(const char *format, va_list arg) {
  return vfscanf(stdin, format, arg);
}


x86 assembly (clang, -O0):
<vscanf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfscanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vscanf>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ecc(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfscanf@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
define i32 @vscanf(i8* %0, i32 %1) {
%3 = load i32, i32* @stdin
%4 = tail call i32 @vfscanf(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
int quantize5(int pitch) {
  if (pitch < -4)
    return -2;
  if (pitch < -1)
    return -1;
  if (pitch > 4)
    return 2;
  if (pitch > 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<quantize5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xfffffffc,-0x8(%rbp)
jge    111d <quantize5+0x1d>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1166 <quantize5+0x66>
cmpl   $0xffffffff,-0x8(%rbp)
jge    1133 <quantize5+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <quantize5+0x66>
cmpl   $0x4,-0x8(%rbp)
jle    1149 <quantize5+0x49>
movl   $0x2,-0x4(%rbp)
jmp    1166 <quantize5+0x66>
cmpl   $0x1,-0x8(%rbp)
jle    115f <quantize5+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1166 <quantize5+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quantize5>:
mov    $0xfffffffe,%eax
cmp    $0xfffffffc,%edi
jl     1126 <quantize5+0x26>
mov    $0xffffffff,%eax
cmp    $0xffffffff,%edi
jl     1126 <quantize5+0x26>
mov    $0x2,%eax
cmp    $0x4,%edi
jg     1126 <quantize5+0x26>
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
ret

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

LLVM IR (-O2):
define i32 @quantize5(i32 %0) {
%2 = icmp slt i32 %0, -4
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, -1
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 4
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp sgt i32 %0, 1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ -2, %1 ], [ -1, %3 ], [ 2, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool UARTSpaceAvail(uint32_t ui32Base) {
  ;
  return (((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000020)
              ? false
              : true);
}


x86 assembly (clang, -O0):
<UARTSpaceAvail>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%edx
and    $0x20,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSpaceAvail>:
movslq %edi,%rcx
xor    %eax,%eax
testl  $0x20,0x18(%rcx)
sete   %al
ret

LLVM IR (-O0):
define i32 @UARTSpaceAvail(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 24
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, 32
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @UARTSpaceAvail(i32 %0) {
%2 = add nsw i32 %0, 24
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 5
%7 = and i32 %6, 1
%8 = xor i32 %7, 1
ret i32 %8
}
/* Type definitions */
typedef char *uint32_t;

/* Variables and functions */
uint32_t launder32(uint32_t val) {
  __asm__("" : "+r"(val));
  return val;
}


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

x86 assembly (clang, -O2):
<launder32>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @launder32(i8* readnone %0) {
%2 = tail call i8* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
int test_imm_38uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x38 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_38uint64_midword_reg>:
test   $0x380000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_38uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 56
%6 = icmp ne i64 %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_38uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3670016
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef scalar_t__ mp_bitcnt_t;

/* Variables and functions */
int /*<<< orphan*/ gen_random(int /*<<< orphan*/, scalar_t__);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_nextprime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_setbit(int /*<<< orphan*/, scalar_t__);
int gen_prime(mpz_t prime, mp_bitcnt_t len) {
  mpz_t rnd;
  mpz_init(rnd);
  gen_random(rnd, len);
  mpz_setbit(rnd, len - 1);
  mpz_nextprime(prime, rnd);
  mpz_clear(rnd);
  return 0;
}


x86 assembly (clang, -O0):
<gen_prime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <gen_random@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
sub    $0x1,%rsi
call   1030 <mpz_setbit@plt>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1050 <mpz_nextprime@plt>
mov    -0x14(%rbp),%edi
call   1070 <mpz_clear@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_prime>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <mpz_init@plt>
mov    %rbx,%rsi
call   1060 <gen_random@plt>
add    $0xffffffffffffffff,%rbx
mov    %rbx,%rsi
call   1030 <mpz_setbit@plt>
mov    %ebp,%edi
call   1050 <mpz_nextprime@plt>
call   1070 <mpz_clear@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gen_prime(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %5
%7 = call i32 @mpz_init(i32 %6)
%8 = load i32, i32* %5
%9 = load i64, i64* %4
%10 = call i32 @gen_random(i32 %8, i64 %9)
%11 = load i32, i32* %5
%12 = load i64, i64* %4
%13 = sub nsw i64 %12, 1
%14 = call i32 @mpz_setbit(i32 %11, i64 %13)
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = call i32 @mpz_nextprime(i32 %15, i32 %16)
%18 = load i32, i32* %5
%19 = call i32 @mpz_clear(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_prime(i32 %0, i64 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @gen_random(i32 undef, i64 %1)
%5 = add nsw i64 %1, -1
%6 = tail call i32 @mpz_setbit(i32 undef, i64 %5)
%7 = tail call i32 @mpz_nextprime(i32 %0, i32 undef)
%8 = tail call i32 @mpz_clear(i32 undef)
ret i32 0
}
void batadv_mcast_purge_orig(struct batadv_orig_node *orig_node) {}


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

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

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

LLVM IR (-O2):
%struct.batadv_orig_node = type opaque
define void @batadv_mcast_purge_orig(%struct.batadv_orig_node* nocapture %0) {
ret void
}
int main() {
  volatile unsigned char array[16 * 1024 + 1];
  array[0] = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f90,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x4010(%rbp)
xor    %eax,%eax
add    $0x3f90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movb   $0x0,-0x8(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16385 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [16385 x i8], [16385 x i8]* %2, i64 0, i64 0
store volatile i8 0, i8* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store volatile i8 0, i8* %1
ret i32 0
}
/* Type definitions */
struct dlist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dlist_push_back(struct dlist_head *, struct dlist_head *);
int /*<<< orphan*/ sys_dlist_del_node(struct dlist_head *);
void dlist_move_to_back(struct dlist_head *node, struct dlist_head *head) {
  sys_dlist_del_node(node);
  dlist_push_back(node, head);
}


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

x86 assembly (clang, -O2):
<dlist_move_to_back>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <sys_dlist_del_node@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dlist_push_back@plt>

LLVM IR (-O0):
%struct.dlist_head = type { i32 }
define void @dlist_move_to_back(%struct.dlist_head* %0, %struct.dlist_head* %1) {
%3 = alloca %struct.dlist_head*
%4 = alloca %struct.dlist_head*
store %struct.dlist_head* %0, %struct.dlist_head** %3
store %struct.dlist_head* %1, %struct.dlist_head** %4
%5 = load %struct.dlist_head*, %struct.dlist_head** %3
%6 = call i32 @sys_dlist_del_node(%struct.dlist_head* %5)
%7 = load %struct.dlist_head*, %struct.dlist_head** %3
%8 = load %struct.dlist_head*, %struct.dlist_head** %4
%9 = call i32 @dlist_push_back(%struct.dlist_head* %7, %struct.dlist_head* %8)
ret void
}

LLVM IR (-O2):
%struct.dlist_head = type { i32 }
define void @dlist_move_to_back(%struct.dlist_head* %0, %struct.dlist_head* %1) {
%3 = tail call i32 @sys_dlist_del_node(%struct.dlist_head* %0)
%4 = tail call i32 @dlist_push_back(%struct.dlist_head* %0, %struct.dlist_head* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ test_ipvlan();
scalar_t__ test_veth();
int main() {
  if (test_ipvlan())
    return -1;
  if (test_veth())
    return -1;
  printf("test pass\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_ipvlan@plt>
cmp    $0x0,%rax
je     115c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <main+0x5c>
mov    $0x0,%al
call   1050 <test_veth@plt>
cmp    $0x0,%rax
je     1179 <main+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    118c <main+0x5c>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <test_ipvlan@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jne    115c <main+0x2c>
xor    %eax,%eax
call   1050 <test_veth@plt>
test   %rax,%rax
jne    115c <main+0x2c>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"test pass\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_ipvlan()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %11
5: ; preds = %0
%6 = call i64 (...) @test_veth()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 -1, i32* %1
br label %11
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %11
11: ; preds = %9, %8, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@str = [10 x i8] c"test pass\00"
define i32 @main() {
%1 = tail call i64 (...) @test_ipvlan()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i64 (...) @test_veth()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32 [ 0, %6 ], [ -1, %0 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int x = 7, y = 7;
  if ((x > y) && (x != y))
    printf("\n%d is greater than %d AND they are not equal.", x, y);
  if ((x > y) || (x != y))
    printf("\n%d is greater than %d OR they are not equal.", x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1150 <main+0x40>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1150 <main+0x40>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1168 <main+0x58>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     117a <main+0x6a>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"\0A%d is greater than %d AND they are not equal.\00"
@.str.1 = [46 x i8] c"\0A%d is greater than %d OR they are not equal.\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 7, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
br label %14
14: ; preds = %10, %6, %0
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = icmp sgt i32 %15, %16
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i32, i32* %1
%20 = load i32, i32* %2
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %18, %14
%23 = load i32, i32* %1
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %24)
br label %26
26: ; preds = %22, %18
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
long long unsigned ticks_to_microseconds(const long long unsigned ticks) {
  return ticks / (1900000000ULL / 1000000ULL);
}


x86 assembly (clang, -O0):
<ticks_to_microseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x76c,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ticks_to_microseconds>:
mov    %rdi,%rax
shr    $0x2,%rax
movabs $0x44fc3a34d11c9071,%rcx
3a fc 44
mul    %rcx
mov    %rdx,%rax
shr    $0x7,%rax
ret

LLVM IR (-O0):
define i64 @ticks_to_microseconds(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 1900
ret i64 %4
}

LLVM IR (-O2):
define i64 @ticks_to_microseconds(i64 %0) {
%2 = udiv i64 %0, 1900
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int main() {
  func(10);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 10)
ret i32 0
}
int prog_stop(int a) { return a + 0; }


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

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

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

LLVM IR (-O2):
define i32 @prog_stop(i32 returned %0) {
ret i32 %0
}
int array_length(const void **array) {
  int result = 0;
  while (*array) {
    array++;
    result++;
  }
  return result;
}


x86 assembly (clang, -O0):
<array_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1137 <array_length+0x37>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <array_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_length>:
cmpq   $0x0,(%rdi)
je     111d <array_length+0x1d>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <array_length+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @array_length(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8** [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8*, i8** %7
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ _panic(char *);
void sys_vm86(void) { _panic("sys_vm86"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"sys_vm86\00"
define void @sys_vm86() {
%1 = call i32 @_panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"sys_vm86\00"
define void @sys_vm86() {
%1 = tail call i32 @_panic(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}