xunge/DecIR huggingface dataset:
double ceil(d)
double d;
{
  if (d < 0.0)
    return -floor(-d);
  if (modf(d, &d) > 0.0)
    ++d;
  return d;
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    117d <ceil+0x5d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <floor@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b4 <ceil+0x94>
movsd  -0x10(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1030 <modf@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11aa <ceil+0x8a>
movsd  0xe60(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
push   %rax
movsd  %xmm0,(%rsp)
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jbe    1147 <ceil+0x27>
xorpd  0xed8(%rip),%xmm0
call   1040 <floor@plt>
xorpd  0xecb(%rip),%xmm0
pop    %rax
ret
mov    %rsp,%rdi
call   1030 <modf@plt>
ucomisd 0xeb1(%rip),%xmm0
movsd  (%rsp),%xmm0
jbe    116b <ceil+0x4b>
addsd  0xe9a(%rip),%xmm0
movsd  %xmm0,(%rsp)
pop    %rax
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = call double @llvm.floor.f64(double %8)
%10 = fneg double %9
store double %10, double* %2
br label %20
11: ; preds = %1
%12 = load double, double* %3
%13 = call double @modf(double %12, double* %3)
%14 = fcmp ogt double %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load double, double* %3
%17 = fadd double %16, 1.000000e+00
store double %17, double* %3
br label %18
18: ; preds = %15, %11
%19 = load double, double* %3
store double %19, double* %2
br label %20
20: ; preds = %18, %6
%21 = load double, double* %2
ret double %21
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = fcmp olt double %0, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = fneg double %0
%6 = tail call double @llvm.floor.f64(double %5)
%7 = fneg double %6
br label %14
8: ; preds = %1
%9 = call double @modf(double %0, double* %2)
%10 = fcmp ogt double %9, 0.000000e+00
%11 = load double, double* %2
br i1 %10, label %12, label %14
12: ; preds = %8
%13 = fadd double %11, 1.000000e+00
store double %13, double* %2
br label %14
14: ; preds = %8, %12, %4
%15 = phi double [ %7, %4 ], [ %13, %12 ], [ %11, %8 ]
ret double %15
}
__attribute((always_)) float glm_max(float a, float b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<glm_max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112c <glm_max+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <glm_max+0x36>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glm_max>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glm_max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @glm_max(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Type definitions */
struct CLString {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLString_appendString(struct CLString *, struct CLString *);
int /*<<< orphan*/ CLString_init(struct CLString *);
void CLString_initWithString(struct CLString *self,
                             struct CLString *theString) {
  CLString_init(self);
  CLString_appendString(self, theString);
}


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

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

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

LLVM IR (-O2):
%struct.CLString = type { i32 }
define void @CLString_initWithString(%struct.CLString* %0, %struct.CLString* %1) {
%3 = tail call i32 @CLString_init(%struct.CLString* %0)
%4 = tail call i32 @CLString_appendString(%struct.CLString* %0, %struct.CLString* %1)
ret void
}
/* Variables and functions */
int min_swaps_aux(int *, int *, size_t, int /*<<< orphan*/, int /*<<< orphan*/);
int min_swaps(int from[], int to[], size_t sz) {
  return min_swaps_aux(from, to, sz, 0, 0);
}


x86 assembly (clang, -O0):
<min_swaps>:
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
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <min_swaps_aux@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_swaps>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <min_swaps_aux@plt>

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

LLVM IR (-O2):
define i32 @min_swaps(i32* %0, i32* %1, i64 %2) {
%4 = tail call i32 @min_swaps_aux(i32* %0, i32* %1, i64 %2, i32 0, i32 0)
ret i32 %4
}
void rop3_137_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_137_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_137_1_0>:
mov    %esi,%eax
not    %al
and    %al,%dl
mov    (%rdi),%cl
or     %cl,%dl
xor    %sil,%dl
not    %dl
and    %sil,%cl
and    %al,%dl
or     %cl,%dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_137_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %10
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i8, i8* %7
%39 = zext i8 %38 to i32
%40 = load i8, i8* %5
%41 = zext i8 %40 to i32
%42 = xor i32 %41, -1
%43 = and i32 %39, %42
%44 = load i8*, i8** %4
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8, i8* %5
%48 = zext i8 %47 to i32
%49 = and i32 %46, %48
%50 = or i32 %43, %49
%51 = trunc i32 %50 to i8
%52 = load i8*, i8** %4
store i8 %51, i8* %52
ret void
}

LLVM IR (-O2):
define void @rop3_137_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
%10 = and i8 %6, %1
%11 = and i8 %9, %4
%12 = or i8 %11, %10
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse_string(char *);
int main(int argc, char **argv) {
  char str[] = "reverse word in a string";
  puts(str);
  reverse_string(str);
  printf("reversed:\n%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xead(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeab(%rip),%al
mov    %al,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <puts@plt>
lea    -0x30(%rbp),%rdi
call   1030 <reverse_string@plt>
lea    -0x30(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xecd(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <reverse_string@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [25 x i8] c"reverse word in a string\00"
@.str = [14 x i8] c"reversed:\0A%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [25 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [25 x i8]* %6 to i8*
%8 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%9 = call i32 @puts(i8* %8)
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%11 = call i32 @reverse_string(i8* %10)
%12 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [25 x i8] c"reverse word in a string\00"
@.str = [14 x i8] c"reversed:\0A%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [25 x i8]
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%5 = call i32 @puts(i8* %4)
%6 = call i32 @reverse_string(i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int readInt(char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int getAnalog(unsigned char n) {
  char f[51];
  sprintf(f, "/sys/bus/iio/devices/iio:device0/in_voltage%d_raw", n);
  return readInt(f);
}


x86 assembly (clang, -O0):
<getAnalog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec7(%rip),%rsi
movzbl -0x1(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <readInt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAnalog>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%edx
lea    0xed2(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <readInt@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"/sys/bus/iio/devices/iio:device0/in_voltage%d_raw\00"
define i32 @getAnalog(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca [51 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 zeroext %5)
%7 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 0
%8 = call i32 @readInt(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [50 x i8] c"/sys/bus/iio/devices/iio:device0/in_voltage%d_raw\00"
define i32 @getAnalog(i8 zeroext %0) {
%2 = alloca [51 x i8]
%3 = getelementptr inbounds [51 x i8], [51 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%5 = call i32 @readInt(i8* %3)
ret i32 %5
}
__attribute__((no, noclone)) unsigned __int128 t153_3add(signed __int128 y) {
  unsigned __int128 r;
  if (__builtin_add_overflow((signed __int128)(-1), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t153_3add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    %rcx,%r9
sar    $0x3f,%r9
add    $0xffffffffffffffff,%rdx
adc    $0xffffffffffffffff,%rcx
mov    %r9,%r8
adc    $0xffffffffffffffff,%r8
adc    $0xffffffffffffffff,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1187 <t153_3add+0x77>
jmp    118e <t153_3add+0x7e>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t153_3add>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
mov    %rdi,%r14
add    $0xffffffffffffffff,%r14
mov    %rsi,%rbx
adc    $0xffffffffffffffff,%rbx
neg    %rdi
sbb    %rsi,%rax
jl     1133 <t153_3add+0x23>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %r14,%rax
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t153_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = sext i128 %11 to i129
%13 = call { i129, i1 } @llvm.sadd.with.overflow.i129(i129 -1, i129 %12)
%14 = extractvalue { i129, i1 } %13, 1
%15 = extractvalue { i129, i1 } %13, 0
%16 = trunc i129 %15 to i128
%17 = zext i128 %16 to i129
%18 = icmp ne i129 %15, %17
%19 = or i1 %14, %18
store i128 %16, i128* %6
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @bar()
br label %22
22: ; preds = %20, %2
%23 = load i128, i128* %6
store i128 %23, i128* %3
%24 = bitcast i128* %3 to { i64, i64 }*
%25 = load { i64, i64 }, { i64, i64 }* %24
ret { i64, i64 } %25
}

LLVM IR (-O2):
define { i64, i64 } @t153_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = zext i128 %6 to i129
%8 = add nsw i129 %7, -1
%9 = icmp slt i128 %6, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i129 %8 to i64
%14 = lshr i129 %8, 64
%15 = trunc i129 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
int remote_number_to_port(int number) {
  if (number & 1)
    return -1;
  number = (number - 5554) >> 1;
  if ((unsigned)number >= 16)
    return -1;
  return 5554 + number * 2;
}


x86 assembly (clang, -O0):
<remote_number_to_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1122 <remote_number_to_port+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <remote_number_to_port+0x54>
mov    -0x8(%rbp),%eax
sub    $0x15b2,%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jb     1146 <remote_number_to_port+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1154 <remote_number_to_port+0x54>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x15b2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remote_number_to_port>:
lea    -0x15d2(%rdi),%eax
mov    %edi,%ecx
and    $0xfffffffe,%ecx
cmp    $0xffffffe0,%eax
mov    $0xffffffff,%eax
cmovb  %eax,%ecx
test   $0x1,%dil
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @remote_number_to_port(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp ne i32 %2, 0
%4 = add i32 %0, -5586
%5 = icmp ult i32 %4, -32
%6 = or i1 %3, %5
%7 = and i32 %0, -2
%8 = select i1 %6, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handleSigint() { printf("\n Handle sigint"); }


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"\0A Handle sigint\00"
define void @handleSigint() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
void R_Surf8Patch(void) {}


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

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

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

LLVM IR (-O2):
define void @R_Surf8Patch() {
ret void
}
int main(void) {
  char c = 'g';
  !c;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8
store i8 103, i8* %1
%2 = load i8, i8* %1
%3 = icmp ne i8 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int request;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmapping_request(void *_p, int _v) {
  ((XEvent *)_p)->xmapping.request = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmapping_request>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmapping_request(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmapping_request(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int is_valid_grade(int n) { return (0 <= n && n <= 100 ? 1 : 0); }


x86 assembly (clang, -O0):
<is_valid_grade>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1121 <is_valid_grade+0x21>
cmpl   $0x64,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_grade>:
xor    %eax,%eax
cmp    $0x65,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_valid_grade(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_valid_grade(i32 %0) {
%2 = icmp ult i32 %0, 101
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double reb_tools_E_to_f(double, double);
double reb_tools_M_to_E(double, double);
double reb_tools_M_to_f(double e, double M) {
  double E = reb_tools_M_to_E(e, M);
  return reb_tools_E_to_f(e, E);
}


x86 assembly (clang, -O0):
<reb_tools_M_to_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <reb_tools_M_to_E@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1040 <reb_tools_E_to_f@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reb_tools_M_to_f>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <reb_tools_M_to_E@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <reb_tools_E_to_f@plt>

LLVM IR (-O0):
define double @reb_tools_M_to_f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @reb_tools_M_to_E(double %6, double %7)
store double %8, double* %5
%9 = load double, double* %3
%10 = load double, double* %5
%11 = call double @reb_tools_E_to_f(double %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @reb_tools_M_to_f(double %0, double %1) {
%3 = tail call double @reb_tools_M_to_E(double %0, double %1)
%4 = tail call double @reb_tools_E_to_f(double %0, double %3)
ret double %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void smpte_fec_clear_n(uint8_t *p_fec) { p_fec[12] &= ~0x80; }


x86 assembly (clang, -O0):
<smpte_fec_clear_n>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%ecx
and    $0xffffff7f,%ecx
mov    %ecx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_fec_clear_n>:
andb   $0x7f,0x30(%rdi)
ret

LLVM IR (-O0):
define void @smpte_fec_clear_n(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
%6 = and i32 %5, -129
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @smpte_fec_clear_n(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = and i32 %3, -129
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int, int /*<<< orphan*/);
void capture_write_sb(uint16_t port, uint8_t val, void *p) {
  capture_event(p, (2 << 8), 1, port);
}


x86 assembly (clang, -O0):
<capture_write_sb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x200,%esi
mov    $0x1,%edx
call   1030 <capture_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_write_sb>:
mov    %edi,%ecx
mov    %rdx,%rdi
mov    $0x200,%esi
mov    $0x1,%edx
jmp    1030 <capture_event@plt>

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

LLVM IR (-O2):
define void @capture_write_sb(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @capture_event(i8* %2, i32 512, i32 1, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ print(double);
int /*<<< orphan*/ stdout;
int main(void) {
  print(3.3);
  fprintf(stdout, "main:%6.2f\n", 3.3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
call   1030 <print@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
movsd  0xeac(%rip),%xmm0
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1030 <print@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
movsd  0xeba(%rip),%xmm0
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"main:%6.2f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @print(double 3.300000e+00)
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 3.300000e+00)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"main:%6.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @print(double 3.300000e+00)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 3.300000e+00)
ret i32 0
}
int base5() { return 7; }


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

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

LLVM IR (-O0):
define i32 @base5() {
ret i32 7
}

LLVM IR (-O2):
define i32 @base5() {
ret i32 7
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
scalar_t__ ERR;
scalar_t__ beep();
uint8_t ccbi_beep() { return ((beep()) == ERR ? 0 : 1); }


x86 assembly (clang, -O0):
<ccbi_beep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <beep@plt>
mov    %rax,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccbi_beep>:
push   %rax
xor    %eax,%eax
call   1030 <beep@plt>
mov    0x2ec9(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ERR = global i64 0
define i32 @ccbi_beep() {
%1 = call i64 (...) @beep()
%2 = load i64, i64* @ERR
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 0, i32 1
ret i32 %5
}

LLVM IR (-O2):
@ERR = global i64 0
define i32 @ccbi_beep() {
%1 = tail call i64 (...) @beep()
%2 = load i64, i64* @ERR
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M452_f(char *s) {
  debug("M452_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M452_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M452_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M452_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M452_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M452_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M452_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_TIME;

/* Variables and functions */
int X509_cmp_time(int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int X509_cmp_current_time(const ASN1_TIME *ctm) {
  return X509_cmp_time(ctm, NULL);
}


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

x86 assembly (clang, -O2):
<X509_cmp_current_time>:
xor    %esi,%esi
jmp    1030 <X509_cmp_time@plt>

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

LLVM IR (-O2):
define i32 @X509_cmp_current_time(i32* %0) {
%2 = tail call i32 @X509_cmp_time(i32* %0, i32* null)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *program) {
  fprintf(stderr, "usage: %s old_high_dir new_file\n", program);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
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 = [33 x i8] c"usage: %s old_high_dir new_file\0A\00"
define void @usage(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 ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"usage: %s old_high_dir new_file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void f1(
    struct S {
      union U {
        int i;
        char j;
      } i;
    } s_param,
    enum E{A, B, C = 0} e_param) {
  struct S s;
  union U u;
  enum E e;
  e = B;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x1c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type { %union.U }
%union.U = type { i32 }
define void @f1(i32 %0, i32 %1) {
%3 = alloca %struct.S
%4 = alloca i32
%5 = alloca %struct.S
%6 = alloca %union.U
%7 = alloca i32
%8 = getelementptr inbounds %struct.S, %struct.S* %3, i32 0, i32 0
%9 = getelementptr inbounds %union.U, %union.U* %8, i32 0, i32 0
store i32 %0, i32* %9
store i32 %1, i32* %4
store i32 1, i32* %7
ret void
}

LLVM IR (-O2):
define void @f1(i32 %0, i32 %1) {
ret void
}
double builtin_fnma(double b, double c, double d) {
  return -__builtin_fma(b, c, d);
}


x86 assembly (clang, -O0):
<builtin_fnma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <fma@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_fnma>:
push   %rax
call   1030 <fma@plt>
xorps  0xee3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @builtin_fnma(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fma.f64(double %7, double %8, double %9)
%11 = fneg double %10
ret double %11
}

LLVM IR (-O2):
define double @builtin_fnma(double %0, double %1, double %2) {
%4 = tail call double @llvm.fma.f64(double %0, double %1, double %2)
%5 = fneg double %4
ret double %5
}
void blk_finish_plug(struct blk_plug *plug) {}


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

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

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

LLVM IR (-O2):
%struct.blk_plug = type opaque
define void @blk_finish_plug(%struct.blk_plug* nocapture %0) {
ret void
}
int test_imm_B5uint8_reg(unsigned char val) {
  return ((val) & (-0xB5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B5uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -181
%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_B5uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 75
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *xtoa(unsigned long, char *, int, int /*<<< orphan*/);
char *ultoa(unsigned long val, char *buf, int radix) {
  return xtoa(val, buf, radix, 0);
}


x86 assembly (clang, -O0):
<ultoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <xtoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ultoa>:
xor    %ecx,%ecx
jmp    1030 <xtoa@plt>

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

LLVM IR (-O2):
define i8* @ultoa(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @xtoa(i64 %0, i8* %1, i32 %2, i32 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void ASRT_PrintFailChar(int expected, int actual) {
  printf("\n  Expected: '%c', Actual: '%c'", expected, actual);
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"\0A Expected: '%c', Actual: '%c'\00"
define void @ASRT_PrintFailChar(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 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0A Expected: '%c', Actual: '%c'\00"
define void @ASRT_PrintFailChar(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int main(void) { return 1 % 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 poison
}
const char *GetServerOS() { return "l"; }


x86 assembly (clang, -O0):
<GetServerOS>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetServerOS>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [2 x i8] c"l\00"
define i8* @GetServerOS() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [2 x i8] c"l\00"
define i8* @GetServerOS() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
double test4(double x, double y) {
  _Complex c = __builtin_cexp(x);
  x = __builtin_exp(x);
  return x - __real c;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <cexp@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
xorps  %xmm1,%xmm1
call   1030 <cexp@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <exp@plt>
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @test4(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca { double, double }
%6 = alloca { double, double }
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%9 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %7, double* %8
store double 0.000000e+00, double* %9
%10 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
%13 = load double, double* %12
%14 = call { double, double } @cexp(double %11, double %13)
%15 = extractvalue { double, double } %14, 0
%16 = extractvalue { double, double } %14, 1
%17 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%18 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %15, double* %17
store double %16, double* %18
%19 = load double, double* %3
%20 = call double @exp(double %19)
store double %20, double* %3
%21 = load double, double* %3
%22 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%23 = load double, double* %22
%24 = fsub double %21, %23
ret double %24
}

LLVM IR (-O2):
define double @test4(double %0, double %1) {
%3 = tail call { double, double } @cexp(double %0, double 0.000000e+00)
%4 = extractvalue { double, double } %3, 0
%5 = tail call double @exp(double %0)
%6 = fsub double %5, %4
ret double %6
}
int test_imm_72int16_mem(short *val) {
  return ((*val) & (0x72 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_72int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 114
%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_72int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 114
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int shareFunc(void) {
  printf("###INFO: this is shareFunc\r\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<shareFunc>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"###INFO: this is shareFunc\0D\0A\00"
define i32 @shareFunc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"###INFO: this is shareFunc\0D\00"
define i32 @shareFunc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int tableLookupat(unsigned int *table, int index) { return table[index]; }


x86 assembly (clang, -O0):
<tableLookupat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tableLookupat>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tableLookupat(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @tableLookupat(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
int test_imm_CFint16_mem(short *val) {
  return ((*val) & (-0xCF << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_CFint16_mem>:
movzwl (%rdi),%eax
test   $0xff31,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CFint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -207
%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_CFint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -207
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct session {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ suspend_handler(int /*<<< orphan*/);
struct session *do_suspend(struct session *ses, char *arg) {
  suspend_handler(0);
  return ses;
}


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

x86 assembly (clang, -O2):
<do_suspend>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <suspend_handler@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.session = type { i32 }
define %struct.session* @do_suspend(%struct.session* %0, i8* %1) {
%3 = alloca %struct.session*
%4 = alloca i8*
store %struct.session* %0, %struct.session** %3
store i8* %1, i8** %4
%5 = call i32 @suspend_handler(i32 0)
%6 = load %struct.session*, %struct.session** %3
ret %struct.session* %6
}

LLVM IR (-O2):
%struct.session = type { i32 }
define %struct.session* @do_suspend(%struct.session* readnone returned %0, i8* nocapture readnone %1) {
%3 = tail call i32 @suspend_handler(i32 0)
ret %struct.session* %0
}
void ssl_setup() {}


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

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

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

LLVM IR (-O2):
define void @ssl_setup() {
ret void
}
void talk(void) {}


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

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

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

LLVM IR (-O2):
define void @talk() {
ret void
}
/* Variables and functions */
double rand_int64();
double rand0_1() { return 5.42101086242752217E-20 * rand_int64(); }


x86 assembly (clang, -O0):
<rand0_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand_int64@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand0_1>:
push   %rax
xor    %eax,%eax
call   1030 <rand_int64@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rand0_1() {
%1 = call double (...) @rand_int64()
%2 = fmul double 0x3BF0000000000000, %1
ret double %2
}

LLVM IR (-O2):
define double @rand0_1() {
%1 = tail call double (...) @rand_int64()
%2 = fmul double %1, 0x3BF0000000000000
ret double %2
}