xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float result;
  float x = 2.55;
  result = 3 * x * x * x + 5 * x * x + 6;
  printf("result = %f", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee5(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed4(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
movss  0xeb9(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xe9b(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"result = %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 0x4004666660000000, float* %3
%4 = load float, float* %3
%5 = fmul float 3.000000e+00, %4
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = load float, float* %3
%9 = load float, float* %3
%10 = fmul float 5.000000e+00, %9
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = call float @llvm.fmuladd.f32(float %7, float %8, float %12)
%14 = fadd float %13, 6.000000e+00
store float %14, float* %2
%15 = load float, float* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"result = %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), float 0x4056106C80000000)
ret i32 0
}
int test_imm_35uint16_reg(unsigned short val) {
  return ((val) & (0x35 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_35uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x35,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_35uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 53
%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_35uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 53
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void BFLY(int ctrl, int *ip1, int *ip2) {
  if ((ctrl & 0x01) == 1) {
    int temp = *ip1;
    *ip1 = *ip2;
    *ip2 = temp;
  }
  return;
}


x86 assembly (clang, -O0):
<BFLY>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    113c <BFLY+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BFLY>:
test   $0x1,%dil
je     110e <BFLY+0xe>
mov    (%rsi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @BFLY(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %2
store i32 %8, i32* %1
store i32 %7, i32* %2
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
scalar_t__ tanh(double);
float tanhf(float x) { return (float)tanh((double)x); }


x86 assembly (clang, -O0):
<tanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <tanh@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanhf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <tanh@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @tanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @tanh(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @tanhf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @tanh(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ set_key_wait_vtime(int);
void set_key_wait_dos(void) { set_key_wait_vtime(1); }


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

x86 assembly (clang, -O2):
<set_key_wait_dos>:
mov    $0x1,%edi
jmp    1030 <set_key_wait_vtime@plt>

LLVM IR (-O0):
define void @set_key_wait_dos() {
%1 = call i32 @set_key_wait_vtime(i32 1)
ret void
}

LLVM IR (-O2):
define void @set_key_wait_dos() {
%1 = tail call i32 @set_key_wait_vtime(i32 1)
ret void
}
unsigned char waitkey(void) {}


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

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

LLVM IR (-O0):
define zeroext i8 @waitkey() {
%1 = alloca i8
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @waitkey() {
ret i8 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int string_contain(char *, char *);
int main() {
  char str0[] = "this is a test";
  char str1[] = "this";
  printf("%d\n", string_contain(str0, str1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xec9(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xeb4(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0xf(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <string_contain@plt>
mov    %eax,%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x74736574206120,%rax
mov    %rax,0xf(%rsp)
movabs $0x2073692073696874,%rax
69 73 20
mov    %rax,0x8(%rsp)
movb   $0x0,0x4(%rsp)
movl   $0x73696874,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <string_contain@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str0 = [15 x i8] c"this is a test\00"
@__const.main.str1 = [5 x i8] c"this\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [5 x i8]
%3 = bitcast [15 x i8]* %1 to i8*
%4 = bitcast [5 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @string_contain(i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str0 = [15 x i8] c"this is a test\00"
@__const.main.str1 = [5 x i8] c"this\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @string_contain(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int left(int i) { return 2 * i + 1; }


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

x86 assembly (clang, -O2):
<left>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ serial_send(char const);
void serial__puts(const char *s) {
  for (; *s != '\0'; s++)
    serial_send(*s);
}


x86 assembly (clang, -O0):
<serial__puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <serial__puts+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <serial_send@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <serial__puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial__puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <serial__puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <serial_send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <serial__puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial__puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @serial_send(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int t(int a) {
  int r;
  if (a)
    r = t(a - 1);
  else
    return 0;
  if (r)
    r = r;
  return r;
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1138 <t+0x28>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <t@plt>
mov    %eax,-0xc(%rbp)
jmp    1144 <t+0x34>
movl   $0x0,-0x4(%rbp)
jmp    115a <t+0x4a>
cmpl   $0x0,-0xc(%rbp)
je     1154 <t+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @t(i32 %0) {
ret i32 0
}
double rglmut_gv_scale_back_f(const double v) { return (v - 0.5) / 0.00765625; }


x86 assembly (clang, -O0):
<rglmut_gv_scale_back_f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xef2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rglmut_gv_scale_back_f>:
addsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @rglmut_gv_scale_back_f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = fdiv double %4, 7.656250e-03
ret double %5
}

LLVM IR (-O2):
define double @rglmut_gv_scale_back_f(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = fdiv double %2, 7.656250e-03
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chain(int /*<<< orphan*/);
void chain_command(uint16_t index) { chain(index); }


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

x86 assembly (clang, -O2):
<chain_command>:
jmp    1030 <chain@plt>

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

LLVM IR (-O2):
define void @chain_command(i32 %0) {
%2 = tail call i32 @chain(i32 %0)
ret void
}
/* Variables and functions */
#define DirectColor 133
#define GrayScale 132
#define PseudoColor 131
#define StaticColor 130
#define StaticGray 129
#define TrueColor 128
int VisualRank(int class) {
  switch (class) {
  case PseudoColor:
    return 5;
  case DirectColor:
    return 4;
  case TrueColor:
    return 3;
  case StaticColor:
    return 2;
  case GrayScale:
    return 1;
  case StaticGray:
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<VisualRank>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1178 <VisualRank+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x4,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x3,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x2,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x1,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0x0,-0x4(%rbp)
jmp    117f <VisualRank+0x7f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<VisualRank>:
add    $0xffffff80,%edi
mov    $0xffffffff,%eax
cmp    $0x5,%edi
ja     111a <VisualRank+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @VisualRank(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 131, label %5
i32 133, label %6
i32 128, label %7
i32 130, label %8
i32 132, label %9
i32 129, label %10
]
5: ; preds = %1
store i32 5, i32* %2
br label %12
6: ; preds = %1
store i32 4, i32* %2
br label %12
7: ; preds = %1
store i32 3, i32* %2
br label %12
8: ; preds = %1
store i32 2, i32* %2
br label %12
9: ; preds = %1
store i32 1, i32* %2
br label %12
10: ; preds = %1
store i32 0, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.VisualRank = [6 x i32] [i32 3, i32 0, i32 2, i32 5, i32 1, i32 4]
define i32 @VisualRank(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.VisualRank, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void sendToSocket(int new_fd, char *buffer) {
  send(new_fd, buffer, strlen(buffer), 0);
}


x86 assembly (clang, -O0):
<sendToSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendToSocket>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

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

LLVM IR (-O2):
define void @sendToSocket(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @send(i32 %0, i8* %1, i32 %3, i32 0)
ret void
}
void XtWidgetToApplicationContext() {}


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

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

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

LLVM IR (-O2):
define void @XtWidgetToApplicationContext() {
ret void
}
/* Variables and functions */
int f190(int *);
int f191(int *p) { return f190(p); }


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

x86 assembly (clang, -O2):
<f191>:
jmp    1030 <f190@plt>

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

LLVM IR (-O2):
define i32 @f191(i32* %0) {
%2 = tail call i32 @f190(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg(void) { printf("Smile!"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Smile!\00"
define void @msg() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
int fun1375() { return 1375; }


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

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

LLVM IR (-O0):
define i32 @fun1375() {
ret i32 1375
}

LLVM IR (-O2):
define i32 @fun1375() {
ret i32 1375
}
unsigned short int f6(unsigned short int x, long int y) {
  return (x << y) | (x >> (8 * 2 - y));
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f6(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 16, %12
%14 = trunc i64 %13 to i32
%15 = ashr i32 %11, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i16
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @f6(i16 zeroext %0, i64 %1) {
%3 = trunc i64 %1 to i16
%4 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
int fun460() { return 460; }


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

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

LLVM IR (-O0):
define i32 @fun460() {
ret i32 460
}

LLVM IR (-O2):
define i32 @fun460() {
ret i32 460
}
/* Variables and functions */
int /*<<< orphan*/ error(int);
void testclef(int *iclef, int tailleclef) {
  int i;
  for (i = 0; i < tailleclef; ++i) {
    if (iclef[i] < 0) {
      error(2);
    }
  }
}


x86 assembly (clang, -O0):
<testclef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <testclef+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jge    114e <testclef+0x3e>
mov    $0x2,%edi
call   1030 <error@plt>
jmp    1153 <testclef+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <testclef+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testclef>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114c <testclef+0x3c>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <testclef+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     114c <testclef+0x3c>
cmpl   $0x0,(%r14,%rbx,4)
jns    1130 <testclef+0x20>
mov    $0x2,%edi
call   1030 <error@plt>
jmp    1130 <testclef+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @testclef(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ 0, %4 ], [ %14, %13 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 @error(i32 2)
br label %13
13: ; preds = %6, %11
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %13, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage(void) { printf("Run as dfinger [config filename]\n"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Run as dfinger [config filename]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"Run as dfinger [config filename]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
int isnanf(float x) { return __builtin_isnan(x); }


x86 assembly (clang, -O0):
<isnanf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss %xmm0,%xmm0
setp   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnanf>:
xor    %eax,%eax
ucomiss %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @isnanf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp uno float %3, %3
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isnanf(float %0) {
%2 = fcmp uno float %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void gdisp_lld_init_board(void) {}


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

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

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

LLVM IR (-O2):
define void @gdisp_lld_init_board() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("I am learning the %c programming language\n", 'C');
  printf("I have just completed Chapter %d\n", 2);
  printf("I am %.1f percent ready to move on ", 99.9);
  printf("to the next chapter.\a\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
mov    $0x43,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf14(%rip),%rdi
movsd  0xeb7(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
mov    $0x43,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf07(%rip),%rdi
movsd  0xeaa(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"I am learning the %c programming language\0A\00"
@.str.1 = [34 x i8] c"I have just completed Chapter %d\0A\00"
@.str.2 = [36 x i8] c"I am %.1f percent ready to move on \00"
@.str.3 = [23 x i8] c"to the next chapter.\07\0A\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 67)
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double 9.990000e+01)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"I am learning the %c programming language\0A\00"
@.str.1 = [34 x i8] c"I have just completed Chapter %d\0A\00"
@.str.2 = [36 x i8] c"I am %.1f percent ready to move on \00"
@str = [22 x i8] c"to the next chapter.\07\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 67)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 2)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), double 9.990000e+01)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gtk_combo_box_entry_new_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_entry_new_text() {
ret void
}
/* Variables and functions */
int ebbrt_newlib_wait(int *);
int wait(int *status) { return ebbrt_newlib_wait(status); }


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

x86 assembly (clang, -O2):
<wait>:
jmp    1030 <ebbrt_newlib_wait@plt>

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

LLVM IR (-O2):
define i32 @wait(i32* %0) {
%2 = tail call i32 @ebbrt_newlib_wait(i32* %0)
ret i32 %2
}
void mt_dcm_topckg_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @mt_dcm_topckg_enable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPM_WriteString(unsigned char *, long long);
void OPC_SetInclude(char exclude) {
  if (exclude) {
    OPM_WriteString((unsigned char *)" &= ~", (long long)6);
  } else {
    OPM_WriteString((unsigned char *)" |= ", (long long)5);
  }
}


x86 assembly (clang, -O0):
<OPC_SetInclude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     113e <OPC_SetInclude+0x2e>
lea    0xed1(%rip),%rdi
mov    $0x6,%esi
call   1030 <OPM_WriteString@plt>
jmp    114f <OPC_SetInclude+0x3f>
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
call   1030 <OPM_WriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OPC_SetInclude>:
test   %dil,%dil
je     1126 <OPC_SetInclude+0x16>
lea    0xee4(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <OPM_WriteString@plt>
lea    0xed9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <OPM_WriteString@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" &= ~\00"
@.str.1 = [5 x i8] c" |= \00"
define void @OPC_SetInclude(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @OPM_WriteString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
br label %9
7: ; preds = %1
%8 = call i32 @OPM_WriteString(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" &= ~\00"
@.str.1 = [5 x i8] c" |= \00"
define void @OPC_SetInclude(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @OPM_WriteString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 6)
br label %7
5: ; preds = %1
%6 = tail call i32 @OPM_WriteString(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_buffer_notify_set_all();
void config_weechat_notify_change_cb(const void *pointer, void *data,
                                     struct t_config_option *option) {
  (void)pointer;
  (void)data;
  (void)option;
  gui_buffer_notify_set_all();
}


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

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

LLVM IR (-O0):
%struct.t_config_option = type { i32 }
define void @config_weechat_notify_change_cb(i8* %0, i8* %1, %struct.t_config_option* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.t_config_option*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.t_config_option* %2, %struct.t_config_option** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.t_config_option*, %struct.t_config_option** %6
%10 = call i32 (...) @gui_buffer_notify_set_all()
ret void
}

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_weechat_notify_change_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct.t_config_option* nocapture readnone %2) {
%4 = tail call i32 (...) @gui_buffer_notify_set_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ operations(char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc == 1)
    printf("Usage: a b c + * / %%\n");
  else
    operations(argv);
  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)
cmpl   $0x1,-0x8(%rbp)
jne    1151 <main+0x31>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    115a <main+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <operations@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1134 <main+0x14>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
jmp    113c <main+0x1c>
mov    %rsi,%rdi
call   1040 <operations@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Usage: a b c + * / %%\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 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = call i32 @operations(i8** %11)
br label %13
13: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Usage: a b c + * / %%\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 @operations(i8** %1)
br label %8
8: ; preds = %6, %4
ret i32 0
}
int cpuidle_coupled_state_verify(struct cpuidle_driver *drv) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cpuidle_driver = type opaque
define i32 @cpuidle_coupled_state_verify(%struct.cpuidle_driver* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_alignas();
int /*<<< orphan*/ test_alignof();
int /*<<< orphan*/ test_constexpr();
int main() {
  test_alignas();
  test_alignof();
  test_constexpr();
  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_alignas@plt>
mov    $0x0,%al
call   1030 <test_alignof@plt>
mov    $0x0,%al
call   1050 <test_constexpr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_alignas()
%2 = tail call i32 (...) @test_alignof()
%3 = tail call i32 (...) @test_constexpr()
ret i32 0
}
__attribute__((no)) void blah(int *a) { asm("" ::"m"(a) : "memory"); }


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

x86 assembly (clang, -O2):
<blah>:
mov    %rdi,-0x8(%rsp)
ret

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

LLVM IR (-O2):
define void @blah(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret void
}
/* Variables and functions */
int memcmp(char *, char *, int);
int compareChar(void *pn, void *pm) {
  char *n = (char *)pn;
  char *m = (char *)pm;
  return memcmp(n, m, sizeof(char));
}


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

x86 assembly (clang, -O2):
<compareChar>:
mov    $0x1,%edx
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @compareChar(i8* %0, i8* %1) {
%3 = tail call i32 @memcmp(i8* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
long dt_ymd_dst(long, long, long, int);
long dt_ymd(long y, long mo, long d) { return dt_ymd_dst(y, mo, d, -1); }


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

x86 assembly (clang, -O2):
<dt_ymd>:
mov    $0xffffffff,%ecx
jmp    1030 <dt_ymd_dst@plt>

LLVM IR (-O0):
define i64 @dt_ymd(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i64 @dt_ymd_dst(i64 %7, i64 %8, i64 %9, i32 -1)
ret i64 %10
}

LLVM IR (-O2):
define i64 @dt_ymd(i64 %0, i64 %1, i64 %2) {
%4 = tail call i64 @dt_ymd_dst(i64 %0, i64 %1, i64 %2, i32 -1)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void signalHandler(int signum) { printf("Capture signal number:%d\n", signum); }


x86 assembly (clang, -O0):
<signalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalHandler>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Capture signal number:%d\0A\00"
define void @signalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Capture signal number:%d\0A\00"
define void @signalHandler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int CmdTerminate(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @CmdTerminate() {
ret i32 2
}

LLVM IR (-O2):
define i32 @CmdTerminate() {
ret i32 2
}
/* Type definitions */
struct plot_value {
  int dummy;
};
struct plot_env {
  int dummy;
};

/* Variables and functions */
struct plot_value *plot_get_eof_constant();
struct plot_value *plot_func_input_eof_object(struct plot_env *env,
                                              struct plot_value *args) {
  return plot_get_eof_constant();
}


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

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

LLVM IR (-O0):
%struct.plot_env = type { i32 }
%struct.plot_value = type { i32 }
define %struct.plot_value* @plot_func_input_eof_object(%struct.plot_env* %0, %struct.plot_value* %1) {
%3 = alloca %struct.plot_env*
%4 = alloca %struct.plot_value*
store %struct.plot_env* %0, %struct.plot_env** %3
store %struct.plot_value* %1, %struct.plot_value** %4
%5 = call %struct.plot_value* (...) @plot_get_eof_constant()
ret %struct.plot_value* %5
}

LLVM IR (-O2):
%struct.plot_env = type { i32 }
%struct.plot_value = type { i32 }
define %struct.plot_value* @plot_func_input_eof_object(%struct.plot_env* nocapture readnone %0, %struct.plot_value* nocapture readnone %1) {
%3 = tail call %struct.plot_value* (...) @plot_get_eof_constant()
ret %struct.plot_value* %3
}
void gtk_selection_data_targets_include_text() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_targets_include_text() {
ret void
}
void test1_ArrayAssign_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test1_ArrayAssign_targetInit__I() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_ZIGBEE_long(int, int);
void enable_PLL() { write_ZIGBEE_long(0x202, 0x80); }


x86 assembly (clang, -O0):
<enable_PLL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x202,%edi
mov    $0x80,%esi
call   1030 <write_ZIGBEE_long@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_PLL>:
mov    $0x202,%edi
mov    $0x80,%esi
jmp    1030 <write_ZIGBEE_long@plt>

LLVM IR (-O0):
define void @enable_PLL() {
%1 = call i32 @write_ZIGBEE_long(i32 514, i32 128)
ret void
}

LLVM IR (-O2):
define void @enable_PLL() {
%1 = tail call i32 @write_ZIGBEE_long(i32 514, i32 128)
ret void
}
int ntsel_dosel(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ntsel_dosel() {
ret i32 0
}
int main() { return "asdf" == "asdf"; }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *, ...);
void pauseMessage(char *message) {
  if (NULL != message) {
    printf("%s", message);
  } else {
    printf("Presione enter para continuar ...");
  }
  pause();
}


x86 assembly (clang, -O0):
<pauseMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     114f <pauseMessage+0x2f>
mov    -0x8(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115d <pauseMessage+0x3d>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <pause@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pauseMessage>:
push   %rax
test   %rdi,%rdi
je     1139 <pauseMessage+0x19>
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1147 <pauseMessage+0x27>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pause@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [34 x i8] c"Presione enter para continuar ...\00"
define void @pauseMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* null, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = call i32 (...) @pause()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [34 x i8] c"Presione enter para continuar ...\00"
define void @pauseMessage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
%8 = tail call i32 (...) @pause()
ret void
}
/* Variables and functions */
int getNormalizedInput(int);
int GetAxisCurrent(int Axis) {
  return getNormalizedInput(0 + 11 + Axis) + getNormalizedInput(15 + 11 + Axis);
}


x86 assembly (clang, -O0):
<GetAxisCurrent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0xb,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1a,%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetAxisCurrent>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xb(%rbx),%edi
call   1030 <getNormalizedInput@plt>
mov    %eax,%ebp
add    $0x1a,%ebx
mov    %ebx,%edi
call   1030 <getNormalizedInput@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetAxisCurrent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 11, %3
%5 = call i32 @getNormalizedInput(i32 %4)
%6 = load i32, i32* %2
%7 = add nsw i32 26, %6
%8 = call i32 @getNormalizedInput(i32 %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @GetAxisCurrent(i32 %0) {
%2 = add nsw i32 %0, 11
%3 = tail call i32 @getNormalizedInput(i32 %2)
%4 = add nsw i32 %0, 26
%5 = tail call i32 @getNormalizedInput(i32 %4)
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int foo(int x, int y) {
  bar(x);
  return x * y;
}


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

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

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @bar(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = mul nsw i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @bar(i32 %0)
%4 = mul nsw i32 %1, %0
ret i32 %4
}