xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ get_executable_path(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char path[PATH_MAX];
  get_executable_path(path, sizeof(path));
  printf("this program is in the directory %s\n", path);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
mov    %eax,%esi
call   1040 <get_executable_path@plt>
mov    -0x20(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <get_executable_path@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [37 x i8] c"this program is in the directory %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 0, i32* %1
%4 = load i32, i32* @PATH_MAX
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i8, i64 %5
store i64 %5, i64* %3
%8 = trunc i64 %5 to i32
%9 = call i32 @get_executable_path(i8* %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 0, i32* %1
%11 = load i8*, i8** %2
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [37 x i8] c"this program is in the directory %s\0A\00"
define i32 @main() {
%1 = load i32, i32* @PATH_MAX
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @get_executable_path(i8* %3, i32 %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int Problem053() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @Problem053() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void error(char *error) { printf("%s", error); }


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

x86 assembly (clang, -O2):
<error>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int mscb_lock(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @mscb_lock(i32 %0) {
ret i32 1
}
/* Type definitions */
struct mat2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat2_scale(float *, float *, float);
__attribute__((always_)) struct mat2 *psmat2_scale(struct mat2 *result,
                                                   struct mat2 *m, float s) {
  mat2_scale((float *)result, (float *)m, s);
  return result;
}


x86 assembly (clang, -O0):
<psmat2_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movss  -0x14(%rbp),%xmm0
call   1030 <mat2_scale@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_scale(%struct.mat2* %0, %struct.mat2* %1, float %2) {
%4 = alloca %struct.mat2*
%5 = alloca %struct.mat2*
%6 = alloca float
store %struct.mat2* %0, %struct.mat2** %4
store %struct.mat2* %1, %struct.mat2** %5
store float %2, float* %6
%7 = load %struct.mat2*, %struct.mat2** %4
%8 = bitcast %struct.mat2* %7 to float*
%9 = load %struct.mat2*, %struct.mat2** %5
%10 = bitcast %struct.mat2* %9 to float*
%11 = load float, float* %6
%12 = call i32 @mat2_scale(float* %8, float* %10, float %11)
%13 = load %struct.mat2*, %struct.mat2** %4
ret %struct.mat2* %13
}

LLVM IR (-O2):
%struct.mat2 = type { i32 }
define %struct.mat2* @psmat2_scale(%struct.mat2* returned %0, %struct.mat2* %1, float %2) {
%4 = bitcast %struct.mat2* %0 to float*
%5 = bitcast %struct.mat2* %1 to float*
%6 = tail call i32 @mat2_scale(float* %4, float* %5, float %2)
ret %struct.mat2* %0
}
/* Variables and functions */
double RAND_MAX;
double rand();
double randomDouble(double begin, double end) {
  double random = begin + ((end - begin) * (rand() / (RAND_MAX * 1.0)));
  return random;
}


x86 assembly (clang, -O0):
<randomDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xea9(%rip),%xmm3
mov    0x2e8a(%rip),%rax
mulsd  (%rax),%xmm3
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomDouble>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2eb6(%rip),%rax
divsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @randomDouble(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = call double (...) @rand()
%11 = load double, double* @RAND_MAX
%12 = fmul double %11, 1.000000e+00
%13 = fdiv double %10, %12
%14 = call double @llvm.fmuladd.f64(double %9, double %13, double %6)
store double %14, double* %5
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @randomDouble(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double (...) @rand()
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = tail call double @llvm.fmuladd.f64(double %3, double %6, double %0)
ret double %7
}
/* Type definitions */
typedef int u_int16_t;

/* Variables and functions */
int ipsec_validate_notification(u_int16_t type) {
  return type < 24576 || type > 24578 ? -1 : 0;
}


x86 assembly (clang, -O0):
<ipsec_validate_notification>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x6000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <ipsec_validate_notification+0x26>
cmpl   $0x6002,-0x4(%rbp)
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
xor    %eax,%eax
mov    $0xffffffff,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipsec_validate_notification>:
add    $0xffff9ffd,%edi
cmp    $0xfffffffd,%edi
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ipsec_validate_notification(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 24576
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 24578
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 -1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @ipsec_validate_notification(i32 %0) {
%2 = add i32 %0, -24579
%3 = icmp ult i32 %2, -3
%4 = sext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct ir_remote {
  int dummy;
};
struct ir_ncode {
  int dummy;
};

/* Variables and functions */
int init_send_or_sim(struct ir_remote *, struct ir_ncode *, int /*<<< orphan*/,
                     int /*<<< orphan*/);
int init_send(struct ir_remote *remote, struct ir_ncode *code) {
  return init_send_or_sim(remote, code, 0, 0);
}


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

x86 assembly (clang, -O2):
<init_send>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <init_send_or_sim@plt>

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
%struct.ir_ncode = type { i32 }
define i32 @init_send(%struct.ir_remote* %0, %struct.ir_ncode* %1) {
%3 = alloca %struct.ir_remote*
%4 = alloca %struct.ir_ncode*
store %struct.ir_remote* %0, %struct.ir_remote** %3
store %struct.ir_ncode* %1, %struct.ir_ncode** %4
%5 = load %struct.ir_remote*, %struct.ir_remote** %3
%6 = load %struct.ir_ncode*, %struct.ir_ncode** %4
%7 = call i32 @init_send_or_sim(%struct.ir_remote* %5, %struct.ir_ncode* %6, i32 0, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
%struct.ir_ncode = type { i32 }
define i32 @init_send(%struct.ir_remote* %0, %struct.ir_ncode* %1) {
%3 = tail call i32 @init_send_or_sim(%struct.ir_remote* %0, %struct.ir_ncode* %1, i32 0, i32 0)
ret i32 %3
}
void RCCE_fence() { return; }


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

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

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

LLVM IR (-O2):
define void @RCCE_fence() {
ret void
}
int test_imm_76uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x76 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_76uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 118
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void _infix_operator_div_u64_u64(unsigned long long lhs, unsigned long long rhs,
                                 unsigned long long *__rval_1) {
  *__rval_1 = lhs / rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_div_u64_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_div_u64_u64>:
mov    %rdx,%rcx
mov    %rdi,%rax
mov    %rdi,%rdx
or     %rsi,%rdx
shr    $0x20,%rdx
je     111b <_infix_operator_div_u64_u64+0x1b>
xor    %edx,%edx
div    %rsi
mov    %rax,(%rcx)
ret
xor    %edx,%edx
div    %esi
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @_infix_operator_div_u64_u64(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = udiv i64 %7, %8
%10 = load i64*, i64** %6
store i64 %9, i64* %10
ret void
}

LLVM IR (-O2):
define void @_infix_operator_div_u64_u64(i64 %0, i64 %1, i64* nocapture writeonly %2) {
%4 = udiv i64 %0, %1
store i64 %4, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
void err_exit(int err, const char *prefix) {
  printf("%s err %d\n", prefix, err);
}


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

x86 assembly (clang, -O2):
<err_exit>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s err %d\0A\00"
define void @err_exit(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t clip(int v) {
  if (v < 0)
    return 0;
  if (v > 255)
    return 255;
  return v;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <clip+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113c <clip+0x3c>
cmpl   $0xff,-0x8(%rbp)
jle    1136 <clip+0x36>
movl   $0xff,-0x4(%rbp)
jmp    113c <clip+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clip(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterIntClear(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000001C))) = 0x00000001;
  (*((volatile unsigned long *)(ui32Base + 0x00000018))) = 0x00000001;
}


x86 assembly (clang, -O0):
<I2CMasterIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1,0x1c(%rax)
mov    -0x8(%rbp),%rax
movq   $0x1,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntClear>:
movq   $0x1,0x1c(%rdi)
movq   $0x1,0x18(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 28
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
%6 = load i64, i64* %2
%7 = add nsw i64 %6, 24
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntClear(i64 %0) {
%2 = add nsw i64 %0, 28
%3 = inttoptr i64 %2 to i64*
store volatile i64 1, i64* %3
%4 = add nsw i64 %0, 24
%5 = inttoptr i64 %4 to i64*
store volatile i64 1, i64* %5
ret void
}
/* Variables and functions */
int key();
void back() {
  while (key() != 10)
    ;
}


x86 assembly (clang, -O0):
<back>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <back+0x9>
mov    $0x0,%al
call   1030 <key@plt>
cmp    $0xa,%eax
je     112e <back+0x1e>
jmp    1119 <back+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<back>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <key@plt>
cmp    $0xa,%eax
jne    1120 <back+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @back() {
br label %1
1: ; preds = %4, %0
%2 = call i32 (...) @key()
%3 = icmp ne i32 %2, 10
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @back() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @key()
%3 = icmp eq i32 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int execv(char *, char **);
int /*<<< orphan*/ perror(char *);
void runcmd(char *shortcmd, char *fullcmd, char **argv) {
  int status = execv(fullcmd, argv);
  if (status < 0)
    perror(shortcmd);
  _exit(1);
}


x86 assembly (clang, -O0):
<runcmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <execv@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1167 <runcmd+0x37>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<runcmd>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1050 <execv@plt>
test   %eax,%eax
jns    114b <runcmd+0x1b>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @runcmd(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %5
%9 = load i8**, i8*** %6
%10 = call i32 @execv(i8* %8, i8** %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i8*, i8** %4
%15 = call i32 @perror(i8* %14)
br label %16
16: ; preds = %13, %3
%17 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @runcmd(i8* nocapture %0, i8* %1, i8** %2) {
%4 = tail call i32 @execv(i8* %1, i8** %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* %0)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @_exit(i32 1)
unreachable
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int htons(int);
void _int16_t_tbetb(int16_t x, char *buffer, int offset) {
  x = htons(x);
  *(buffer + offset) = (char)((x >> 8) & 0xFF);
  *(buffer + offset + 1) = (char)(x & 0xFF);
}


x86 assembly (clang, -O0):
<_int16_t_tbetb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,0x1(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_int16_t_tbetb>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
call   1030 <htons@plt>
movslq %ebx,%rcx
rol    $0x8,%ax
mov    %ax,(%r14,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @_int16_t_tbetb(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @htons(i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 %12, i8* %16
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %19, i8* %24
ret void
}

LLVM IR (-O2):
define void @_int16_t_tbetb(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @htons(i32 %0)
%5 = lshr i32 %4, 8
%6 = trunc i32 %5 to i8
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %1, i64 %7
store i8 %6, i8* %8
%9 = trunc i32 %4 to i8
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %9, i8* %10
ret void
}
unsigned xrop3_44_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | S;
  stk2 = T & stk3;
  stk1 = S ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_44_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_44_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%edx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     $0xff,%ecx
and    %eax,%ecx
xor    %edx,%ecx
not    %eax
or     %ecx,%eax
and    %edx,%eax
not    %edi
and    %esi,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_44_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %6
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = and i32 %32, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = or i32 %34, %38
%40 = load i32, i32* %7
%41 = load i32, i32* %6
%42 = xor i32 %41, -1
%43 = and i32 %40, %42
%44 = load i32, i32* %5
%45 = and i32 %43, %44
%46 = or i32 %39, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_44_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %9, %5
%11 = xor i32 %7, -1
%12 = or i32 %10, %11
%13 = and i32 %12, %5
%14 = xor i32 %3, -1
%15 = and i32 %14, %6
%16 = or i32 %13, %15
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_pun(void) { printf("To C, or not to C: that is the question.\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"To C, or not to C: that is the question.\0A\00"
define void @print_pun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"To C, or not to C: that is the question.\00"
define void @print_pun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, long, long);
int /*<<< orphan*/ stdout;
void progress(long cur, long end) {
  printf("%li/%li\r", cur, end);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%li/%li\0D\00"
@stdout = global i32 0
define void @progress(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
%8 = load i32, i32* @stdout
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%li/%li\0D\00"
@stdout = global i32 0
define void @progress(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stdout;
void usage() {
  printf(""
         "Usage:\n"
         "    %s [FLAGS]... [PATH]\n"
         "\n"
         "Flags available to use:\n"
         "1) -v, --version    Output version details and exit.\n"
         "2) -h, --help    Output this help and exist.\n"
         "\nExapmle: %s example.asm\n",
         "stmp", "stmp");
  fflush(stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xf73(%rip),%rdx
mov    %rdx,%rsi
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xf76(%rip),%rdx
mov    %rdx,%rsi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [181 x i8] c"Usage:\0A %s [FLAGS]... [PATH]\0A\0AFlags available to use:\0A1) -v, --version Output version details and exit.\0A2) -h, --help Output this help and exist.\0A\0AExapmle: %s example.asm\0A\00"
@.str.1 = [5 x i8] c"stmp\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [181 x i8] c"Usage:\0A %s [FLAGS]... [PATH]\0A\0AFlags available to use:\0A1) -v, --version Output version details and exit.\0A2) -h, --help Output this help and exist.\0A\0AExapmle: %s example.asm\0A\00"
@.str.1 = [5 x i8] c"stmp\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([181 x i8], [181 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int test_imm_DBuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xDB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_DBuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 219
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long test_lrint(double x) { return __builtin_lrint(x); }


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

x86 assembly (clang, -O2):
<test_lrint>:
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i64 @test_lrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @lrint(double %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @test_lrint(double %0) {
%2 = tail call i64 @lrint(double %0)
ret i64 %2
}
void debugpins_fsm_clr() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_fsm_clr() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_dimension_of_standard_solutions(int *dimension) {
  int *a, fail;
  double *c;
  fail = _ada_use_c2phc4c(33, a, dimension, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_dimension_of_standard_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x21,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_dimension_of_standard_solutions>:
mov    %rdi,%rdx
mov    $0x21,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_dimension_of_standard_solutions(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %3
%7 = load i32*, i32** %2
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc4c(i32 33, i32* %6, i32* %7, double* %8, i32 0)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_dimension_of_standard_solutions(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc4c(i32 33, i32* undef, i32* %0, double* undef, i32 0)
ret i32 %2
}
/* Type definitions */
typedef int off_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int lseek(int, int, int);
int /*<<< orphan*/ stderr;
void slseek(int fd, off_t offset, int whence) {
  off_t ret;
  ret = lseek(fd, offset, whence);
  if (ret == (-1)) {
    fprintf(stderr, "cannot lseek()\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<slseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <lseek@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    117f <slseek+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slseek>:
push   %rax
call   1030 <lseek@plt>
cmp    $0xffffffff,%eax
je     113d <slseek+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"cannot lseek()\0A\00"
@EXIT_FAILURE = global i32 0
define void @slseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @lseek(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %19
14: ; preds = %3
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"cannot lseek()\0A\00"
@EXIT_FAILURE = global i32 0
define void @slseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @lseek(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
int ld_bge_cr2(long double a1) { return !(__builtin_isgreaterequal(100, a1)); }


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

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

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

LLVM IR (-O2):
define i32 @ld_bge_cr2(x86_fp80 %0) {
%2 = fcmp ugt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int cgetc();
int cgetw();
int /*<<< orphan*/ cputs(char *);
int /*<<< orphan*/ cwait(int);
int /*<<< orphan*/ printf(char *, int, int, int);
void test(void) {
  int a, b, c;
  cputs("$OK");
  cwait(('o' << 8) | 'k');
  a = cgetc();
  b = cgetc();
  c = cgetw();
  cwait(0x0a0d);
  printf("test: Cnt=%d Alive=%d SelfTest=%d\n", a, b, c);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <cputs@plt>
mov    $0x6f6b,%edi
call   1030 <cwait@plt>
mov    $0x0,%al
call   1060 <cgetc@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <cgetc@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1070 <cgetw@plt>
mov    %eax,-0xc(%rbp)
mov    $0xa0d,%edi
call   1030 <cwait@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %r14
push   %rbx
lea    0xea5(%rip),%rdi
call   1050 <cputs@plt>
mov    $0x6f6b,%edi
call   1030 <cwait@plt>
xor    %eax,%eax
call   1060 <cgetc@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <cgetc@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1070 <cgetw@plt>
mov    %eax,%ebx
mov    $0xa0d,%edi
call   1030 <cwait@plt>
lea    0xe6d(%rip),%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"$OK\00"
@.str.1 = [35 x i8] c"test: Cnt=%d Alive=%d SelfTest=%d\0A\00"
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @cputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @cwait(i32 28523)
%6 = call i32 (...) @cgetc()
store i32 %6, i32* %1
%7 = call i32 (...) @cgetc()
store i32 %7, i32* %2
%8 = call i32 (...) @cgetw()
store i32 %8, i32* %3
%9 = call i32 @cwait(i32 2573)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"$OK\00"
@.str.1 = [35 x i8] c"test: Cnt=%d Alive=%d SelfTest=%d\0A\00"
define void @test() {
%1 = tail call i32 @cputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cwait(i32 28523)
%3 = tail call i32 (...) @cgetc()
%4 = tail call i32 (...) @cgetc()
%5 = tail call i32 (...) @cgetw()
%6 = tail call i32 @cwait(i32 2573)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4, i32 %5)
ret void
}
int security_file_ioctl(struct file *file, unsigned int cmd,
                        unsigned long arg) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.file = type opaque
define i32 @security_file_ioctl(%struct.file* %0, i32 %1, i64 %2) {
%4 = alloca %struct.file*
%5 = alloca i32
%6 = alloca i64
store %struct.file* %0, %struct.file** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
ret i32 0
}

LLVM IR (-O2):
%struct.file = type opaque
define i32 @security_file_ioctl(%struct.file* nocapture readnone %0, i32 %1, i64 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double const);
int /*<<< orphan*/ putchar(char);
void show_array(const double ar[], int n) {
  int i;
  for (i = 0; i < n; i++)
    printf("%8.3f", ar[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<show_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <show_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <show_array+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <show_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <show_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%8.3f\00"
define void @show_array(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Atest();
int main(int argc, char **argv) {
  Atest();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @Atest()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Atest()
ret i32 0
}
/* Variables and functions */
int date_get_dayofyear();
int is_day_of_star(void) { return date_get_dayofyear() % 5 == 0; }


x86 assembly (clang, -O0):
<is_day_of_star>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <date_get_dayofyear@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_day_of_star>:
push   %rax
xor    %eax,%eax
call   1030 <date_get_dayofyear@plt>
imul   $0xcccccccd,%eax,%ecx
add    $0x19999999,%ecx
xor    %eax,%eax
cmp    $0x33333333,%ecx
setb   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_day_of_star() {
%1 = call i32 (...) @date_get_dayofyear()
%2 = srem i32 %1, 5
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @is_day_of_star() {
%1 = tail call i32 (...) @date_get_dayofyear()
%2 = srem i32 %1, 5
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_mutex_t;
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex,
                           const struct timespec *abstime) {
  return 1;
}


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

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @pthread_cond_timedwait(i32* %0, i32* %1, %struct.timespec* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca %struct.timespec*
store i32* %0, i32** %4
store i32* %1, i32** %5
store %struct.timespec* %2, %struct.timespec** %6
ret i32 1
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @pthread_cond_timedwait(i32* nocapture readnone %0, i32* nocapture readnone %1, %struct.timespec* nocapture readnone %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
char *strdup(char const *);
char *xstrdup(const char *str) {
  char *str2 = strdup(str);
  if (str2 == NULL)
    fatal("strdup: out of memory");
  return str2;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1030 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"strdup: out of memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [22 x i8] c"strdup: out of memory\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char **alisp_license();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void license(void) {
  char **s;
  s = alisp_license();
  while (*s) {
    printf("%s\n", *s);
    s++;
  }
  exit(0);
}


x86 assembly (clang, -O0):
<license>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <alisp_license@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1175 <license+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <license+0x13>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<license>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <alisp_license@plt>
mov    (%rax),%rsi
test   %rsi,%rsi
je     1174 <license+0x44>
mov    %rax,%rbx
add    $0x8,%rbx
lea    0xeaf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1160 <license+0x30>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @license() {
%1 = tail call i8** (...) @alisp_license()
%2 = load i8*, i8** %1
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i8* [ %9, %4 ], [ %2, %0 ]
%6 = phi i8** [ %8, %4 ], [ %1, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %0
%12 = tail call i32 @exit(i32 0)
unreachable
}