xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa3() {
  Assert_real((isodigit(163) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              820, ("isodigit should be 0 for 0xa3"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xa3>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa3,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x334,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xa3>:
push   %rax
mov    $0xa3,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x334,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa3\00"
define void @t_isodigit_0xa3() {
%1 = call i64 @isodigit(i32 163)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa3\00"
define void @t_isodigit_0xa3() {
%1 = tail call i64 @isodigit(i32 163)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 820, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int ld_blg_cr1(long double a1) { return (__builtin_islessgreater(100, a1)); }


x86 assembly (clang, -O0):
<ld_blg_cr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_blg_cr1>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setne  %al
ret

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

LLVM IR (-O2):
define i32 @ld_blg_cr1(x86_fp80 %0) {
%2 = fcmp one x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
int imax2(int x, int y) { return (x < y) ? y : x; }


x86 assembly (clang, -O0):
<imax2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <imax2+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <imax2+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imax2>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

LLVM IR (-O0):
define i32 @imax2(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @imax2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int irm_create_file(char *);
int /*<<< orphan*/ warnx(char *);
void irm_init(void) {
  int ret;
  ret = irm_create_file("./irm_log002.txt");
  if (ret != 0) {
    warnx("irm create log file error");
  }
}


x86 assembly (clang, -O0):
<irm_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <irm_create_file@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114d <irm_init+0x2d>
lea    0xec9(%rip),%rdi
call   1030 <warnx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irm_init>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <irm_create_file@plt>
test   %eax,%eax
je     113e <irm_init+0x1e>
lea    0xed9(%rip),%rdi
pop    %rax
jmp    1030 <warnx@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"./irm_log002.txt\00"
@.str.1 = [26 x i8] c"irm create log file error\00"
define void @irm_init() {
%1 = alloca i32
%2 = call i32 @irm_create_file(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @warnx(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"./irm_log002.txt\00"
@.str.1 = [26 x i8] c"irm create log file error\00"
define void @irm_init() {
%1 = tail call i32 @irm_create_file(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @warnx(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void showArray(int *array, int size) {
  int x = size;
  while (x--)
    printf("Element %d: %d\n", x, *(array + x));
}


x86 assembly (clang, -O0):
<showArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     1158 <showArray+0x48>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1125 <showArray+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showArray>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1145 <showArray+0x35>
mov    %esi,%ebp
movslq %esi,%rax
lea    (%rdi,%rax,4),%rbx
add    $0xfffffffffffffffc,%rbx
add    $0xffffffff,%ebp
lea    0xed1(%rip),%r14
nop
mov    (%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
add    $0xfffffffffffffffc,%rbx
add    $0xffffffff,%ebp
jb     1130 <showArray+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Element %d: %d\0A\00"
define void @showArray(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %10)
%13 = icmp eq i32 %11, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
int Cyc_Port_cmp_edit(struct Cyc_Port_Edit *e1, struct Cyc_Port_Edit *e2) {
  return (int)e1 - (int)e2;
}


x86 assembly (clang, -O0):
<Cyc_Port_cmp_edit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Port_cmp_edit>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
%struct.Cyc_Port_Edit = type opaque
define i32 @Cyc_Port_cmp_edit(%struct.Cyc_Port_Edit* %0, %struct.Cyc_Port_Edit* %1) {
%3 = alloca %struct.Cyc_Port_Edit*
%4 = alloca %struct.Cyc_Port_Edit*
store %struct.Cyc_Port_Edit* %0, %struct.Cyc_Port_Edit** %3
store %struct.Cyc_Port_Edit* %1, %struct.Cyc_Port_Edit** %4
%5 = load %struct.Cyc_Port_Edit*, %struct.Cyc_Port_Edit** %3
%6 = ptrtoint %struct.Cyc_Port_Edit* %5 to i32
%7 = load %struct.Cyc_Port_Edit*, %struct.Cyc_Port_Edit** %4
%8 = ptrtoint %struct.Cyc_Port_Edit* %7 to i32
%9 = sub nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.Cyc_Port_Edit = type opaque
define i32 @Cyc_Port_cmp_edit(%struct.Cyc_Port_Edit* %0, %struct.Cyc_Port_Edit* %1) {
%3 = ptrtoint %struct.Cyc_Port_Edit* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint %struct.Cyc_Port_Edit* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int reverse_number(int n) {
  int last_digit, new_num = 0;
  while (n) {
    last_digit = n % 10;
    new_num = new_num * 10 + last_digit;
    n /= 10;
  }
  return new_num;
}


x86 assembly (clang, -O0):
<reverse_number>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <reverse_number+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse_number+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_number>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse_number+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse_number+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse_number(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = srem i32 %5, 10
%7 = mul nsw i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
int f(const int x) { return x; }


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

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
float Spannung_berechnen(int sensor_wert) {
  float R1 = 10000.0;
  float R2 = 30000.0;
  float spannung = 0.0;
  float value = 0.0;
  value = (sensor_wert * 3.2) / 1024;
  spannung = value / (R2 / (R1 + R2));
  return spannung;
}


x86 assembly (clang, -O0):
<Spannung_berechnen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  0xf05(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeca(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
addss  -0xc(%rbp),%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Spannung_berechnen>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
divss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @Spannung_berechnen(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %2
store float 1.000000e+04, float* %3
store float 3.000000e+04, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 3.200000e+00
%10 = fdiv double %9, 1.024000e+03
%11 = fptrunc double %10 to float
store float %11, float* %6
%12 = load float, float* %6
%13 = load float, float* %4
%14 = load float, float* %3
%15 = load float, float* %4
%16 = fadd float %14, %15
%17 = fdiv float %13, %16
%18 = fdiv float %12, %17
store float %18, float* %5
%19 = load float, float* %5
ret float %19
}

LLVM IR (-O2):
define float @Spannung_berechnen(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 3.200000e+00
%4 = fmul double %3, 0x3F50000000000000
%5 = fptrunc double %4 to float
%6 = fdiv float %5, 7.500000e-01
ret float %6
}
void safe_add(double *sum, double *c, double x) {
  double y = x - *c;
  double t = *sum + y;
  *c = (t - *sum) - y;
  *sum = t;
}


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

x86 assembly (clang, -O2):
<safe_add>:
subsd  (%rsi),%xmm0
movsd  (%rdi),%xmm1
movapd %xmm1,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
subsd  %xmm0,%xmm3
movsd  %xmm3,(%rsi)
movsd  %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @safe_add(double* %0, double* %1, double %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %4
store double* %1, double** %5
store double %2, double* %6
%9 = load double, double* %6
%10 = load double*, double** %5
%11 = load double, double* %10
%12 = fsub double %9, %11
store double %12, double* %7
%13 = load double*, double** %4
%14 = load double, double* %13
%15 = load double, double* %7
%16 = fadd double %14, %15
store double %16, double* %8
%17 = load double, double* %8
%18 = load double*, double** %4
%19 = load double, double* %18
%20 = fsub double %17, %19
%21 = load double, double* %7
%22 = fsub double %20, %21
%23 = load double*, double** %5
store double %22, double* %23
%24 = load double, double* %8
%25 = load double*, double** %4
store double %24, double* %25
ret void
}

LLVM IR (-O2):
define void @safe_add(double* nocapture %0, double* nocapture %1, double %2) {
%4 = load double, double* %1
%5 = fsub double %2, %4
%6 = load double, double* %0
%7 = fadd double %6, %5
%8 = fsub double %7, %6
%9 = fsub double %8, %5
store double %9, double* %1
store double %7, double* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ a1();
void b(unsigned char data) {
  if (data & 0x80)
    a1();
  data <<= 1;
  if (data & 0x80)
    a1();
  data <<= 1;
  if (data & 0x80)
    a1();
}


x86 assembly (clang, -O0):
<b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1137 <b+0x27>
mov    $0x0,%al
call   1030 <a1@plt>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     115a <b+0x4a>
mov    $0x0,%al
call   1030 <a1@plt>
movzbl -0x1(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     117d <b+0x6d>
mov    $0x0,%al
call   1030 <a1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b>:
push   %rbx
mov    %edi,%ebx
test   %bl,%bl
js     1123 <b+0x13>
test   $0x40,%bl
jne    112f <b+0x1f>
test   $0x20,%bl
jne    113b <b+0x2b>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <a1@plt>
test   $0x40,%bl
je     111c <b+0xc>
xor    %eax,%eax
call   1030 <a1@plt>
test   $0x20,%bl
je     1121 <b+0x11>
xor    %eax,%eax
pop    %rbx
jmp    1030 <a1@plt>

LLVM IR (-O0):
define void @b(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 128
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (...) @a1()
br label %9
9: ; preds = %7, %1
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
%14 = load i8, i8* %2
%15 = zext i8 %14 to i32
%16 = and i32 %15, 128
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %9
%19 = call i32 (...) @a1()
br label %20
20: ; preds = %18, %9
%21 = load i8, i8* %2
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 1
%24 = trunc i32 %23 to i8
store i8 %24, i8* %2
%25 = load i8, i8* %2
%26 = zext i8 %25 to i32
%27 = and i32 %26, 128
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %20
%30 = call i32 (...) @a1()
br label %31
31: ; preds = %29, %20
ret void
}

LLVM IR (-O2):
define void @b(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @a1()
br label %5
5: ; preds = %3, %1
%6 = and i8 %0, 64
%7 = icmp eq i8 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @a1()
br label %10
10: ; preds = %8, %5
%11 = and i8 %0, 32
%12 = icmp eq i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @a1()
br label %15
15: ; preds = %13, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < 4; i++) {
    printf("Hello world!\n");
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1151 <main+0x41>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%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>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %12, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 4
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
store i32 %14, i32* %6
br label %7
15: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *strsignal(int signum) {
  static char string[100];
  sprintf(string, "signal number %d", signum);
  return string;
}


x86 assembly (clang, -O0):
<strsignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsignal>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strsignal.string = internal global [100 x i8] zeroinitializer
@.str = [17 x i8] c"signal number %d\00"
define i8* @strsignal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @strsignal.string, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @strsignal.string, i64 0, i64 0)
}

LLVM IR (-O2):
@strsignal.string = internal global [100 x i8] zeroinitializer
@.str = [17 x i8] c"signal number %d\00"
define i8* @strsignal(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @strsignal.string, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @strsignal.string, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ isalpha(char);
scalar_t__ isblank(char);
int isAlphaOrBlank(char ch) { return isalpha(ch) || isblank(ch); }


x86 assembly (clang, -O0):
<isAlphaOrBlank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    115c <isAlphaOrBlank+0x3c>
movsbl -0x1(%rbp),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isAlphaOrBlank>:
push   %rbx
mov    %edi,%ebx
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <isAlphaOrBlank+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <isblank@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isAlphaOrBlank(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalpha(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isblank(i8 signext %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isAlphaOrBlank(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isblank(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
generate_label(nlab) int nlab;
{
  print_label(nlab);
  output_label_terminator();
  newline();
}


x86 assembly (clang, -O0):
<generate_label>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <print_label@plt>
mov    $0x0,%al
call   1050 <output_label_terminator@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_label>:
push   %rax
xor    %eax,%eax
call   1040 <print_label@plt>
xor    %eax,%eax
call   1050 <output_label_terminator@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
define i32 @generate_label(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @print_label to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (...) @output_label_terminator()
%7 = call i32 (...) @newline()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @generate_label(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @print_label to i32 (i32, ...)*)(i32 %0)
%3 = tail call i32 (...) @output_label_terminator()
%4 = tail call i32 (...) @newline()
ret i32 undef
}
int test_and_set_bit(int nr, volatile void *addr) {
  int oldbit;
  asm volatile(""
               "btsl %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "=m"((*(volatile long *)addr))
               : "Ir"(nr), "m"((*(volatile long *)addr))
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rdx
bts    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
bts    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_set_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
%11 = call i32 asm sideeffect "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i32 %8, i64* elementtype(i64) %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_and_set_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
%4 = tail call i32 asm sideeffect "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0, i64* elementtype(i64) %3)
ret i32 %4
}
void debug_printf(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_printf(i8* nocapture %0, ...) {
ret void
}
unsigned short parse_short(unsigned char *p) {
  unsigned short i = *p;
  p++;
  i |= *p << 8;
  return i;
}


x86 assembly (clang, -O0):
<parse_short>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x8,%ecx
movzwl -0xa(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_short>:
movzwl (%rdi),%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @parse_short(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = zext i8 %4 to i16
%6 = shl nuw i16 %5, 8
%7 = zext i8 %2 to i16
%8 = or i16 %6, %7
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stderr;
void usage(const char *prog, FILE *out) {
  fprintf(out, "usage: %s allocsize\n", prog);
  fprintf(out, " allocsize is kbytes, or number[KMGP] (P = pages)\n");
  exit(out == stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xec2(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xec6(%rip),%rdi
mov    $0x32,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    0x2e78(%rip),%rax
xor    %edi,%edi
cmp    %rbx,(%rax)
sete   %dil
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage: %s allocsize\0A\00"
@.str.1 = [51 x i8] c" allocsize is kbytes, or number[KMGP] (P = pages)\0A\00"
@stderr = global i32* null
define void @usage(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 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %4
%11 = load i32*, i32** @stderr
%12 = icmp eq i32* %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: %s allocsize\0A\00"
@.str.1 = [51 x i8] c" allocsize is kbytes, or number[KMGP] (P = pages)\0A\00"
@stderr = global i32* null
define void @usage(i8* %0, i32* nocapture %1) {
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i64 50, i64 1, i32* %1)
%5 = load i32*, i32** @stderr
%6 = icmp eq i32* %5, %1
%7 = zext i1 %6 to i32
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(size_t const);
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
size_t strlen(char const *);
char *copy_string(const char *str) {
  const size_t len = strlen(str);
  char *dup = (char *)malloc(len + 1);
  memcpy(dup, str, len + 1);
  return dup;
}


x86 assembly (clang, -O0):
<copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @copy_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = add i64 %13, 1
%15 = call i32 @memcpy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
define i8* @copy_string(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %3)
ret i8* %5
}
int charcmp(const void *_a, const void *_b) {
  char a = *((char *)_a), b = *((char *)_b);
  if (a < b)
    return -1;
  else if (a == b)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<charcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    113a <charcmp+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <charcmp+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <charcmp+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <charcmp+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<charcmp>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @charcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp ne i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
unsigned int weahter_get_ext_humid() { return 155; }


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

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

LLVM IR (-O0):
define i32 @weahter_get_ext_humid() {
ret i32 155
}

LLVM IR (-O2):
define i32 @weahter_get_ext_humid() {
ret i32 155
}
int mult(int x) { return 2 * x; }


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

x86 assembly (clang, -O2):
<mult>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @mult(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void reverse(char *str) {
  if (*(str + 1) != '\0') {
    reverse(str + 1);
  }
  printf("%c", *str);
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     114a <reverse+0x2a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
lea    0xeab(%rip),%rdi
movsbl (%rax),%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %rbx
mov    %rdi,%rbx
cmpb   $0x0,0x1(%rdi)
je     1133 <reverse+0x13>
lea    0x1(%rbx),%rdi
call   1030 <reverse@plt>
movsbl (%rbx),%esi
lea    0xec3(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @reverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %13)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @reverse(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
tail call void @reverse(i8* %2)
br label %6
6: ; preds = %5, %1
%7 = load i8, i8* %0
%8 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
ret void
}
/* Variables and functions */
unsigned char __builtin_bitreverse8(unsigned char);
unsigned char bitrev8(unsigned char data) {
  return __builtin_bitreverse8(data);
}


x86 assembly (clang, -O0):
<bitrev8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
rol    $0x4,%al
mov    %al,%cl
and    $0x33,%cl
shl    $0x2,%cl
shr    $0x2,%al
and    $0x33,%al
or     %cl,%al
mov    %al,%cl
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitrev8>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @bitrev8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i8 @llvm.bitreverse.i8(i8 %3)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @bitrev8(i8 zeroext %0) {
%2 = tail call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_dword(int /*<<< orphan*/ *);
uint32_t eeconfig_read_user(void) { return eeprom_read_dword((uint32_t *)19); }


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

x86 assembly (clang, -O2):
<eeconfig_read_user>:
mov    $0x13,%edi
jmp    1030 <eeprom_read_dword@plt>

LLVM IR (-O0):
define i32 @eeconfig_read_user() {
%1 = call i32 @eeprom_read_dword(i32* inttoptr (i64 19 to i32*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @eeconfig_read_user() {
%1 = tail call i32 @eeprom_read_dword(i32* inttoptr (i64 19 to i32*))
ret i32 %1
}
int flteq(double f1, double f2) {
  double upperbnd, lowerbnd;
  upperbnd = f2 + (0.000002);
  lowerbnd = f2 - (0.000002);
  if ((f1 > upperbnd) || (f1 < lowerbnd))
    return ((0));
  return ((1));
}


x86 assembly (clang, -O0):
<flteq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeea(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     115a <flteq+0x5a>
movsd  -0x10(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1166 <flteq+0x66>
movl   $0x0,-0x4(%rbp)
jmp    116d <flteq+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flteq>:
movsd  0xef8(%rip),%xmm2
addsd  %xmm1,%xmm2
ucomisd %xmm2,%xmm0
setbe  %al
addsd  0xeed(%rip),%xmm1
ucomisd %xmm0,%xmm1
setbe  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @flteq(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
%8 = load double, double* %5
%9 = fadd double %8, 2.000000e-06
store double %9, double* %6
%10 = load double, double* %5
%11 = fsub double %10, 2.000000e-06
store double %11, double* %7
%12 = load double, double* %4
%13 = load double, double* %6
%14 = fcmp ogt double %12, %13
br i1 %14, label %19, label %15
15: ; preds = %2
%16 = load double, double* %4
%17 = load double, double* %7
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15, %2
store i32 0, i32* %3
br label %21
20: ; preds = %15
store i32 1, i32* %3
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @flteq(double %0, double %1) {
%3 = fadd double %1, 2.000000e-06
%4 = fcmp uge double %3, %0
%5 = fadd double %1, -2.000000e-06
%6 = fcmp ule double %5, %0
%7 = and i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
int get_deli_right(int c) {
  switch (c) {
  case '(':
    return ')';
  case '{':
    return '}';
  case '[':
    return ']';
  case '<':
    return '>';
  default:
    return c;
  }
}


x86 assembly (clang, -O0):
<get_deli_right>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     114e <get_deli_right+0x4e>
jmp    111b <get_deli_right+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x3c,%eax
je     1172 <get_deli_right+0x72>
jmp    112c <get_deli_right+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     1166 <get_deli_right+0x66>
jmp    113d <get_deli_right+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x7b,%eax
je     115a <get_deli_right+0x5a>
jmp    117e <get_deli_right+0x7e>
movl   $0x29,-0x4(%rbp)
jmp    1184 <get_deli_right+0x84>
movl   $0x7d,-0x4(%rbp)
jmp    1184 <get_deli_right+0x84>
movl   $0x5d,-0x4(%rbp)
jmp    1184 <get_deli_right+0x84>
movl   $0x3e,-0x4(%rbp)
jmp    1184 <get_deli_right+0x84>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_deli_right>:
mov    %edi,%eax
cmp    $0x5a,%edi
jg     1117 <get_deli_right+0x17>
cmp    $0x28,%eax
je     1127 <get_deli_right+0x27>
cmp    $0x3c,%eax
jne    1126 <get_deli_right+0x26>
mov    $0x3e,%eax
ret
cmp    $0x5b,%eax
je     112d <get_deli_right+0x2d>
cmp    $0x7b,%eax
jne    1126 <get_deli_right+0x26>
mov    $0x7d,%eax
ret
mov    $0x29,%eax
ret
mov    $0x5d,%eax
ret

LLVM IR (-O0):
define i32 @get_deli_right(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 40, label %5
i32 123, label %6
i32 91, label %7
i32 60, label %8
]
5: ; preds = %1
store i32 41, i32* %2
br label %11
6: ; preds = %1
store i32 125, i32* %2
br label %11
7: ; preds = %1
store i32 93, i32* %2
br label %11
8: ; preds = %1
store i32 62, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %8, %7, %6, %5
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @get_deli_right(i32 %0) {
switch i32 %0, label %5 [
i32 40, label %6
i32 123, label %2
i32 91, label %3
i32 60, label %4
]
2: ; preds = %1
br label %6
3: ; preds = %1
br label %6
4: ; preds = %1
br label %6
5: ; preds = %1
br label %6
6: ; preds = %1, %5, %4, %3, %2
%7 = phi i32 [ %0, %5 ], [ 62, %4 ], [ 93, %3 ], [ 125, %2 ], [ 41, %1 ]
ret i32 %7
}
void INT_Excep_TPU11_TCI11U(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU11_TCI11U() {
ret void
}
/* Variables and functions */
int after_use();
int bar() { return after_use(); }


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

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

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 (...) @after_use()
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @after_use()
ret i32 %1
}
void A(void) {}


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

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

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

LLVM IR (-O2):
define void @A() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_get_latency() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_get_latency"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"NOT IMPLEMENTED:pa_stream_get_latency\0A\00"
define i32 @pa_stream_get_latency() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_stream_get_latency\00"
define i32 @pa_stream_get_latency() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int dd_is_zero(const double *a) { return (a[0] == 0.0) ? 1 : 0; }


x86 assembly (clang, -O0):
<dd_is_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_is_zero>:
xorpd  %xmm0,%xmm0
cmpeqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @dd_is_zero(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fcmp oeq double %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @dd_is_zero(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp oeq double %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t rgph_f2u32(float f) {
  uint32_t res;
  union {
    float f;
    uint32_t u;
  } u = {f};
  res = u.u;
  return res;
}


x86 assembly (clang, -O0):
<rgph_f2u32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_f2u32>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { float }
define i32 @rgph_f2u32(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca %union.anon
store float %0, float* %2
%5 = bitcast %union.anon* %4 to float*
%6 = load float, float* %2
store float %6, float* %5
%7 = bitcast %union.anon* %4 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @rgph_f2u32(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}