xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int reverseNumber(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter a number to reverse : ");
  scanf("%d", &n);
  printf("Reverse of %d is %d", n, reverseNumber(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <reverseNumber@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1050 <reverseNumber@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter a number to reverse : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Reverse of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 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* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @reverseNumber(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Enter a number to reverse : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"Reverse of %d is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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 @reverseNumber(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
double dsignum(double x) {
  if (x > 0)
    return 1.0;
  else
    return -1.0;
}


x86 assembly (clang, -O0):
<dsignum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <dsignum+0x2d>
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113a <dsignum+0x3a>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsignum>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @dsignum(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %8
8: ; preds = %7, %6
%9 = load double, double* %2
ret double %9
}

LLVM IR (-O2):
define double @dsignum(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double 1.000000e+00, double -1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char const *);
void strlen_liveness(const char *x) {
  if (strlen(x) < 5)
    return;
  clang_analyzer_eval(strlen(x) < 5);
}


x86 assembly (clang, -O0):
<strlen_liveness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jge    1143 <strlen_liveness+0x23>
jmp    115c <strlen_liveness+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_liveness>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x5,%eax
jge    1130 <strlen_liveness+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x5,%eax
setl   %dil
pop    %rbx
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @strlen_liveness(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @strlen(i8* %8)
%10 = icmp slt i32 %9, 5
%11 = zext i1 %10 to i32
%12 = call i32 @clang_analyzer_eval(i32 %11)
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @strlen_liveness(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 5
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = icmp slt i32 %5, 5
%7 = zext i1 %6 to i32
%8 = tail call i32 @clang_analyzer_eval(i32 %7)
br label %9
9: ; preds = %1, %4
ret void
}
int filtersvr_qsort_cmp1(const void *p1, const void *p2) {
  int v1 = *(int *)p1;
  int v2 = *(int *)p2;
  if (v1 == v2) {
    return (0);
  }
  return ((v1 > v2) ? 1 : -1);
}


x86 assembly (clang, -O0):
<filtersvr_qsort_cmp1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1136 <filtersvr_qsort_cmp1+0x36>
movl   $0x0,-0x4(%rbp)
jmp    114e <filtersvr_qsort_cmp1+0x4e>
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<filtersvr_qsort_cmp1>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setg   %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @filtersvr_qsort_cmp1(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = select i1 %8, i32 1, i32 -1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
unsigned int device_bitrate(char *);
unsigned int ring_size(char *ifname, unsigned int size) {
  if (size > 0)
    return size;
  size = device_bitrate(ifname);
  size = (size * 1000000) / 8;
  size = size * 2;
  if (size == 0)
    size = (1 << 26);
  return ((((size)) + ((1 << 7)) - 1) & ~(((1 << 7)) - 1));
}


x86 assembly (clang, -O0):
<ring_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jbe    1134 <ring_size+0x24>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <ring_size+0x68>
mov    -0x10(%rbp),%rdi
call   1030 <device_bitrate@plt>
mov    %eax,-0x14(%rbp)
imul   $0xf4240,-0x14(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1167 <ring_size+0x57>
movl   $0x4000000,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x80,%eax
sub    $0x1,%eax
and    $0xffffff80,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ring_size>:
mov    %esi,%eax
test   %esi,%esi
je     1117 <ring_size+0x7>
ret
push   %rax
call   1030 <device_bitrate@plt>
imul   $0xf4240,%eax,%eax
mov    %eax,%ecx
shr    $0x2,%ecx
add    $0x7f,%ecx
and    $0xffffff80,%ecx
test   %eax,%eax
mov    $0x4000000,%eax
cmovne %ecx,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @ring_size(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp ugt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %26
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @device_bitrate(i8* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = mul i32 %13, 1000000
%15 = udiv i32 %14, 8
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = mul i32 %16, 2
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %10
store i32 67108864, i32* %5
br label %21
21: ; preds = %20, %10
%22 = load i32, i32* %5
%23 = add i32 %22, 128
%24 = sub i32 %23, 1
%25 = and i32 %24, -128
store i32 %25, i32* %3
br label %26
26: ; preds = %21, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @ring_size(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = tail call i32 @device_bitrate(i8* %0)
%6 = mul i32 %5, 1000000
%7 = lshr exact i32 %6, 2
%8 = icmp eq i32 %6, 0
%9 = add nuw nsw i32 %7, 127
%10 = and i32 %9, 2147483520
%11 = select i1 %8, i32 67108864, i32 %10
br label %12
12: ; preds = %2, %4
%13 = phi i32 [ %11, %4 ], [ %1, %2 ]
ret i32 %13
}
int fib(int n) {
  if (n <= 1)
    return n;
  return fib(n - 2) + fib(n - 1);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jl     1147 <fib+0x37>
add    $0x1,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1130 <fib+0x20>
mov    $0x1,%ebx
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 3
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %9, %3 ]
%13 = phi i32 [ %0, %1 ], [ 1, %3 ]
%14 = add nsw i32 %13, %12
ret i32 %14
}
int test_imm_E7int16_reg(short val) {
  return ((val) & (-0xE7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E7int16_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, -231
%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_E7int16_reg(i16 signext %0) {
%2 = and i16 %0, -231
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
#define TCIFLUSH 130
#define TCIOFLUSH 129
#define TCOFLUSH 128
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int tcflush(int fd, int queue_selector) {
  switch (queue_selector) {
  case TCIFLUSH:
  case TCOFLUSH:
  case TCIOFLUSH:
    break;
  default:
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<tcflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x2,%eax
ja     1137 <tcflush+0x27>
jmp    1132 <tcflush+0x22>
jmp    1151 <tcflush+0x41>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <tcflush+0x56>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcflush>:
push   %rax
add    $0xffffff80,%esi
cmp    $0x3,%esi
jae    1122 <tcflush+0x12>
mov    0x2ec8(%rip),%rax
jmp    1129 <tcflush+0x19>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @tcflush(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* %5
switch i32 %6, label %8 [
i32 130, label %7
i32 128, label %7
i32 129, label %7
]
7: ; preds = %2, %2, %2
br label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i32 -1, i32* %3
br label %14
11: ; preds = %7
%12 = load i32, i32* @ENOSYS
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %14
14: ; preds = %11, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @tcflush(i32 %0, i32 %1) {
%3 = add i32 %1, -128
%4 = icmp ult i32 %3, 3
%5 = load i32, i32* @ENOSYS
%6 = load i32, i32* @EINVAL
%7 = select i1 %4, i32 %5, i32 %6
%8 = tail call i32 @__set_errno(i32 %7)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SU_Capitalize(char *);
char *SU_Capitalized(char *The_String) {
  SU_Capitalize(The_String);
  return The_String;
}


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

x86 assembly (clang, -O2):
<SU_Capitalized>:
push   %rbx
mov    %rdi,%rbx
call   1030 <SU_Capitalize@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SU_Capitalized(i8* returned %0) {
%2 = tail call i32 @SU_Capitalize(i8* %0)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ print_numbers(int);
int main(void) { print_numbers(22); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_numbers(i32 22)
ret i32 0
}
/* Variables and functions */
float __infer_nondet_float();
float acoshf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<acoshf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @acoshf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @acoshf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
/* Variables and functions */
bool in_range(int val, int min, int max) { return min <= val && val <= max; }


x86 assembly (clang, -O0):
<in_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     112a <in_range+0x2a>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_range>:
cmp    %edi,%esi
setle  %al
cmp    %edx,%edi
setle  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in_range(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* %4
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %6
%13 = icmp sle i32 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp sle i32 %1, %0
%5 = icmp sle i32 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *);
char *sbrk(int);
char *msbrk(int size) {
  register char *address;
  if ((address = sbrk(size)) == (char *)-1)
    error(1, "Not enough memory. Use chmem to allocate more", ((char *)0));
  return address;
}


x86 assembly (clang, -O0):
<msbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sbrk@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    115c <msbrk+0x3c>
mov    $0x1,%edi
lea    0xead(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msbrk>:
push   %rbx
call   1030 <sbrk@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    1142 <msbrk+0x22>
lea    0xeca(%rip),%rsi
mov    $0x1,%edi
xor    %edx,%edx
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Not enough memory. Use chmem to allocate more\00"
define i8* @msbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @sbrk(i32 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, inttoptr (i64 -1 to i8*)
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @error(i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* null)
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [46 x i8] c"Not enough memory. Use chmem to allocate more\00"
define i8* @msbrk(i32 %0) {
%2 = tail call i8* @sbrk(i32 %0)
%3 = icmp eq i8* %2, inttoptr (i64 -1 to i8*)
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
oof(n) int n;
{ return n + 1; }


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

x86 assembly (clang, -O2):
<oof>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @oof(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int __attribute__((stdcall)) __stub_zero_std_16(int a, int b, int c, int d) {
  return 0;
}


x86 assembly (clang, -O0):
<__stub_zero_std_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__stub_zero_std_16(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret i32 0
}

LLVM IR (-O2):
define i32 @__stub_zero_std_16(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void bar0(int *__restrict__ arr1, int *__restrict__ arr2) {
  arr1[0] = 1;
  arr2[0] = 1;
  if (arr1[0] != 1)
    link_error();
}


x86 assembly (clang, -O0):
<bar0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
je     1148 <bar0+0x38>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar0>:
movl   $0x1,(%rdi)
movl   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @bar0(i32* noalias nocapture writeonly %0, i32* noalias nocapture writeonly %1) {
store i32 1, i32* %0
store i32 1, i32* %1
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void delay_for(double delay) {
  struct timeval tv;
  tv.tv_sec = (long)delay;
  tv.tv_usec = (delay - tv.tv_sec) * 1.0e6;
  select(0, NULL, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<delay_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdq -0x18(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xec2(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_for>:
sub    $0x18,%rsp
cvttsd2si %xmm0,%rax
mov    %rax,0x8(%rsp)
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xed1(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    0x8(%rsp),%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, double }
define void @delay_for(double %0) {
%2 = alloca double
%3 = alloca %struct.timeval
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i64
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load double, double* %2
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fsub double %7, %10
%12 = fmul double %11, 1.000000e+06
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store double %12, double* %13
%14 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, double }
define void @delay_for(double %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = fptosi double %0 to i64
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = sitofp i64 %4 to double
%7 = fsub double %0, %6
%8 = fmul double %7, 1.000000e+06
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store double %8, double* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _TIFFsetByteArray(void **, void *, long);
void _TIFFsetDoubleArray(double **dpp, double *dp, long n) {
  _TIFFsetByteArray((void **)dpp, (void *)dp, n * sizeof(double));
}


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

x86 assembly (clang, -O2):
<_TIFFsetDoubleArray>:
shl    $0x3,%rdx
jmp    1030 <_TIFFsetByteArray@plt>

LLVM IR (-O0):
define void @_TIFFsetDoubleArray(double** %0, double* %1, i64 %2) {
%4 = alloca double**
%5 = alloca double*
%6 = alloca i64
store double** %0, double*** %4
store double* %1, double** %5
store i64 %2, i64* %6
%7 = load double**, double*** %4
%8 = bitcast double** %7 to i8**
%9 = load double*, double** %5
%10 = bitcast double* %9 to i8*
%11 = load i64, i64* %6
%12 = mul i64 %11, 8
%13 = call i32 @_TIFFsetByteArray(i8** %8, i8* %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @_TIFFsetDoubleArray(double** %0, double* %1, i64 %2) {
%4 = bitcast double** %0 to i8**
%5 = bitcast double* %1 to i8*
%6 = shl i64 %2, 3
%7 = tail call i32 @_TIFFsetByteArray(i8** %4, i8* %5, i64 %6)
ret void
}
/* Variables and functions */
int lmuOy2(int /*<<< orphan*/, unsigned long volatile *, unsigned int);
__attribute__((no)) unsigned __attribute__((stdcall, regparm(3)))
dMM0e1(volatile unsigned long *RdZoN, unsigned kKiv65) {
  return lmuOy2(0, RdZoN, kKiv65);
}


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

x86 assembly (clang, -O2):
<dMM0e1>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <lmuOy2@plt>

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

LLVM IR (-O2):
define i32 @dMM0e1(i64* %0, i32 %1) {
%3 = tail call i32 @lmuOy2(i32 0, i64* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ send_break_signal();
int /*<<< orphan*/ set_dtr(int);
int /*<<< orphan*/ set_rts(int);
int /*<<< orphan*/ usleep(int);
void hard_reset_to_user_code(void) {
  printf("Reset CPU (into user code)\r\n");
  set_rts(1);
  set_dtr(1);
  send_break_signal();
  usleep(75000);
  set_dtr(0);
  usleep(40000);
}


x86 assembly (clang, -O0):
<hard_reset_to_user_code>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <set_rts@plt>
mov    $0x1,%edi
call   1050 <set_dtr@plt>
mov    $0x0,%al
call   1060 <send_break_signal@plt>
mov    $0x124f8,%edi
call   1070 <usleep@plt>
xor    %edi,%edi
call   1050 <set_dtr@plt>
mov    $0x9c40,%edi
call   1070 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hard_reset_to_user_code>:
push   %rax
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <set_rts@plt>
mov    $0x1,%edi
call   1050 <set_dtr@plt>
xor    %eax,%eax
call   1060 <send_break_signal@plt>
mov    $0x124f8,%edi
call   1070 <usleep@plt>
xor    %edi,%edi
call   1050 <set_dtr@plt>
mov    $0x9c40,%edi
pop    %rax
jmp    1070 <usleep@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Reset CPU (into user code)\0D\0A\00"
define void @hard_reset_to_user_code() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @set_rts(i32 1)
%3 = call i32 @set_dtr(i32 1)
%4 = call i32 (...) @send_break_signal()
%5 = call i32 @usleep(i32 75000)
%6 = call i32 @set_dtr(i32 0)
%7 = call i32 @usleep(i32 40000)
ret void
}

LLVM IR (-O2):
@str = [28 x i8] c"Reset CPU (into user code)\0D\00"
define void @hard_reset_to_user_code() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @set_rts(i32 1)
%3 = tail call i32 @set_dtr(i32 1)
%4 = tail call i32 (...) @send_break_signal()
%5 = tail call i32 @usleep(i32 75000)
%6 = tail call i32 @set_dtr(i32 0)
%7 = tail call i32 @usleep(i32 40000)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ oput;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void runcmd(char *cmd, char rtrn[]) {
  FILE *cmdStream;
  char oput[255];
  cmdStream = popen(cmd, "r");
  fgets(oput, sizeof(oput), cmdStream);
  strcpy(rtrn, oput);
}


x86 assembly (clang, -O0):
<runcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xff,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runcmd>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
lea    0xebc(%rip),%rsi
call   1050 <popen@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xff,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define void @runcmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca [255 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32* @popen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %5
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%10 = load i32*, i32** %5
%11 = call i32 @fgets(i8* %9, i32 255, i32* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %6, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define void @runcmd(i8* nocapture %0, i8* %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = tail call i32* @popen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @fgets(i8* %4, i32 255, i32* %5)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
/* Type definitions */
struct scanner_state {
  int dummy;
};

/* Variables and functions */
int add_digit(struct scanner_state *, char, int);
scalar_t__ isxdigit(char);
int non_digit(struct scanner_state *);
int mode_hex_more(struct scanner_state *s, char c) {
  return isxdigit(c) ? add_digit(s, c, 16) : non_digit(s);
}


x86 assembly (clang, -O0):
<mode_hex_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1050 <isxdigit@plt>
cmp    $0x0,%rax
je     116f <mode_hex_more+0x3f>
mov    -0x8(%rbp),%rdi
mov    $0x10,%edx
movsbl -0x9(%rbp),%esi
call   1040 <add_digit@plt>
mov    %eax,-0x10(%rbp)
jmp    117b <mode_hex_more+0x4b>
mov    -0x8(%rbp),%rdi
call   1030 <non_digit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_hex_more>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <isxdigit@plt>
test   %rax,%rax
je     115b <mode_hex_more+0x2b>
movsbl %bpl,%esi
mov    %rbx,%rdi
mov    $0x10,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <add_digit@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <non_digit@plt>

LLVM IR (-O0):
%struct.scanner_state = type { i32 }
define i32 @mode_hex_more(%struct.scanner_state* %0, i8 signext %1) {
%3 = alloca %struct.scanner_state*
%4 = alloca i8
store %struct.scanner_state* %0, %struct.scanner_state** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i64 @isxdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.scanner_state*, %struct.scanner_state** %3
%10 = load i8, i8* %4
%11 = call i32 @add_digit(%struct.scanner_state* %9, i8 signext %10, i32 16)
br label %15
12: ; preds = %2
%13 = load %struct.scanner_state*, %struct.scanner_state** %3
%14 = call i32 @non_digit(%struct.scanner_state* %13)
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.scanner_state = type { i32 }
define i32 @mode_hex_more(%struct.scanner_state* %0, i8 signext %1) {
%3 = tail call i64 @isxdigit(i8 signext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @add_digit(%struct.scanner_state* %0, i8 signext %1, i32 16)
br label %9
7: ; preds = %2
%8 = tail call i32 @non_digit(%struct.scanner_state* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int f428(int *);
int f429(int *p) { return f428(p); }


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

x86 assembly (clang, -O2):
<f429>:
jmp    1030 <f428@plt>

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

LLVM IR (-O2):
define i32 @f429(i32* %0) {
%2 = tail call i32 @f428(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, int);
void str_insert(const char *base, char *src, size_t n) {
  memmove(src + n, src, 512 - (size_t)(src - base) - n);
}


x86 assembly (clang, -O0):
<str_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
sub    %rax,%rcx
mov    $0x200,%eax
sub    %rcx,%rax
sub    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_insert>:
lea    (%rdx,%rsi,1),%rax
sub    %eax,%edi
lea    0x200(%rdi),%edx
mov    %rax,%rdi
jmp    1030 <memmove@plt>

LLVM IR (-O0):
define void @str_insert(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i64, i64* %6
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = ptrtoint i8* %11 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
%16 = sub i64 512, %15
%17 = load i64, i64* %6
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
%20 = call i32 @memmove(i8* %9, i8* %10, i32 %19)
ret void
}

LLVM IR (-O2):
define void @str_insert(i8* %0, i8* %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = add i64 %6, 512
%8 = add i64 %5, %2
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = tail call i32 @memmove(i8* %4, i8* %1, i32 %10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void co_write32(void const *ptr32, uint32_t value) {
  *(uint32_t *)ptr32 = value;
}


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

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

LLVM IR (-O0):
define void @co_write32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @co_write32(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ save_first_info_screen();
int osa_print_log_ex(char *subsystem, char *sourcefile, int line, int offset,
                     const char *message, ...) {
  save_first_info_screen();
  return 0;
}


x86 assembly (clang, -O0):
<osa_print_log_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
call   1030 <save_first_info_screen@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @osa_print_log_ex(i8* %0, i8* %1, i32 %2, i32 %3, i8* %4, ...) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = call i32 (...) @save_first_info_screen()
ret i32 0
}

LLVM IR (-O2):
define i32 @osa_print_log_ex(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i8* nocapture readnone %4, ...) {
%6 = tail call i32 (...) @save_first_info_screen()
ret i32 0
}
/* Variables and functions */
float erfcf(float);
float __ocl_erfc_float(float src) { return erfcf(src); }


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

x86 assembly (clang, -O2):
<__ocl_erfc_float>:
jmp    1030 <erfcf@plt>

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

LLVM IR (-O2):
define float @__ocl_erfc_float(float %0) {
%2 = tail call float @erfcf(float %0)
ret float %2
}
char index2mark(const int x) {
  if (x > 35)
    return (char)(x + 61);
  else if (x < 10)
    return (char)(x + 48);
  else
    return (char)(x + 55);
}


x86 assembly (clang, -O0):
<index2mark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x23,-0x8(%rbp)
jle    111f <index2mark+0x1f>
mov    -0x8(%rbp),%eax
add    $0x3d,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <index2mark+0x40>
cmpl   $0xa,-0x8(%rbp)
jge    1137 <index2mark+0x37>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1140 <index2mark+0x40>
mov    -0x8(%rbp),%eax
add    $0x37,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index2mark>:
mov    %edi,%eax
cmp    $0x24,%edi
jl     110a <index2mark+0xa>
add    $0x3d,%al
ret
cmp    $0x9,%eax
jg     1112 <index2mark+0x12>
add    $0x30,%al
ret
add    $0x37,%al
ret

LLVM IR (-O0):
define signext i8 @index2mark(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 35
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 61
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %21
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 48
%16 = trunc i32 %15 to i8
store i8 %16, i8* %2
br label %21
17: ; preds = %10
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 55
%20 = trunc i32 %19 to i8
store i8 %20, i8* %2
br label %21
21: ; preds = %17, %13, %6
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @index2mark(i32 %0) {
%2 = icmp sgt i32 %0, 35
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add i8 %4, 61
br label %13
6: ; preds = %1
%7 = icmp slt i32 %0, 10
%8 = trunc i32 %0 to i8
br i1 %7, label %9, label %11
9: ; preds = %6
%10 = add i8 %8, 48
br label %13
11: ; preds = %6
%12 = add nuw nsw i8 %8, 55
br label %13
13: ; preds = %11, %9, %3
%14 = phi i8 [ %5, %3 ], [ %10, %9 ], [ %12, %11 ]
ret i8 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ y;

/* Variables and functions */
int /*<<< orphan*/ abort();
unsigned int calc_mp(unsigned int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  unsigned x = 1234;
  unsigned y = calc_mp(x);
  if ((sizeof(y) == 4 && y != 680) || (sizeof(y) == 2 && y != 134))
    abort();
  exit(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)
movl   $0x4d2,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <calc_mp@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x2a8,-0x18(%rbp)
je     116c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4d2,%edi
call   1050 <calc_mp@plt>
cmp    $0x2a8,%eax
jne    1149 <main+0x19>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
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
store i32 1234, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @calc_mp(i32 %8)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = icmp ne i32 %10, 680
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @calc_mp(i32 1234)
%4 = icmp eq i32 %3, 680
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @exit(i32 0)
unreachable
}
int char2int(char c) { return (int)c - 0x30; }


x86 assembly (clang, -O0):
<char2int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char2int>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @char2int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @char2int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
int do_764() { return 764; }


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

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

LLVM IR (-O0):
define i32 @do_764() {
ret i32 764
}

LLVM IR (-O2):
define i32 @do_764() {
ret i32 764
}
void subvv(double *result, const double *s1, const double *s2) {
  result[0] = s1[0] - s2[0];
  result[1] = s1[1] - s2[1];
  result[2] = s1[2] - s2[2];
}


x86 assembly (clang, -O0):
<subvv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  0x10(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<subvv>:
movsd  (%rsi),%xmm0
subsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rsi),%xmm0
subsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  0x10(%rsi),%xmm0
subsd  0x10(%rdx),%xmm0
movsd  %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @subvv(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %6
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %5
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %6
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %4
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %5
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %6
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %4
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @subvv(double* nocapture writeonly %0, double* nocapture %1, double* nocapture %2) {
%4 = load double, double* %1
%5 = load double, double* %2
%6 = fsub double %4, %5
store double %6, double* %0
%7 = getelementptr inbounds double, double* %1, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %2, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %0, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %2, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %0, i64 2
store double %17, double* %18
ret void
}