xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ YangHuiTriangle(int);
int /*<<< orphan*/ YangHuiTriangle2(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int n;
  printf("How many lines you want to generate :");
  scanf("%d", &n);
  YangHuiTriangle(n);
  YangHuiTriangle2(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1030 <YangHuiTriangle@plt>
mov    -0x4(%rbp),%edi
call   1050 <YangHuiTriangle2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <YangHuiTriangle@plt>
mov    0x4(%rsp),%edi
call   1050 <YangHuiTriangle2@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [38 x i8] c"How many lines you want to generate :\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @YangHuiTriangle(i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @YangHuiTriangle2(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"How many lines you want to generate :\00"
@.str.1 = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @YangHuiTriangle(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 @YangHuiTriangle2(i32 %7)
ret void
}
int bar4() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bar4() {
ret i32 0
}
char xml_decode_us_ascii(unsigned short c) {
  return (char)(c > 0x7f ? '?' : c);
}


x86 assembly (clang, -O0):
<xml_decode_us_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jle    1125 <xml_decode_us_ascii+0x25>
mov    $0x3f,%eax
mov    %eax,-0x8(%rbp)
jmp    112c <xml_decode_us_ascii+0x2c>
movzwl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_decode_us_ascii>:
cmp    $0x7f,%di
mov    $0x3f,%eax
cmovbe %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @xml_decode_us_ascii(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sgt i32 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
br label %10
7: ; preds = %1
%8 = load i16, i16* %2
%9 = zext i16 %8 to i32
br label %10
10: ; preds = %7, %6
%11 = phi i32 [ 63, %6 ], [ %9, %7 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @xml_decode_us_ascii(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 127
%3 = trunc i16 %0 to i8
%4 = select i1 %2, i8 63, i8 %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ FD_CLOEXEC;
int /*<<< orphan*/ F_SETFD;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, int /*<<< orphan*/);
void w_set_cloexec(int fd) { fcntl(fd, F_SETFD, FD_CLOEXEC); }


x86 assembly (clang, -O0):
<w_set_cloexec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<w_set_cloexec>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define void @w_set_cloexec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFD
%5 = load i32, i32* @FD_CLOEXEC
%6 = call i32 @fcntl(i32 %3, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@F_SETFD = global i32 0
@FD_CLOEXEC = global i32 0
define void @w_set_cloexec(i32 %0) {
%2 = load i32, i32* @F_SETFD
%3 = load i32, i32* @FD_CLOEXEC
%4 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ test_concat_strings();
int main() {
  assert(test_concat_strings());
  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_concat_strings@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_concat_strings@plt>
mov    %eax,%edi
call   1030 <assert@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_concat_strings()
%3 = call i32 @assert(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_concat_strings()
%2 = tail call i32 @assert(i32 %1)
ret i32 0
}
/* Variables and functions */
float laDroite(float);
float conversionCTN(int var_temperature) {
  double Rref = 68000.0;
  double V_IN = 3.3;
  float V = (float)var_temperature / 256 * V_IN;
  double Rth = (68000 * V) / (V_IN - V);
  return laDroite(V);
}


x86 assembly (clang, -O0):
<conversionCTN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xec2(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  -0x18(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xea0(%rip),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1030 <laDroite@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conversionCTN>:
cvtsi2ss %edi,%xmm0
mulss  0xee4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xee0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <laDroite@plt>

LLVM IR (-O0):
define float @conversionCTN(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca float
%6 = alloca double
store i32 %0, i32* %2
store double 6.800000e+04, double* %3
store double 3.300000e+00, double* %4
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to float
%9 = fdiv float %8, 2.560000e+02
%10 = fpext float %9 to double
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = fptrunc double %12 to float
store float %13, float* %5
%14 = load float, float* %5
%15 = fmul float 6.800000e+04, %14
%16 = fpext float %15 to double
%17 = load double, double* %4
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = fsub double %17, %19
%21 = fdiv double %16, %20
store double %21, double* %6
%22 = load float, float* %5
%23 = call float @laDroite(float %22)
ret float %23
}

LLVM IR (-O2):
define float @conversionCTN(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = fmul float %2, 3.906250e-03
%4 = fpext float %3 to double
%5 = fmul double %4, 3.300000e+00
%6 = fptrunc double %5 to float
%7 = tail call float @laDroite(float %6)
ret float %7
}
void opencl_union_ndrange_finish(struct opencl_union_ndrange_t *ndrange) {
  opencl_debug("[%s] empty", __FUNCTION__);
}


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

x86 assembly (clang, -O2):
<opencl_union_ndrange_finish>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
jmp    1030 <opencl_debug@plt>

LLVM IR (-O0):
%struct.opencl_union_ndrange_t = type opaque
@.str = [11 x i8] c"[%s] empty\00"
@__FUNCTION__.opencl_union_ndrange_finish = [28 x i8] c"opencl_union_ndrange_finish\00"
define void @opencl_union_ndrange_finish(%struct.opencl_union_ndrange_t* %0) {
%2 = alloca %struct.opencl_union_ndrange_t*
store %struct.opencl_union_ndrange_t* %0, %struct.opencl_union_ndrange_t** %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @opencl_debug to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.opencl_union_ndrange_finish, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.opencl_union_ndrange_t = type opaque
@.str = [11 x i8] c"[%s] empty\00"
@__FUNCTION__.opencl_union_ndrange_finish = [28 x i8] c"opencl_union_ndrange_finish\00"
define void @opencl_union_ndrange_finish(%struct.opencl_union_ndrange_t* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @opencl_debug to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.opencl_union_ndrange_finish, i64 0, i64 0))
ret void
}
int litToVar(int lit) { return lit / 2; }


x86 assembly (clang, -O0):
<litToVar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @litToVar(i32 %0) {
%2 = sdiv i32 %0, 2
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
void skip_word(const char **pp) {
  const char *p = *pp;
  while (*p && !isspace(*p))
    p++;
  *pp = p;
}


x86 assembly (clang, -O0):
<skip_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1153 <skip_word+0x43>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1163 <skip_word+0x53>
jmp    1174 <skip_word+0x64>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <skip_word+0x17>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_word>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    (%rbx),%al
test   %al,%al
je     1138 <skip_word+0x28>
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <skip_word+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_word+0x10>
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @skip_word(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
store i8* %5, i8** %3
br label %6
6: ; preds = %19, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = call i32 @isspace(i8 signext %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br label %17
17: ; preds = %11, %6
%18 = phi i1 [ false, %6 ], [ %16, %11 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
br label %6
22: ; preds = %17
%23 = load i8*, i8** %3
%24 = load i8**, i8*** %2
store i8* %23, i8** %24
ret void
}

LLVM IR (-O2):
define void @skip_word(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %10
%6 = phi i8 [ %12, %10 ], [ %3, %1 ]
%7 = phi i8* [ %11, %10 ], [ %2, %1 ]
%8 = tail call i32 @isspace(i8 signext %6)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %1
%15 = phi i8* [ %2, %1 ], [ %11, %10 ], [ %7, %5 ]
store i8* %15, i8** %0
ret void
}
int test_imm_64uint32_reg(unsigned int val) {
  return ((val) & (0x64 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_64uint32_reg(i32 %0) {
%2 = and i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(void *, char const *);
void store_prop_value(const char *name, const char *value, void *dst) {
  strcpy(dst, value);
}


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

x86 assembly (clang, -O2):
<store_prop_value>:
mov    %rdx,%rdi
jmp    1030 <strcpy@plt>

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

LLVM IR (-O2):
define void @store_prop_value(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i32 @strcpy(i8* %2, i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ ci(int);
unsigned char inbyte() { return (unsigned char)ci(1); }


x86 assembly (clang, -O0):
<inbyte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <ci@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inbyte>:
push   %rax
mov    $0x1,%edi
call   1030 <ci@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @inbyte() {
%1 = call i64 @ci(i32 1)
%2 = trunc i64 %1 to i8
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @inbyte() {
%1 = tail call i64 @ci(i32 1)
%2 = trunc i64 %1 to i8
ret i8 %2
}
/* Variables and functions */
char *abi();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", abi());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <abi@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <abi@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @abi()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
double asin(int);
int sin_al(double);
int sin_to_earth(double);
double sun_dec(double t, double to_earth) {
  return asin(sin_to_earth(to_earth) * sin_al(t));
}


x86 assembly (clang, -O0):
<sun_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sin_to_earth@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin_al@plt>
mov    -0x14(%rbp),%edi
imul   %eax,%edi
call   1040 <asin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sun_dec>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movaps %xmm1,%xmm0
call   1050 <sin_to_earth@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin_al@plt>
imul   %eax,%ebx
mov    %ebx,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <asin@plt>

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

LLVM IR (-O2):
define double @sun_dec(double %0, double %1) {
%3 = tail call i32 @sin_to_earth(double %1)
%4 = tail call i32 @sin_al(double %0)
%5 = mul nsw i32 %4, %3
%6 = tail call double @asin(i32 %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ bad();
int /*<<< orphan*/ good();
main() {
  bad();
  good();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bad()
%2 = tail call i32 (...) @good()
ret i32 0
}
/* Variables and functions */
scalar_t__ isnan(double);
int isinf(double x) { return !isnan(x) && isnan(x - x); }


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1152 <isinf+0x42>
movsd  -0x8(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1127 <isinf+0x17>
pop    %rcx
ret
movsd  (%rsp),%xmm0
subsd  %xmm0,%xmm0
call   1030 <isnan@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @isnan(double %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fsub double %7, %8
%10 = call i64 @isnan(double %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isinf(double %0) {
%2 = tail call i64 @isnan(double %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = fsub double %0, %0
%6 = tail call i64 @isnan(double %5)
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
unsigned int hash_ulong(void const *);
unsigned int hash_short(const void *key) { return hash_ulong(key); }


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

x86 assembly (clang, -O2):
<hash_short>:
jmp    1030 <hash_ulong@plt>

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

LLVM IR (-O2):
define i32 @hash_short(i8* %0) {
%2 = tail call i32 @hash_ulong(i8* %0)
ret i32 %2
}
void ssc_input_add_history(const char *entry) {}


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

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

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

LLVM IR (-O2):
define void @ssc_input_add_history(i8* nocapture %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  short y;
};
typedef TYPE_1__ XRectangle;

/* Variables and functions */
void set_XRectangle_y(void *_p, short _v) { ((XRectangle *)_p)->y = (short)_v; }


x86 assembly (clang, -O0):
<set_XRectangle_y>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XRectangle_y>:
mov    %si,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XRectangle_y(i8* nocapture writeonly %0, i16 signext %1) {
%3 = bitcast i8* %0 to i16*
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int nondet();
void main() {
  int x, y, b;
  b = nondet();
  if (b) {
    x = 10;
    y = 10;
  } else {
    x = 20;
    y = 20;
  }
  assert(x == y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <nondet@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114f <main+0x2f>
movl   $0xa,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
jmp    115d <main+0x3d>
movl   $0x14,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <nondet@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @nondet()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 10, i32* %1
store i32 10, i32* %2
br label %9
8: ; preds = %0
store i32 20, i32* %1
store i32 20, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = icmp eq i32 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
ret void
}

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


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

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

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

LLVM IR (-O2):
define i32 @execute_rt_sigprocmask() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test();
int main(void) { test(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test()
ret i32 0
}
int turn_attr_off(int var, int attr) { return var & (~attr); }


x86 assembly (clang, -O0):
<turn_attr_off>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_attr_off>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @turn_attr_off(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 = xor i32 %6, -1
%8 = and i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @turn_attr_off(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ draw_lines();
int /*<<< orphan*/ draw_string(int /*<<< orphan*/, scalar_t__, char *);
scalar_t__ screen_height();
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ wait_char();
int main() {
  setup_screen();
  draw_lines();
  draw_string(0, screen_height() - 1, "Press any key to finish...");
  wait_char();
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <setup_screen@plt>
mov    $0x0,%al
call   1080 <draw_lines@plt>
mov    $0x0,%al
call   1040 <screen_height@plt>
mov    %rax,%rsi
sub    $0x1,%rsi
xor    %edi,%edi
lea    0xe6c(%rip),%rdx
call   1070 <draw_string@plt>
mov    $0x0,%al
call   1050 <wait_char@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <setup_screen@plt>
xor    %eax,%eax
call   1080 <draw_lines@plt>
xor    %eax,%eax
call   1040 <screen_height@plt>
lea    -0x1(%rax),%rsi
lea    0xe7f(%rip),%rdx
xor    %edi,%edi
call   1070 <draw_string@plt>
xor    %eax,%eax
call   1050 <wait_char@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Press any key to finish...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 (...) @draw_lines()
%4 = call i64 (...) @screen_height()
%5 = sub nsw i64 %4, 1
%6 = call i32 @draw_string(i32 0, i64 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @wait_char()
%8 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Press any key to finish...\00"
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 (...) @draw_lines()
%3 = tail call i64 (...) @screen_height()
%4 = add nsw i64 %3, -1
%5 = tail call i32 @draw_string(i32 0, i64 %4, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @wait_char()
%7 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
void barrier(void) { asm("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
int g(int i, int j) {
  if (i > -1)
    if (i < 2) {
      if (i != j) {
        if (j != 0)
          return 0;
      }
    }
  return 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jle    114f <g+0x4f>
cmpl   $0x2,-0x8(%rbp)
jge    114a <g+0x4a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1145 <g+0x45>
cmpl   $0x0,-0xc(%rbp)
je     1140 <g+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1156 <g+0x56>
jmp    1145 <g+0x45>
jmp    114a <g+0x4a>
jmp    114f <g+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    $0x1,%edi
ja     1110 <g+0x10>
cmp    %esi,%edi
je     1110 <g+0x10>
xor    %eax,%eax
test   %esi,%esi
je     1110 <g+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = icmp ne i32 %0, %1
%6 = icmp ne i32 %1, 0
%7 = and i1 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %4, %2
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 1, %8 ], [ 0, %4 ]
ret i32 %10
}
int test_imm_81int64_highword_reg(long long val) {
  return ((val >> 32) & (0x81 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_81int64_highword_reg(i64 %0) {
%2 = and i64 %0, 554050781184
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double log(int);
double hz2mel(double hz) { return (1127.01048 * log(1. + hz / 700.)); }


x86 assembly (clang, -O0):
<hz2mel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz2mel>:
push   %rax
divsd  0xee7(%rip),%xmm0
addsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
mulsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hz2mel(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 7.000000e+02
%5 = fadd double 1.000000e+00, %4
%6 = fptosi double %5 to i32
%7 = call double @log(i32 %6)
%8 = fmul double 0x40919C0ABB44E50C, %7
ret double %8
}

LLVM IR (-O2):
define double @hz2mel(double %0) {
%2 = fdiv double %0, 7.000000e+02
%3 = fadd double %2, 1.000000e+00
%4 = fptosi double %3 to i32
%5 = tail call double @log(i32 %4)
%6 = fmul double %5, 0x40919C0ABB44E50C
ret double %6
}
/* Type definitions */
struct rq_asset_electricity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_electricity_free(struct rq_asset_electricity *);
void rq_asset_electricity_freefunc(void *asset_data) {
  rq_asset_electricity_free((struct rq_asset_electricity *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_electricity_freefunc>:
jmp    1030 <rq_asset_electricity_free@plt>

LLVM IR (-O0):
%struct.rq_asset_electricity = type { i32 }
define void @rq_asset_electricity_freefunc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.rq_asset_electricity*
%5 = call i32 @rq_asset_electricity_free(%struct.rq_asset_electricity* %4)
ret void
}

LLVM IR (-O2):
%struct.rq_asset_electricity = type { i32 }
define void @rq_asset_electricity_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_electricity*
%3 = tail call i32 @rq_asset_electricity_free(%struct.rq_asset_electricity* %2)
ret void
}
/* Variables and functions */
char *strncpy(char *d, const char *s, size_t n) {
  char *r = d;
  unsigned char c;
  do {
    c = *d = *s;
    d++;
    s++;
    n--;
  } while ((c != 0) & (n));
  return r;
}


x86 assembly (clang, -O0):
<strncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
mov    %al,-0x21(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
movzbl -0x21(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    1118 <strncpy+0x18>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rdx
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl (%rsi,%rcx,1),%edi
mov    %dil,(%rax,%rcx,1)
test   %dil,%dil
setne  %dil
lea    -0x1(%rdx),%r8
add    $0x1,%rcx
test   %dil,%dl
mov    %r8,%rdx
jne    1110 <strncpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strncpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %2, %3 ], [ %11, %4 ]
%6 = phi i8* [ %1, %3 ], [ %10, %4 ]
%7 = phi i8* [ %0, %3 ], [ %9, %4 ]
%8 = load i8, i8* %6
store i8 %8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add i64 %5, -1
%12 = icmp ne i8 %8, 0
%13 = zext i1 %12 to i64
%14 = and i64 %11, %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4
ret i8* %0
}
int test_imm_E2int8_mem(signed char *val) {
  return ((*val) & (-0xE2 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E2int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff1e,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E2int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -226
%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_E2int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -226
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
long collatz(long n) {
  long tmp = n;
  long res = 1;
  while (tmp != 1) {
    if (0 == (tmp % 2)) {
      tmp = tmp / 2;
      res++;
    } else {
      tmp = 1 + (3 * tmp);
      res++;
    };
  };
  return res;
}


x86 assembly (clang, -O0):
<collatz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
je     117d <collatz+0x7d>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
xor    %eax,%eax
cmp    %rdx,%rax
jne    115f <collatz+0x5f>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1178 <collatz+0x78>
imul   $0x3,-0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <collatz+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<collatz>:
mov    $0x1,%eax
cmp    $0x1,%rdi
jne    110c <collatz+0xc>
ret
mov    $0x1,%eax
jmp    1132 <collatz+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rdi,%rdi,2),%rdi
add    $0x1,%rdi
add    $0x1,%rax
cmp    $0x1,%rdi
je     110b <collatz+0xb>
test   $0x1,%dil
jne    1120 <collatz+0x20>
mov    %rdi,%rcx
shr    $0x3f,%rcx
add    %rdi,%rcx
sar    %rcx
mov    %rcx,%rdi
jmp    1128 <collatz+0x28>

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

LLVM IR (-O2):
define i64 @collatz(i64 %0) {
%2 = icmp eq i64 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1, %13
%4 = phi i64 [ %15, %13 ], [ 1, %1 ]
%5 = phi i64 [ %14, %13 ], [ %0, %1 ]
%6 = and i64 %5, 1
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = sdiv i64 %5, 2
br label %13
10: ; preds = %3
%11 = mul nsw i64 %5, 3
%12 = add nsw i64 %11, 1
br label %13
13: ; preds = %10, %8
%14 = phi i64 [ %9, %8 ], [ %12, %10 ]
%15 = add nuw nsw i64 %4, 1
%16 = icmp eq i64 %14, 1
br i1 %16, label %17, label %3
17: ; preds = %13, %1
%18 = phi i64 [ 1, %1 ], [ %15, %13 ]
ret i64 %18
}
void libretro_dummy_retro_reset() {}


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

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

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

LLVM IR (-O2):
define void @libretro_dummy_retro_reset() {
ret void
}
/* Variables and functions */
int xstrtoll_range(char const *, int, int, int);
__attribute__((always_)) int xstrtoi_range(const char *str, int b, int l,
                                           int u) {
  return xstrtoll_range(str, b, l, u);
}


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

x86 assembly (clang, -O2):
<xstrtoi_range>:
jmp    1030 <xstrtoll_range@plt>

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

LLVM IR (-O2):
define i32 @xstrtoi_range(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @xstrtoll_range(i8* %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
void gtk_combo_box_get_active() {}


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_get_active() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ is_hint;
};
typedef TYPE_1__ XPointerMovedEvent;

/* Variables and functions */
char get_XPointerMovedEvent_is_hint(void *_p) {
  return (char)((XPointerMovedEvent *)_p)->is_hint;
}


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

x86 assembly (clang, -O2):
<get_XPointerMovedEvent_is_hint>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define signext i8 @get_XPointerMovedEvent_is_hint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @get_XPointerMovedEvent_is_hint(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_TTOU(int /*<<< orphan*/);
int gen_TTOU() {
  handle_TTOU(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_TTOU() {
%1 = tail call i32 @handle_TTOU(i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ isdigit(int);
long long hatoll(char *s) {
  long long res = 0LL;
  while (isdigit((int)*s))
    res = res * 10 + (*s++ - '0');
  return res;
}


x86 assembly (clang, -O0):
<hatoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1163 <hatoll+0x53>
imul   $0xa,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <hatoll+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hatoll>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1154 <hatoll+0x44>
add    $0x1,%rbx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r14,4),%rax
movsbq -0x1(%rbx),%rcx
lea    (%rcx,%rax,2),%r14
add    $0xffffffffffffffd0,%r14
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1130 <hatoll+0x20>
jmp    1157 <hatoll+0x47>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @hatoll(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i64 @isdigit(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %19, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8* [ %10, %6 ], [ %0, %1 ]
%9 = mul nsw i64 %7, 10
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %8
%12 = sext i8 %11 to i64
%13 = add i64 %9, -48
%14 = add i64 %13, %12
%15 = load i8, i8* %10
%16 = sext i8 %15 to i32
%17 = tail call i64 @isdigit(i32 %16)
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %6
19: ; preds = %6, %1
%20 = phi i64 [ 0, %1 ], [ %14, %6 ]
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ cmus_play_file(char *);
int /*<<< orphan*/ player_play();
void cmd_p_play(char *arg) {
  if (arg) {
    cmus_play_file(arg);
  } else {
    player_play();
  }
}


x86 assembly (clang, -O0):
<cmd_p_play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1145 <cmd_p_play+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <cmus_play_file@plt>
jmp    114c <cmd_p_play+0x2c>
mov    $0x0,%al
call   1040 <player_play@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_p_play>:
test   %rdi,%rdi
je     112a <cmd_p_play+0xa>
jmp    1030 <cmus_play_file@plt>
xor    %eax,%eax
jmp    1040 <player_play@plt>

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

LLVM IR (-O2):
define void @cmd_p_play(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cmus_play_file(i8* %0)
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @player_play()
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memzero(unsigned char **, int);
void pidp_request(const unsigned char *receive, unsigned char *send) {
  memzero(&send, 64);
}


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

x86 assembly (clang, -O2):
<pidp_request>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rdi
mov    $0x40,%esi
call   1030 <memzero@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @pidp_request(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @memzero(i8** %4, i32 64)
ret void
}

LLVM IR (-O2):
define void @pidp_request(i8* nocapture readnone %0, i8* %1) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = call i32 @memzero(i8** %3, i32 64)
ret void
}
/* Variables and functions */
int max(int, int);
int main() {
  int a = max(250, 45);
  return a;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0xfa,%edi
mov    $0x2d,%esi
jmp    1030 <max@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @max(i32 250, i32 45)
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @max(i32 250, i32 45)
ret i32 %1
}