xunge/DecIR huggingface dataset:
int test_csinv32_condasn2(int w0, int w1, int w2, int w3) {
  int w4;
  w4 = (w0 == w1) ? w3 : ~w2;
  return w4;
}


x86 assembly (clang, -O0):
<test_csinv32_condasn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1127 <test_csinv32_condasn2+0x27>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1130 <test_csinv32_condasn2+0x30>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_csinv32_condasn2>:
mov    %edx,%eax
cmp    %esi,%edi
not    %eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_csinv32_condasn2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, %1
%6 = xor i32 %2, -1
%7 = select i1 %5, i32 %3, i32 %6
ret i32 %7
}
/* Variables and functions */
int ft_iterative_factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int result;
  result = ft_iterative_factorial(2);
  printf("Factorial is: %d \n", result);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"Factorial is: %d \0A\00"
define i32 @main() {
%1 = tail call i32 @ft_iterative_factorial(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int link(const char *existing, const char *new) {
  return syscall(9, existing, new);
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x9,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x9,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @link(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 9, i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int __builtin_ldsex(unsigned char *);
int test_ldsex(unsigned char *p1, unsigned char *p2) {
  int a, b, c, d;
  a = __builtin_ldsex(p1);
  b = __builtin_ldsex(p2);
  c = __builtin_ldsex(p2 + 1);
  d = __builtin_ldsex(p2 + 2);
  return a + b + c + d;
}


x86 assembly (clang, -O0):
<test_ldsex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__builtin_ldsex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__builtin_ldsex@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1030 <__builtin_ldsex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1030 <__builtin_ldsex@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ldsex>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <__builtin_ldsex@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <__builtin_ldsex@plt>
mov    %eax,%ebp
lea    0x1(%rbx),%rdi
call   1030 <__builtin_ldsex@plt>
mov    %eax,%r15d
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <__builtin_ldsex@plt>
add    %r14d,%ebp
add    %r15d,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @test_ldsex(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @__builtin_ldsex(i8* %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %4
%12 = call i32 @__builtin_ldsex(i8* %11)
store i32 %12, i32* %6
%13 = load i8*, i8** %4
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = call i32 @__builtin_ldsex(i8* %14)
store i32 %15, i32* %7
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = call i32 @__builtin_ldsex(i8* %17)
store i32 %18, i32* %8
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_ldsex(i8* %0, i8* %1) {
%3 = tail call i32 @__builtin_ldsex(i8* %0)
%4 = tail call i32 @__builtin_ldsex(i8* %1)
%5 = getelementptr inbounds i8, i8* %1, i64 1
%6 = tail call i32 @__builtin_ldsex(i8* %5)
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = tail call i32 @__builtin_ldsex(i8* %7)
%9 = add nsw i32 %4, %3
%10 = add nsw i32 %9, %6
%11 = add nsw i32 %10, %8
ret i32 %11
}
int biVoid(char *name, char **args, char **environ) { return 1; }


x86 assembly (clang, -O0):
<biVoid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @biVoid(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
ret i32 1
}

LLVM IR (-O2):
define i32 @biVoid(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
ret i32 1
}
int ntlibc_isalpha(int c) {
  if (('A' <= c) && (c <= 'Z')) {
    return 1;
  }
  if (('a' <= c) && (c <= 'z')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ntlibc_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x41,%eax
cmp    -0x8(%rbp),%eax
jg     112b <ntlibc_isalpha+0x2b>
cmpl   $0x5a,-0x8(%rbp)
jg     112b <ntlibc_isalpha+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ntlibc_isalpha+0x56>
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     114f <ntlibc_isalpha+0x4f>
cmpl   $0x7a,-0x8(%rbp)
jg     114f <ntlibc_isalpha+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <ntlibc_isalpha+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlibc_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ntlibc_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
double Newton_s_apple() {
  double g = -10.0;
  double speed_z = 0;
  double altitude = 3000;
  double delta_t = 0.1;
  double total_time = 0;
  while (altitude > 0.0) {
    speed_z += g * delta_t;
    altitude += speed_z * delta_t;
    total_time += delta_t;
  }
  return total_time;
}


x86 assembly (clang, -O0):
<Newton_s_apple>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf04(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee7(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1199 <Newton_s_apple+0x99>
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    113b <Newton_s_apple+0x3b>
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Newton_s_apple>:
xorpd  %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
movapd 0xefc(%rip),%xmm2
movsd  0xeec(%rip),%xmm3
xorpd  %xmm4,%xmm4
addpd  %xmm2,%xmm0
movapd %xmm0,%xmm5
unpckhpd %xmm0,%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm5,%xmm1
ucomisd %xmm4,%xmm1
ja     1120 <Newton_s_apple+0x20>
ret

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

LLVM IR (-O2):
define double @Newton_s_apple() {
br label %1
1: ; preds = %0, %1
%2 = phi double [ 3.000000e+03, %0 ], [ %6, %1 ]
%3 = phi <2 x double> [ zeroinitializer, %0 ], [ %4, %1 ]
%4 = fadd <2 x double> %3, <double 1.000000e-01, double -1.000000e+00>
%5 = extractelement <2 x double> %4, i64 1
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e-01, double %2)
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %1, label %8
8: ; preds = %1
%9 = extractelement <2 x double> %4, i64 0
ret double %9
}
unsigned int factorial1(int n) {
  printf("%s(%d)\n", __func__, n);
  if (n <= 1)
    return n;
  return (unsigned int)(n * factorial1(n - 1));
}


x86 assembly (clang, -O0):
<factorial1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xecc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jg     1158 <factorial1+0x38>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <factorial1+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <factorial1@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial1>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%ebx
lea    0xedf(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebp
cmp    $0x2,%ebx
jl     1174 <factorial1+0x64>
lea    0xebe(%rip),%r14
lea    0xebf(%rip),%r15
mov    $0x1,%ebp
xchg   %ax,%ax
lea    -0x1(%rbx),%r12d
imul   %ebx,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2,%ebx
mov    %r12d,%ebx
ja     1150 <factorial1+0x40>
mov    $0x1,%ebx
imul   %ebx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s(%d)\0A\00"
@__func__.factorial1 = [11 x i8] c"factorial1\00"
define i32 @factorial1(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.factorial1, i64 0, i64 0), i32 %0)
%3 = icmp slt i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = add nsw i32 %5, -1
%8 = mul i32 %5, %6
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.factorial1, i64 0, i64 0), i32 %7)
%10 = icmp ult i32 %5, 3
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
%13 = phi i32 [ %0, %1 ], [ 1, %4 ]
%14 = mul i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, const char *argv[]) {
  int i, j;
  scanf("%i %i", &i, &j);
  printf("%i", i * j / gcd(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1050 <gcd@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    %esi,%ebx
imul   %edi,%ebx
call   1050 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
lea    0xe98(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = call i32 @gcd(i32 %12, i32 %13)
%15 = sdiv i32 %11, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i %i\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, %8
%11 = call i32 @gcd(i32 %8, i32 %9)
%12 = sdiv i32 %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void disp_move_cursor_xy(int row, int col) { printf("\e[%d;%dH", row, col); }


x86 assembly (clang, -O0):
<disp_move_cursor_xy>:
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):
<disp_move_cursor_xy>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @disp_move_cursor_xy(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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define void @disp_move_cursor_xy(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
int test_imm_66int8_mem(signed char *val) {
  return ((*val) & (0x66 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_66int8_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, 102
%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_66int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 102
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ max_setup();
int /*<<< orphan*/ min_setup();
int /*<<< orphan*/ minus_setup();
int /*<<< orphan*/ over_setup();
int /*<<< orphan*/ plus_setup();
int /*<<< orphan*/ times_setup();
void d_arithmetic_setup(void) {
  plus_setup();
  minus_setup();
  times_setup();
  over_setup();
  max_setup();
  min_setup();
}


x86 assembly (clang, -O0):
<d_arithmetic_setup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <plus_setup@plt>
mov    $0x0,%al
call   1070 <minus_setup@plt>
mov    $0x0,%al
call   1030 <times_setup@plt>
mov    $0x0,%al
call   1060 <over_setup@plt>
mov    $0x0,%al
call   1040 <max_setup@plt>
mov    $0x0,%al
call   1050 <min_setup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_arithmetic_setup>:
push   %rax
xor    %eax,%eax
call   1080 <plus_setup@plt>
xor    %eax,%eax
call   1070 <minus_setup@plt>
xor    %eax,%eax
call   1030 <times_setup@plt>
xor    %eax,%eax
call   1060 <over_setup@plt>
xor    %eax,%eax
call   1040 <max_setup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <min_setup@plt>

LLVM IR (-O0):
define void @d_arithmetic_setup() {
%1 = call i32 (...) @plus_setup()
%2 = call i32 (...) @minus_setup()
%3 = call i32 (...) @times_setup()
%4 = call i32 (...) @over_setup()
%5 = call i32 (...) @max_setup()
%6 = call i32 (...) @min_setup()
ret void
}

LLVM IR (-O2):
define void @d_arithmetic_setup() {
%1 = tail call i32 (...) @plus_setup()
%2 = tail call i32 (...) @minus_setup()
%3 = tail call i32 (...) @times_setup()
%4 = tail call i32 (...) @over_setup()
%5 = tail call i32 (...) @max_setup()
%6 = tail call i32 (...) @min_setup()
ret void
}
/* Variables and functions */
char tolower(char);
char toupper(char);
void formatName(char *string) {
  char *temp = string;
  while (*temp != '\0') {
    *temp = tolower(*temp);
    temp++;
  }
  *string = toupper(*string);
}


x86 assembly (clang, -O0):
<formatName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1169 <formatName+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <formatName+0x14>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<formatName>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     115b <formatName+0x3b>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1040 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <formatName+0x20>
mov    (%r14),%al
jmp    115d <formatName+0x3d>
xor    %eax,%eax
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @formatName(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = load i8, i8* %0
br label %13
13: ; preds = %11, %1
%14 = phi i8 [ %12, %11 ], [ 0, %1 ]
%15 = tail call signext i8 @toupper(i8 signext %14)
store i8 %15, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, msg);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ oom();
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *cpy = strdup(s);
  if (!cpy)
    oom();
  return cpy;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <xstrdup+0x2b>
mov    $0x0,%al
call   1030 <oom@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xstrdup+0x15>
xor    %eax,%eax
call   1030 <oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @oom()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int syscall(int, int);
int sched_get_priority_max(int policy) { return syscall(159, policy); }


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

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

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

LLVM IR (-O2):
define i32 @sched_get_priority_max(i32 %0) {
%2 = tail call i32 @syscall(i32 159, i32 %0)
ret i32 %2
}
int test_imm_6Aint32_reg(int val) { return ((val) & (0x6A << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_6Aint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 106
%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_6Aint32_reg(i32 %0) {
%2 = and i32 %0, 106
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ I2S0_Rx_DriverIRQHandler();
__attribute__((weak)) void I2S0_Rx_IRQHandler(void) {
  I2S0_Rx_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @I2S0_Rx_IRQHandler() {
%1 = call i32 (...) @I2S0_Rx_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @I2S0_Rx_IRQHandler() {
%1 = tail call i32 (...) @I2S0_Rx_DriverIRQHandler()
ret void
}
/* Type definitions */
struct co_list_hdr {
  int dummy;
};
struct co_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ co_list_push_back(struct co_list *const,
                                     struct co_list_hdr *const);
void ke_queue_push(struct co_list *const queue,
                   struct co_list_hdr *const element) {
  co_list_push_back(queue, element);
}


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

x86 assembly (clang, -O2):
<ke_queue_push>:
jmp    1030 <co_list_push_back@plt>

LLVM IR (-O0):
%struct.co_list = type { i32 }
%struct.co_list_hdr = type { i32 }
define void @ke_queue_push(%struct.co_list* %0, %struct.co_list_hdr* %1) {
%3 = alloca %struct.co_list*
%4 = alloca %struct.co_list_hdr*
store %struct.co_list* %0, %struct.co_list** %3
store %struct.co_list_hdr* %1, %struct.co_list_hdr** %4
%5 = load %struct.co_list*, %struct.co_list** %3
%6 = load %struct.co_list_hdr*, %struct.co_list_hdr** %4
%7 = call i32 @co_list_push_back(%struct.co_list* %5, %struct.co_list_hdr* %6)
ret void
}

LLVM IR (-O2):
%struct.co_list = type { i32 }
%struct.co_list_hdr = type { i32 }
define void @ke_queue_push(%struct.co_list* %0, %struct.co_list_hdr* %1) {
%3 = tail call i32 @co_list_push_back(%struct.co_list* %0, %struct.co_list_hdr* %1)
ret void
}
void ade7758_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @ade7758_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int fastrand();
void *malloc(size_t);
void *hb_malloc_impl(size_t size) {
  return (fastrand() % 16) ? malloc(size) : NULL;
}


x86 assembly (clang, -O0):
<hb_malloc_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <fastrand@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1156 <hb_malloc_impl+0x36>
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
jmp    1161 <hb_malloc_impl+0x41>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1161 <hb_malloc_impl+0x41>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hb_malloc_impl>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fastrand@plt>
test   $0xf,%al
je     1138 <hb_malloc_impl+0x18>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <malloc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hb_malloc_impl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @fastrand()
%4 = srem i32 %3, 16
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i8* @malloc(i64 %7)
br label %10
9: ; preds = %1
br label %10
10: ; preds = %9, %6
%11 = phi i8* [ %8, %6 ], [ null, %9 ]
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @hb_malloc_impl(i64 %0) {
%2 = tail call i32 (...) @fastrand()
%3 = and i32 %2, 15
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i8* @malloc(i64 %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
int bsp_sec_check(void *image_addr, unsigned int image_length) { return 0; }


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

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

LLVM IR (-O0):
define i32 @bsp_sec_check(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @bsp_sec_check(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct rudp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert_message(struct rudp *, int, int /*<<< orphan*/ *,
                                  int);
void add_missing(struct rudp *U, int id) { insert_message(U, id, NULL, -1); }


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

x86 assembly (clang, -O2):
<add_missing>:
xor    %edx,%edx
mov    $0xffffffff,%ecx
jmp    1030 <insert_message@plt>

LLVM IR (-O0):
%struct.rudp = type { i32 }
define void @add_missing(%struct.rudp* %0, i32 %1) {
%3 = alloca %struct.rudp*
%4 = alloca i32
store %struct.rudp* %0, %struct.rudp** %3
store i32 %1, i32* %4
%5 = load %struct.rudp*, %struct.rudp** %3
%6 = load i32, i32* %4
%7 = call i32 @insert_message(%struct.rudp* %5, i32 %6, i32* null, i32 -1)
ret void
}

LLVM IR (-O2):
%struct.rudp = type { i32 }
define void @add_missing(%struct.rudp* %0, i32 %1) {
%3 = tail call i32 @insert_message(%struct.rudp* %0, i32 %1, i32* null, i32 -1)
ret void
}
int test_imm_21int16_reg(short val) {
  return ((val) & (-0x21 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_21int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -33
%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_21int16_reg(i16 signext %0) {
%2 = and i16 %0, -33
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void c_set_unity(char *v1, char *v2, void *t) {
  if (t)
    *(int *)t = 1;
}


x86 assembly (clang, -O0):
<c_set_unity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1125 <c_set_unity+0x25>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_set_unity>:
test   %rdx,%rdx
je     110b <c_set_unity+0xb>
movl   $0x1,(%rdx)
ret

LLVM IR (-O0):
define void @c_set_unity(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 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
store i32 1, i32* %11
br label %12
12: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @c_set_unity(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* writeonly %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = bitcast i8* %2 to i32*
store i32 1, i32* %6
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
double atan(double);
float pi() { return atan(1.0) * 4.0; }


x86 assembly (clang, -O0):
<pi>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeec(%rip),%xmm0
call   1030 <atan@plt>
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <atan@plt>
movss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @pi() {
%1 = call double @atan(double 1.000000e+00)
%2 = fmul double %1, 4.000000e+00
%3 = fptrunc double %2 to float
ret float %3
}

LLVM IR (-O2):
define float @pi() {
%1 = tail call double @atan(double 1.000000e+00)
ret float 0x400921FB60000000
}
/* Variables and functions */
int /*<<< orphan*/ gps_put(char);
void gps_put_char(char c) { gps_put(c); }


x86 assembly (clang, -O0):
<gps_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <gps_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gps_put_char>:
jmp    1030 <gps_put@plt>

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

LLVM IR (-O2):
define void @gps_put_char(i8 signext %0) {
%2 = tail call i32 @gps_put(i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello\n");
  printf("Hello\n");
  printf("Hello\n");
  printf("Hello\n");
  printf("Hello\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str.4 = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
int tls13_server_certificate_send(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_certificate_send(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int getClientId(int);
int /*<<< orphan*/ mail(int, int);
int /*<<< orphan*/ setEmailFrom(int, int);
void outgoing(int client, int msg) {
  int tmp;
  {
    {
      tmp = getClientId(client);
      setEmailFrom(msg, tmp);
      mail(client, msg);
    }
    return;
  }
}


x86 assembly (clang, -O0):
<outgoing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getClientId@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <setEmailFrom@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outgoing>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <getClientId@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1050 <setEmailFrom@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mail@plt>

LLVM IR (-O0):
define void @outgoing(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @getClientId(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @setEmailFrom(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @mail(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @outgoing(i32 %0, i32 %1) {
%3 = tail call i32 @getClientId(i32 %0)
%4 = tail call i32 @setEmailFrom(i32 %1, i32 %3)
%5 = tail call i32 @mail(i32 %0, i32 %1)
ret void
}
int test_00(int a) { return (a << 1) | ((a >> 31) & 1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %edi,%eax
rol    %eax
ret

LLVM IR (-O0):
define i32 @test_00(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 31
%7 = and i32 %6, 1
%8 = or i32 %4, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_00(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 1)
ret i32 %2
}
void tty_setsofttab(int on) {
  if (on) {
  } else {
  }
}


x86 assembly (clang, -O0):
<tty_setsofttab>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1116 <tty_setsofttab+0x16>
jmp    111b <tty_setsofttab+0x1b>
jmp    111b <tty_setsofttab+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tty_setsofttab(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @tty_setsofttab(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void someFunction(const int b[], int startIndex, int size) {
  if (startIndex < size) {
    someFunction(b, startIndex + 1, size);
    printf("%d ", b[startIndex]);
  }
}


x86 assembly (clang, -O0):
<someFunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1167 <someFunction+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <someFunction@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<someFunction>:
cmp    %edx,%esi
jge    114f <someFunction+0x2f>
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x1(%rbx),%esi
call   1040 <someFunction@plt>
movslq %ebx,%rax
mov    (%r14,%rax,4),%esi
lea    0xebd(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define void @someFunction(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %6
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @someFunction(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %1, 1
tail call void @someFunction(i32* %0, i32 %7, i32 %2)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
}
/* Type definitions */
struct tm {
  int dummy;
};
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
size_t strftime(char *, size_t, char *, struct tm *);
void test(void) {
  size_t length;
  size_t max_length;
  char buffer[80];
  struct tm timestruct;
  max_length = sizeof(buffer);
  length = strftime(buffer, max_length, "%A", &timestruct);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movq   $0x50,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdx
lea    -0x68(%rbp),%rcx
call   1030 <strftime@plt>
mov    %rax,-0x8(%rbp)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
sub    $0x68,%rsp
lea    0xee5(%rip),%rdx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rcx
mov    $0x50,%esi
call   1030 <strftime@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%A\00"
define void @test() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [80 x i8]
%4 = alloca %struct.tm
store i64 80, i64* %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = load i64, i64* %2
%7 = call i64 @strftime(i8* %5, i64 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
store i64 %7, i64* %1
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [3 x i8] c"%A\00"
define void @test() {
%1 = alloca [80 x i8]
%2 = alloca %struct.tm
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = bitcast %struct.tm* %2 to i8*
%5 = call i64 @strftime(i8* %3, i64 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %2)
ret void
}
void nouveau_switcheroo_optimus_dsm(void) {}


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

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

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

LLVM IR (-O2):
define void @nouveau_switcheroo_optimus_dsm() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t fil_sreadU32(uint8_t *in) {
  uint32_t ret;
  ret = *((uint32_t *)in);
  return ret;
}


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

x86 assembly (clang, -O2):
<fil_sreadU32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @fil_sreadU32(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}