xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ errexit(int);
int getparam(char *, double *, int);
double gettime(char *s) {
  double t;
  if (getparam(s, &t, 127) != 2)
    errexit(2);
  return t;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x7f,%edx
call   1030 <getparam@plt>
cmp    $0x2,%eax
je     1151 <gettime+0x31>
mov    $0x2,%edi
call   1040 <errexit@plt>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
push   %rax
mov    %rsp,%rsi
mov    $0x7f,%edx
call   1030 <getparam@plt>
cmp    $0x2,%eax
je     113d <gettime+0x1d>
mov    $0x2,%edi
call   1040 <errexit@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gettime(i8* %0) {
%2 = alloca i8*
%3 = alloca double
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @getparam(i8* %4, double* %3, i32 127)
%6 = icmp ne i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @errexit(i32 2)
br label %9
9: ; preds = %7, %1
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @gettime(i8* %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = call i32 @getparam(i8* %0, double* %2, i32 127)
%5 = icmp eq i32 %4, 2
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @errexit(i32 2)
br label %8
8: ; preds = %6, %1
%9 = load double, double* %2
ret double %9
}
void circleprecision_(prec) int *prec;
{ circleprecision(*prec); }


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

x86 assembly (clang, -O2):
<circleprecision_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <circleprecision@plt>

LLVM IR (-O0):
define void @circleprecision_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @circleprecision to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @circleprecision_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @circleprecision to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ myfoo(int *);
int *valloc(int);
void vallocEscapeFreeUse() {
  int *p = valloc(12);
  myfoo(p);
  free(p);
  myfoo(p);
}


x86 assembly (clang, -O0):
<vallocEscapeFreeUse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1050 <valloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <myfoo@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <myfoo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vallocEscapeFreeUse>:
push   %rbx
mov    $0xc,%edi
call   1050 <valloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <myfoo@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <myfoo@plt>

LLVM IR (-O0):
define void @vallocEscapeFreeUse() {
%1 = alloca i32*
%2 = call i32* @valloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @myfoo(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
%7 = load i32*, i32** %1
%8 = call i32 @myfoo(i32* %7)
ret void
}

LLVM IR (-O2):
define void @vallocEscapeFreeUse() {
%1 = tail call i32* @valloc(i32 12)
%2 = tail call i32 @myfoo(i32* %1)
%3 = tail call i32 @free(i32* %1)
%4 = tail call i32 @myfoo(i32* %1)
ret void
}
/* Variables and functions */
int get_bit(int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n;
  n = get_bit(1024, 10);
  printf("%d\n", n);
  n = get_bit(98, 1);
  printf("%d\n", n);
  n = get_bit(1024, 0);
  printf("%d\n", n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
mov    $0xa,%esi
call   1040 <get_bit@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x62,%edi
mov    $0x1,%esi
call   1040 <get_bit@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0x400,%edi
xor    %esi,%esi
call   1040 <get_bit@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
mov    $0xa,%esi
call   1040 <get_bit@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x62,%edi
mov    $0x1,%esi
call   1040 <get_bit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x400,%edi
xor    %esi,%esi
call   1040 <get_bit@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @get_bit(i32 1024, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @get_bit(i32 98, i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @get_bit(i32 1024, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
unsigned char ScaleColor5to8(const unsigned int color) {
  return ((unsigned char)(((color) << 3) | ((color) >> 2)));
}


x86 assembly (clang, -O0):
<ScaleColor5to8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScaleColor5to8>:
lea    0x0(,%rdi,8),%eax
shr    $0x2,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @ScaleColor5to8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = load i32, i32* %2
%6 = lshr i32 %5, 2
%7 = or i32 %4, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define zeroext i8 @ScaleColor5to8(i32 %0) {
%2 = shl i32 %0, 3
%3 = lshr i32 %0, 2
%4 = or i32 %2, %3
%5 = trunc i32 %4 to i8
ret i8 %5
}
int test_imm_46uint8_reg(unsigned char val) {
  return ((val) & (-0x46 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_46uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -70
%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_46uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -70
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double pathcon_nm5_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<pathcon_nm5_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm5_twice>:
addsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathcon_nm5_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ ndsctl_print(char *);
void ndsctl_clients(void) { ndsctl_print("clients"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"clients\00"
define void @ndsctl_clients() {
%1 = call i32 @ndsctl_print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"clients\00"
define void @ndsctl_clients() {
%1 = tail call i32 @ndsctl_print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void win_func() {}


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

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

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

LLVM IR (-O2):
define void @win_func() {
ret void
}
void lpm_arch_init(void) {}


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

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

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

LLVM IR (-O2):
define void @lpm_arch_init() {
ret void
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int user_mode(struct pt_regs *);
__attribute__((always_)) int user_mode_vm(struct pt_regs *regs) {
  return user_mode(regs);
}


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

x86 assembly (clang, -O2):
<user_mode_vm>:
jmp    1030 <user_mode@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define i32 @user_mode_vm(%struct.pt_regs* %0) {
%2 = alloca %struct.pt_regs*
store %struct.pt_regs* %0, %struct.pt_regs** %2
%3 = load %struct.pt_regs*, %struct.pt_regs** %2
%4 = call i32 @user_mode(%struct.pt_regs* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define i32 @user_mode_vm(%struct.pt_regs* %0) {
%2 = tail call i32 @user_mode(%struct.pt_regs* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t f64u(uint64_t x) { return x ^ 1; }


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

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

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

LLVM IR (-O2):
define i32 @f64u(i32 %0) {
%2 = xor i32 %0, 1
ret i32 %2
}
void dummy_proc_4(int a0, int a1, int a2, int a3) { return; }


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

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

LLVM IR (-O0):
define void @dummy_proc_4(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 void
}

LLVM IR (-O2):
define void @dummy_proc_4(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x60() {
  Assert_real((isalpha(96) == 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_isalpha.c",
              485, ("isalpha should be 0 for `"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x60>:
push   %rax
mov    $0x60,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for `\00"
define void @t_isalpha_0x60() {
%1 = call i64 @isalpha(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for `\00"
define void @t_isalpha_0x60() {
%1 = tail call i64 @isalpha(i32 96)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 485, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sscanf(char *, char *, double *);
int get_value(char *str, double *val) {
  if (sscanf(str, "%lf", val) != 1) {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
cmp    $0x1,%eax
je     1149 <get_value+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1150 <get_value+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @get_value(i8* nocapture %0, double* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ spawn_prog(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void cphtml(char *src) {
  char cpb[512];
  sprintf(cpb,
          "cp %s "
          "/home/httpd/html/cgi-bin/update_status.html",
          src);
  spawn_prog(cpb);
}


x86 assembly (clang, -O0):
<cphtml>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x210(%rbp),%rdi
call   1030 <spawn_prog@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cphtml>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <spawn_prog@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"cp %s /home/httpd/html/cgi-bin/update_status.html\00"
define void @cphtml(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @spawn_prog(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"cp %s /home/httpd/html/cgi-bin/update_status.html\00"
define void @cphtml(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @spawn_prog(i8* %3)
ret void
}
/* Variables and functions */
float __ocml_log_f32(float);
float logf(float x) { return __ocml_log_f32(x); }


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

x86 assembly (clang, -O2):
<logf>:
jmp    1030 <__ocml_log_f32@plt>

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

LLVM IR (-O2):
define float @logf(float %0) {
%2 = tail call float @__ocml_log_f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int, size_t);
void __attribute__((weak)) __aeabi_memset8_impl2(void *dest, size_t n, int c) {
  memset(dest, c, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memset8_impl2>:
mov    %rsi,%rax
mov    %edx,%esi
mov    %rax,%rdx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memset8_impl2(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @memset(i8* %0, i32 %2, i64 %1)
ret void
}
int test_imm_65uint16_mem(unsigned short *val) {
  return ((*val) & (-0x65 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_65uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -101
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void INT_Excep_ICU_IRQ4(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ4() {
ret void
}
/* Type definitions */
struct sched_param {
  int /*<<< orphan*/ sched_priority;
};
typedef int /*<<< orphan*/ sched;

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ memset(struct sched_param *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sched_get_priority_max(int /*<<< orphan*/);
int /*<<< orphan*/ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                                      struct sched_param *);
void set_max_priority(void) {
  struct sched_param sched;
  memset(&sched, 0, sizeof(sched));
  sched.sched_priority = sched_get_priority_max(SCHED_FIFO);
  sched_setscheduler(0, SCHED_FIFO, &sched);
}


x86 assembly (clang, -O0):
<set_max_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <sched_get_priority_max@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_max_priority>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    0x2e9b(%rip),%rbx
mov    (%rbx),%edi
call   1050 <sched_get_priority_max@plt>
mov    %eax,(%rsp)
mov    (%rbx),%esi
xor    %edi,%edi
mov    %r14,%rdx
call   1030 <sched_setscheduler@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define void @set_max_priority() {
%1 = alloca %struct.sched_param
%2 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 4)
%3 = load i32, i32* @SCHED_FIFO
%4 = call i32 @sched_get_priority_max(i32 %3)
%5 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i32 %4, i32* %5
%6 = load i32, i32* @SCHED_FIFO
%7 = call i32 @sched_setscheduler(i32 0, i32 %6, %struct.sched_param* %1)
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define void @set_max_priority() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = call i32 @memset(%struct.sched_param* %1, i32 0, i32 4)
%4 = load i32, i32* @SCHED_FIFO
%5 = call i32 @sched_get_priority_max(i32 %4)
%6 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* @SCHED_FIFO
%8 = call i32 @sched_setscheduler(i32 0, i32 %7, %struct.sched_param* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("fft_rader_prime_radix2_test -- test Rader's alternate prime FFT\n");
  printf("    algorithm, compare to slow DFT method\n");
  printf("options (default values in []):\n");
  printf("  h     : print usage/help\n");
  printf("  n     : fft size (must be prime and greater than 2)\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"fft_rader_prime_radix2_test -- test Rader's alternate prime FFT\0A\00"
@.str.1 = [43 x i8] c" algorithm, compare to slow DFT method\0A\00"
@.str.2 = [33 x i8] c"options (default values in []):\0A\00"
@.str.3 = [28 x i8] c" h : print usage/help\0A\00"
@.str.4 = [55 x i8] c" n : fft size (must be prime and greater than 2)\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"fft_rader_prime_radix2_test -- test Rader's alternate prime FFT\00"
@str.5 = [42 x i8] c" algorithm, compare to slow DFT method\00"
@str.6 = [32 x i8] c"options (default values in []):\00"
@str.7 = [27 x i8] c" h : print usage/help\00"
@str.8 = [54 x i8] c" n : fft size (must be prime and greater than 2)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.8, i64 0, i64 0))
ret void
}
int char_to_ascii(int c) { return c > 0x7f ? 0 : c < ' ' ? 0 : c; }


x86 assembly (clang, -O0):
<char_to_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
jle    111b <char_to_ascii+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <char_to_ascii+0x3b>
cmpl   $0x20,-0x4(%rbp)
jge    112f <char_to_ascii+0x2f>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1135 <char_to_ascii+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_ascii>:
lea    -0x80(%rdi),%ecx
xor    %eax,%eax
cmp    $0xffffffa0,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @char_to_ascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 127
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 0, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ 0, %5 ], [ %13, %12 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @char_to_ascii(i32 %0) {
%2 = add i32 %0, -128
%3 = icmp ult i32 %2, -96
%4 = select i1 %3, i32 0, i32 %0
ret i32 %4
}
double dbl_flt_min2(double a, float b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<dbl_flt_min2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1135 <dbl_flt_min2+0x35>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1143 <dbl_flt_min2+0x43>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_flt_min2>:
cvtss2sd %xmm1,%xmm1
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dbl_flt_min2(double %0, float %1) {
%3 = alloca double
%4 = alloca float
store double %0, double* %3
store float %1, float* %4
%5 = load double, double* %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = fcmp olt double %5, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %3
br label %14
11: ; preds = %2
%12 = load float, float* %4
%13 = fpext float %12 to double
br label %14
14: ; preds = %11, %9
%15 = phi double [ %10, %9 ], [ %13, %11 ]
ret double %15
}

LLVM IR (-O2):
define double @dbl_flt_min2(double %0, float %1) {
%3 = fpext float %1 to double
%4 = fcmp ogt double %3, %0
%5 = select i1 %4, double %0, double %3
ret double %5
}
char ReadPrefs(void) {
  char result = 0;
  return (result);
}


x86 assembly (clang, -O0):
<ReadPrefs>:
push   %rbp
mov    %rsp,%rbp
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @ReadPrefs() {
%1 = alloca i8
store i8 0, i8* %1
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @ReadPrefs() {
ret i8 0
}
/* Type definitions */
struct argparse_option {
  int dummy;
};
struct argparse {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ argparse_usage(struct argparse *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int argparse_help_cb(struct argparse *self,
                     const struct argparse_option *option) {
  (void)option;
  argparse_usage(self);
  exit(EXIT_SUCCESS);
}


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

x86 assembly (clang, -O2):
<argparse_help_cb>:
push   %rax
call   1030 <argparse_usage@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* %1) {
%3 = alloca %struct.argparse*
%4 = alloca %struct.argparse_option*
store %struct.argparse* %0, %struct.argparse** %3
store %struct.argparse_option* %1, %struct.argparse_option** %4
%5 = load %struct.argparse_option*, %struct.argparse_option** %4
%6 = load %struct.argparse*, %struct.argparse** %3
%7 = call i32 @argparse_usage(%struct.argparse* %6)
%8 = load i32, i32* @EXIT_SUCCESS
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
%struct.argparse = type { i32 }
%struct.argparse_option = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @argparse_help_cb(%struct.argparse* %0, %struct.argparse_option* nocapture readnone %1) {
%3 = tail call i32 @argparse_usage(%struct.argparse* %0)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ write_time_prefix(int /*<<< orphan*/ *);
void log_message(const char *message, void *stream) {
  FILE *write_stream = (FILE *)stream;
  write_time_prefix(write_stream);
  fprintf(write_stream, "%s\n", message);
}


x86 assembly (clang, -O0):
<log_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <write_time_prefix@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_message>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <write_time_prefix@plt>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @log_message(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @write_time_prefix(i32* %8)
%10 = load i32*, i32** %5
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @log_message(i8* %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @write_time_prefix(i32* %3)
%5 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int division_by_zero() { return 100 / 0; }


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

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

LLVM IR (-O0):
define i32 @division_by_zero() {
ret i32 poison
}

LLVM IR (-O2):
define i32 @division_by_zero() {
ret i32 poison
}
/* Variables and functions */
int op_and(int, int);
int test_and() {
  if (op_and(3, 4) != (3 & 4))
    return (-1);
  if (op_and(2, 7) != (2 & 7))
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<test_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_and@plt>
cmp    $0x0,%eax
je     113c <test_and+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <test_and+0x57>
mov    $0x2,%edi
mov    $0x7,%esi
call   1030 <op_and@plt>
cmp    $0x2,%eax
je     1160 <test_and+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <test_and+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <op_and@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
je     112d <test_and+0x1d>
pop    %rcx
ret
mov    $0x2,%edi
mov    $0x7,%esi
call   1030 <op_and@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x2,%ecx
setne  %al
neg    %eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_and() {
%1 = tail call i32 @op_and(i32 3, i32 4)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @op_and(i32 2, i32 7)
%5 = icmp ne i32 %4, 2
%6 = sext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ -1, %0 ], [ %6, %3 ]
ret i32 %8
}
unsigned int endian_swap(unsigned int x) {
  return (x << 24) | ((x >> 8) & 0x0000FF00) | ((x << 8) & 0x00FF0000) |
         (x >> 24);
}


x86 assembly (clang, -O0):
<endian_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @endian_swap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 65280
%8 = or i32 %4, %7
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = and i32 %10, 16711680
%12 = or i32 %8, %11
%13 = load i32, i32* %2
%14 = lshr i32 %13, 24
%15 = or i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @endian_swap(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ uart_send(size_t *, unsigned char);
void uart_send_stream(uint32_t *uart, unsigned char *str) {
  uint32_t i = 0;
  while (str[i]) {
    uart_send(uart, str[i++]);
  }
}


x86 assembly (clang, -O0):
<uart_send_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <uart_send_stream+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rax,%rcx,1),%esi
call   1030 <uart_send@plt>
jmp    1128 <uart_send_stream+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_send_stream>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1146 <uart_send_stream+0x36>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %al,%esi
mov    %r14,%rdi
call   1030 <uart_send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <uart_send_stream+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @uart_send_stream(i64* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %8, %5 ], [ 0, %2 ]
%8 = add i64 %7, 1
%9 = tail call i32 @uart_send(i64* %0, i8 zeroext %6)
%10 = getelementptr inbounds i8, i8* %1, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int sum_s(int a, int b, int c) {
  if (a + b + c > 9)
    return (a + b + c) % 10;
  return a + b + c;
}


x86 assembly (clang, -O0):
<sum_s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    $0x9,%eax
jle    1138 <sum_s+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1144 <sum_s+0x44>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_s>:
mov    %edi,%eax
add    %esi,%eax
add    %edx,%eax
cmp    $0xa,%eax
jl     1129 <sum_s+0x29>
movslq %eax,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sum_s(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = icmp sgt i32 %5, 9
%7 = srem i32 %5, 10
%8 = select i1 %6, i32 %7, i32 %5
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socketpair(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
               int *);
int fd_pipe(int fd[2]) { return (socketpair(AF_UNIX, SOCK_STREAM, 0, fd)); }


x86 assembly (clang, -O0):
<fd_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rcx
xor    %edx,%edx
call   1030 <socketpair@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_pipe>:
mov    %rdi,%rcx
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socketpair@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @fd_pipe(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @AF_UNIX
%4 = load i32, i32* @SOCK_STREAM
%5 = load i32*, i32** %2
%6 = call i32 @socketpair(i32 %3, i32 %4, i32 0, i32* %5)
ret i32 %6
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
define i32 @fd_pipe(i32* %0) {
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = tail call i32 @socketpair(i32 %2, i32 %3, i32 0, i32* %0)
ret i32 %4
}
/* Variables and functions */
float nextafterf_custom(float, float);
float nextDown_f(double d) {
  float result = d;
  if (((double)result) <= d)
    return result;
  return nextafterf_custom(result, result - 1000000);
}


x86 assembly (clang, -O0):
<nextDown_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1152 <nextDown_f+0x42>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <nextDown_f+0x62>
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  0xe9c(%rip),%xmm2
subss  %xmm2,%xmm1
call   1030 <nextafterf_custom@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextDown_f>:
movaps %xmm0,%xmm1
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm2
ucomisd %xmm2,%xmm1
jae    1132 <nextDown_f+0x22>
movss  0xed7(%rip),%xmm1
addss  %xmm0,%xmm1
jmp    1030 <nextafterf_custom@plt>
ret

LLVM IR (-O0):
define float @nextDown_f(double %0) {
%2 = alloca float
%3 = alloca double
%4 = alloca float
store double %0, double* %3
%5 = load double, double* %3
%6 = fptrunc double %5 to float
store float %6, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = load double, double* %3
%10 = fcmp ole double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load float, float* %4
store float %12, float* %2
br label %18
13: ; preds = %1
%14 = load float, float* %4
%15 = load float, float* %4
%16 = fsub float %15, 1.000000e+06
%17 = call float @nextafterf_custom(float %14, float %16)
store float %17, float* %2
br label %18
18: ; preds = %13, %11
%19 = load float, float* %2
ret float %19
}

LLVM IR (-O2):
define float @nextDown_f(double %0) {
%2 = fptrunc double %0 to float
%3 = fpext float %2 to double
%4 = fcmp ugt double %3, %0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = fadd float %2, -1.000000e+06
%7 = tail call float @nextafterf_custom(float %2, float %6)
br label %8
8: ; preds = %1, %5
%9 = phi float [ %7, %5 ], [ %2, %1 ]
ret float %9
}
__attribute__((visibility("default"))) int eina_cpu_count(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @eina_cpu_count() {
ret i32 1
}

LLVM IR (-O2):
define i32 @eina_cpu_count() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Report(char *);
int astGLine(int n, const float *x, const float *y) {
  Report("astGLine");
  return 0;
}


x86 assembly (clang, -O0):
<astGLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <Report@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"astGLine\00"
define i32 @astGLine(i32 %0, float* nocapture readnone %1, float* nocapture readnone %2) {
%4 = tail call i32 @Report(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char toupper(char);
char *strupr(char *str) {
  char *p = str;
  while (*p) {
    *p = toupper(*p);
    p++;
  }
  return (str);
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupr+0x46>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int system(char *);
int has_sse(void) { return (system("has_sse.sh")); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"has_sse.sh\00"
define i32 @has_sse() {
%1 = call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"has_sse.sh\00"
define i32 @has_sse() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}