xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t am_util_math_dec_to_bcd(uint8_t ui8DecimalByte) {
  return (((ui8DecimalByte / 10) << 4) | (ui8DecimalByte % 10));
}


x86 assembly (clang, -O0):
<am_util_math_dec_to_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_util_math_dec_to_bcd>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @am_util_math_dec_to_bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @am_util_math_dec_to_bcd(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = or i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ streamtowrite(int, void const *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
int32_t univtowrite(int fd, const void *buff, uint32_t leng, uint32_t msecto) {
  return streamtowrite(fd, buff, leng, msecto);
}


x86 assembly (clang, -O0):
<univtowrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <streamtowrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<univtowrite>:
jmp    1030 <streamtowrite@plt>

LLVM IR (-O0):
define i32 @univtowrite(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @streamtowrite(i32 %9, i8* %10, i32 %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @univtowrite(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @streamtowrite(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %5
}
unsigned int_hash(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @int_hash(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ AcpiShutdown();
int Shutdown(int argc, char *argv[]) {
  AcpiShutdown();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @Shutdown(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @AcpiShutdown()
ret i32 0
}
int test10u(unsigned int x) { return x / 10U > 0; }


x86 assembly (clang, -O0):
<test10u>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10u>:
xor    %eax,%eax
cmp    $0xa,%edi
setae  %al
ret

LLVM IR (-O0):
define i32 @test10u(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = udiv i32 %3, 10
%5 = icmp ugt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test10u(i32 %0) {
%2 = icmp ugt i32 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
char _to_lower(char c) { return 'a' + (c - 'A'); }


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

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

LLVM IR (-O0):
define signext i8 @_to_lower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 65
%6 = add nsw i32 97, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @_to_lower(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
/* Type definitions */
struct timex {
  int dummy;
};

/* Variables and functions */
int adjtimex(struct timex *);
int ntp_adjtime(struct timex *buf) { return adjtimex(buf); }


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

x86 assembly (clang, -O2):
<ntp_adjtime>:
jmp    1030 <adjtimex@plt>

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

LLVM IR (-O2):
%struct.timex = type { i32 }
define i32 @ntp_adjtime(%struct.timex* %0) {
%2 = tail call i32 @adjtimex(%struct.timex* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ setup_AFR();
int /*<<< orphan*/ setup_IAT();
int /*<<< orphan*/ setup_MAP();
int /*<<< orphan*/ setup_VE();
int setup_fueling() {
  setup_MAP();
  setup_IAT();
  setup_AFR();
  setup_VE();
}


x86 assembly (clang, -O0):
<setup_fueling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <setup_MAP@plt>
mov    $0x0,%al
call   1060 <setup_IAT@plt>
mov    $0x0,%al
call   1050 <setup_AFR@plt>
mov    $0x0,%al
call   1040 <setup_VE@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_fueling>:
push   %rax
xor    %eax,%eax
call   1030 <setup_MAP@plt>
xor    %eax,%eax
call   1060 <setup_IAT@plt>
xor    %eax,%eax
call   1050 <setup_AFR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <setup_VE@plt>

LLVM IR (-O0):
define i32 @setup_fueling() {
%1 = alloca i32
%2 = call i32 (...) @setup_MAP()
%3 = call i32 (...) @setup_IAT()
%4 = call i32 (...) @setup_AFR()
%5 = call i32 (...) @setup_VE()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @setup_fueling() {
%1 = tail call i32 (...) @setup_MAP()
%2 = tail call i32 (...) @setup_IAT()
%3 = tail call i32 (...) @setup_AFR()
%4 = tail call i32 (...) @setup_VE()
ret i32 undef
}
/* Variables and functions */
scalar_t__ rintl(long double);
long lrintl(long double x) { return (long)rintl(x); }


x86 assembly (clang, -O0):
<lrintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <rintl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrintl>:
jmp    1030 <rintl@plt>

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

LLVM IR (-O2):
define i64 @lrintl(x86_fp80 %0) {
%2 = tail call i64 @rintl(x86_fp80 %0)
ret i64 %2
}
void SPI_LEDS_DisableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_LEDS_DisableRxInt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DaoWrappers_ClearGarbage2();
void DaoWrappers_ClearGarbage() { DaoWrappers_ClearGarbage2(); }


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

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

LLVM IR (-O0):
define void @DaoWrappers_ClearGarbage() {
%1 = call i32 (...) @DaoWrappers_ClearGarbage2()
ret void
}

LLVM IR (-O2):
define void @DaoWrappers_ClearGarbage() {
%1 = tail call i32 (...) @DaoWrappers_ClearGarbage2()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
void init_log() { openlog("ezsrve_proxy", 0, LOG_DAEMON); }


x86 assembly (clang, -O0):
<init_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
xor    %esi,%esi
call   1030 <openlog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_log>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
lea    0xee0(%rip),%rdi
xor    %esi,%esi
jmp    1030 <openlog@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"ezsrve_proxy\00"
@LOG_DAEMON = global i32 0
define void @init_log() {
%1 = load i32, i32* @LOG_DAEMON
%2 = call i32 @openlog(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"ezsrve_proxy\00"
@LOG_DAEMON = global i32 0
define void @init_log() {
%1 = load i32, i32* @LOG_DAEMON
%2 = tail call i32 @openlog(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
ret void
}
random(i, n) int i, n;
{
  if (i > n)
    error(0, "random Argument Error: i > n");
  n -= i;
  n = (n + 1.0) * ranf();
  return (i + n);
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    114a <random+0x2a>
xor    %edi,%edi
lea    0xec5(%rip),%rsi
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <ranf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
sub    %edi,%ebp
jge    113b <random+0x1b>
lea    0xed6(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1040 <error@plt>
cvtsi2sd %ebp,%xmm0
addsd  0xeb9(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <ranf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
cvttsd2si %xmm0,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"random Argument Error: i > n\00"
define i32 @random(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, %11
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = sitofp i32 %14 to double
%16 = fadd double %15, 1.000000e+00
%17 = call i32 (...) @ranf()
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = fptosi double %19 to i32
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
@.str = [29 x i8] c"random Argument Error: i > n\00"
define i32 @random(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = sub nsw i32 %1, %0
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 1.000000e+00
%10 = tail call i32 (...) @ranf()
%11 = sitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = fptosi double %12 to i32
%14 = add nsw i32 %13, %0
ret i32 %14
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t WatchdogValueGet(uint32_t ui32Base) {
  ASSERT((ui32Base == 0x40000000) || (ui32Base == 0x40001000));
  return ((*((volatile uint32_t *)(ui32Base + 0x00000004))));
}


x86 assembly (clang, -O0):
<WatchdogValueGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x40000000,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113a <WatchdogValueGet+0x2a>
cmpl   $0x40001000,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogValueGet>:
push   %rbx
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40000000,%eax
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x4(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @WatchdogValueGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1073741824
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1073745920
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @ASSERT(i32 %10)
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 4
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
%16 = load volatile i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @WatchdogValueGet(i32 %0) {
%2 = and i32 %0, -4097
%3 = icmp eq i32 %2, 1073741824
%4 = zext i1 %3 to i32
%5 = tail call i32 @ASSERT(i32 %4)
%6 = add nsw i32 %0, 4
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
ret i32 %9
}
/* Type definitions */
struct basic_block {
  int dummy;
};

/* Variables and functions */
int bb_reachable(struct basic_block *bb) { return bb != NULL; }


x86 assembly (clang, -O0):
<bb_reachable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bb_reachable>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

LLVM IR (-O0):
%struct.basic_block = type { i32 }
define i32 @bb_reachable(%struct.basic_block* %0) {
%2 = alloca %struct.basic_block*
store %struct.basic_block* %0, %struct.basic_block** %2
%3 = load %struct.basic_block*, %struct.basic_block** %2
%4 = icmp ne %struct.basic_block* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
%struct.basic_block = type { i32 }
define i32 @bb_reachable(%struct.basic_block* readnone %0) {
%2 = icmp ne %struct.basic_block* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
void *test_anti_range_93(long n) {
  extern void *alloc_anti_range_93(long) __attribute__((alloc_size(1)));
  if (0x7fffffffffffffffL - 2 <= n && n <= 0x7fffffffffffffffL - 1)
    n = 0x7fffffffffffffffL - 2 - 1;
  return alloc_anti_range_93(n);
}


x86 assembly (clang, -O0):
<test_anti_range_93>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x7ffffffffffffffd,%rax
ff ff 7f
cmp    -0x8(%rbp),%rax
jg     1152 <test_anti_range_93+0x42>
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
cmp    %rax,-0x8(%rbp)
jg     1152 <test_anti_range_93+0x42>
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_93@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_93>:
movabs $0x7ffffffffffffffc,%rax
ff ff 7f
lea    (%rdi,%rax,1),%rcx
add    $0x7,%rcx
cmp    $0x2,%rcx
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_93@plt>

LLVM IR (-O0):
define i8* @test_anti_range_93(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 9223372036854775805, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 9223372036854775806
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 9223372036854775804, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_93(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_93(i64 %0) {
%2 = add i64 %0, -9223372036854775805
%3 = icmp ult i64 %2, 2
%4 = select i1 %3, i64 9223372036854775804, i64 %0
%5 = tail call i8* @alloc_anti_range_93(i64 %4)
ret i8* %5
}
/* Type definitions */
struct remove_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ remove_cmdline_parser_release(struct remove_args_info *);
void remove_cmdline_parser_free(struct remove_args_info *args_info) {
  remove_cmdline_parser_release(args_info);
}


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

x86 assembly (clang, -O2):
<remove_cmdline_parser_free>:
jmp    1030 <remove_cmdline_parser_release@plt>

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

LLVM IR (-O2):
%struct.remove_args_info = type { i32 }
define void @remove_cmdline_parser_free(%struct.remove_args_info* %0) {
%2 = tail call i32 @remove_cmdline_parser_release(%struct.remove_args_info* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ calcolo(int /*<<< orphan*/);
int /*<<< orphan*/ input();
int /*<<< orphan*/ output();
int main() {
  calcolo(input());
  output();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <input@plt>
mov    %eax,%edi
call   1050 <calcolo@plt>
xor    %eax,%eax
call   1040 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @input()
%3 = call i32 @calcolo(i32 %2)
%4 = call i32 (...) @output()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @input()
%2 = tail call i32 @calcolo(i32 %1)
%3 = tail call i32 (...) @output()
ret i32 0
}
/* Variables and functions */
char *__bound_memcpy(char *, char const *, int);
int __bound_strlen(char const *);
char *__bound_strcpy(char *dst, const char *src) {
  int len;
  len = __bound_strlen(src);
  return __bound_memcpy(dst, src, len + 1);
}


x86 assembly (clang, -O0):
<__bound_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__bound_strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1030 <__bound_memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bound_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <__bound_strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__bound_memcpy@plt>

LLVM IR (-O0):
define i8* @__bound_strcpy(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 = call i32 @__bound_strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i8* @__bound_memcpy(i8* %8, i8* %9, i32 %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @__bound_strcpy(i8* %0, i8* %1) {
%3 = tail call i32 @__bound_strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = tail call i8* @__bound_memcpy(i8* %0, i8* %1, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ array_to_block(void *const);
int /*<<< orphan*/ free(int /*<<< orphan*/);
void xa_free(void *const xarray) {
  if (xarray != NULL) {
    free(array_to_block(xarray));
  }
}


x86 assembly (clang, -O0):
<xa_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <xa_free+0x27>
mov    -0x8(%rbp),%rdi
call   1040 <array_to_block@plt>
mov    %eax,%edi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xa_free>:
test   %rdi,%rdi
je     1133 <xa_free+0x13>
push   %rax
call   1040 <array_to_block@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @xa_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @array_to_block(i8* %0)
%5 = tail call i32 @free(i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ __sclearerr(int /*<<< orphan*/ *);
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
void clearerr(FILE *fp) {
  flockfile(fp);
  __sclearerr(fp);
  funlockfile(fp);
}


x86 assembly (clang, -O0):
<clearerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x8(%rbp),%rdi
call   1050 <__sclearerr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <funlockfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearerr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <flockfile@plt>
mov    %rbx,%rdi
call   1050 <__sclearerr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <funlockfile@plt>

LLVM IR (-O0):
define void @clearerr(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @flockfile(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @__sclearerr(i32* %5)
%7 = load i32*, i32** %2
%8 = call i32 @funlockfile(i32* %7)
ret void
}

LLVM IR (-O2):
define void @clearerr(i32* %0) {
%2 = tail call i32 @flockfile(i32* %0)
%3 = tail call i32 @__sclearerr(i32* %0)
%4 = tail call i32 @funlockfile(i32* %0)
ret void
}
myread(a, b) { printf("%d  %d", a, b); }


x86 assembly (clang, -O0):
<myread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myread>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\00"
define i32 @myread(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pattern(int n) {
  if (n <= 0)
    return;
  printf(" %d", n - 5);
  pattern(n - 5);
  printf(" %d", n);
}


x86 assembly (clang, -O0):
<pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     113a <pattern+0x1a>
jmp    1166 <pattern+0x46>
mov    -0x4(%rbp),%esi
sub    $0x5,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
sub    $0x5,%edi
call   1040 <pattern@plt>
mov    -0x4(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern>:
test   %edi,%edi
jle    1153 <pattern+0x33>
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    -0x5(%rbx),%ebp
lea    0xecc(%rip),%r14
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%edi
call   1040 <pattern@plt>
mov    %r14,%rdi
mov    %ebx,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @pattern(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = add nsw i32 %0, -5
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
tail call void @pattern(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ print_ft_name(int);
int /*<<< orphan*/ printf(char *, ...);
void print_ft(int f) {
  printf(" ft %d ", f);
  print_ft_name(f);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_ft>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <print_ft_name@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ft>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <print_ft_name@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c" ft %d \00"
define void @print_ft(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @print_ft_name(i32 %0)
%4 = tail call i32 @putchar(i32 10)
ret void
}
void end(void *a) {}


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

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

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

LLVM IR (-O2):
define void @end(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct VectorBase {
  int dummy;
};

/* Variables and functions */
size_t GetVectorSize(struct VectorBase *);
size_t get_vector_size(struct VectorBase *basev) {
  return GetVectorSize(basev);
}


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

x86 assembly (clang, -O2):
<get_vector_size>:
jmp    1030 <GetVectorSize@plt>

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

LLVM IR (-O2):
%struct.VectorBase = type { i32 }
define i64 @get_vector_size(%struct.VectorBase* %0) {
%2 = tail call i64 @GetVectorSize(%struct.VectorBase* %0)
ret i64 %2
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
void main() {
  int c;
  while ((c = getchar()) != '\n') {
    putchar((c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmp    $0xa,%eax
je     1173 <main+0x53>
cmpl   $0x41,-0x4(%rbp)
jl     1160 <main+0x40>
cmpl   $0x5a,-0x4(%rbp)
jg     1160 <main+0x40>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x46>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    1128 <main+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     114f <main+0x2f>
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edi
cmp    $0x1a,%ecx
cmovae %eax,%edi
call   1030 <putchar@plt>
jmp    1130 <main+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
br label %2
2: ; preds = %17, %0
%3 = call i32 (...) @getchar()
store i32 %3, i32* %1
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp sge i32 %6, 65
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %1
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 97
%14 = sub nsw i32 %13, 65
br label %17
15: ; preds = %8, %5
%16 = load i32, i32* %1
br label %17
17: ; preds = %15, %11
%18 = phi i32 [ %14, %11 ], [ %16, %15 ]
%19 = call i32 @putchar(i32 %18)
br label %2
20: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 10
br i1 %2, label %12, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %10, %3 ], [ %1, %0 ]
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = add nsw i32 %4, 32
%8 = select i1 %6, i32 %7, i32 %4
%9 = tail call i32 @putchar(i32 %8)
%10 = tail call i32 (...) @getchar()
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/);
int setfsuid(uid_t uid) { return syscall(215, uid); }


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

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

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

LLVM IR (-O2):
define i32 @setfsuid(i32 %0) {
%2 = tail call i32 @syscall(i32 215, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _mon_putc(char const);
void __attribute__((weak)) _mon_write(const char *s, unsigned int count) {
  if (!s)
    return;
  while (count) {
    _mon_putc(*s);
    s++;
    count--;
  }
}


x86 assembly (clang, -O0):
<_mon_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112f <_mon_write+0x1f>
jmp    1164 <_mon_write+0x54>
jmp    1134 <_mon_write+0x24>
cmpl   $0x0,-0xc(%rbp)
je     1164 <_mon_write+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <_mon_putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <_mon_write+0x24>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mon_write>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1143 <_mon_write+0x33>
test   %esi,%esi
je     1143 <_mon_write+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%edi
call   1030 <_mon_putc@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <_mon_write+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define weak void @_mon_write(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = phi i32 [ %12, %6 ], [ %1, %2 ]
%9 = load i8, i8* %7
%10 = tail call i32 @_mon_putc(i8 signext %9)
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = add i32 %8, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
double *mallocDouble(double val) {
  double *temp = (double *)malloc(sizeof(double));
  *temp = val;
  return temp;
}


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

x86 assembly (clang, -O2):
<mallocDouble>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x8,%edi
call   1030 <malloc@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define double* @mallocDouble(double %0) {
%2 = alloca double
%3 = alloca double*
store double %0, double* %2
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to double*
store double* %5, double** %3
%6 = load double, double* %2
%7 = load double*, double** %3
store double %6, double* %7
%8 = load double*, double** %3
ret double* %8
}

LLVM IR (-O2):
define double* @mallocDouble(double %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to double*
store double %0, double* %3
ret double* %3
}
int *foo() {
  int i;
  int array[5];
  for (i = 0; i < 5; i++) {
    array[i] = 17;
  }
  return array;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    112f <foo+0x2f>
movslq -0x4(%rbp),%rax
movl   $0x11,-0x20(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <foo+0xb>
lea    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x18(%rsp),%rax
ret

LLVM IR (-O0):
define i32* @foo() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %8
store i32 17, i32* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %3
13: ; preds = %3
%14 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
ret i32* %14
}

LLVM IR (-O2):
define noalias i32* @foo() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
ret i32* %3
}
/* Variables and functions */
int rand1();
int RandNum(int num) {
  long temp;
  if (num == 0)
    return (0);
  temp = (int)(rand1() * num);
  if (temp == num)
    return (0);
  else
    return ((int)temp);
}


x86 assembly (clang, -O0):
<RandNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <RandNum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1166 <RandNum+0x56>
mov    $0x0,%al
call   1030 <rand1@plt>
imul   -0x8(%rbp),%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jne    115f <RandNum+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1166 <RandNum+0x56>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandNum>:
test   %edi,%edi
je     1131 <RandNum+0x21>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <rand1@plt>
imul   %ebx,%eax
cmp    %ebx,%eax
cmove  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @RandNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %21
8: ; preds = %1
%9 = call i32 (...) @rand1()
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = sext i32 %11 to i64
store i64 %12, i64* %4
%13 = load i64, i64* %4
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = icmp eq i64 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %8
store i32 0, i32* %2
br label %21
18: ; preds = %8
%19 = load i64, i64* %4
%20 = trunc i64 %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %18, %17, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @RandNum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 (...) @rand1()
%5 = mul nsw i32 %4, %0
%6 = icmp eq i32 %5, %0
%7 = select i1 %6, i32 0, i32 %5
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *, char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Test the _APUE_H\n");
  err_sys("can't open %s", argv[1]);
  exit(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)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <err_sys@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rsi
lea    0xeb5(%rip),%rdi
call   1040 <err_sys@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Test the _APUE_H\0A\00"
@.str.1 = [14 x i8] c"can't open %s\00"
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 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @err_sys(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"can't open %s\00"
@str = [17 x i8] c"Test the _APUE_H\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int strlen(char *);
void remove_trail(char text[]) {
  int ln = strlen(text) - 1;
  if (text[ln] == '\n') {
    text[ln] = '\0';
  }
}


x86 assembly (clang, -O0):
<remove_trail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    114c <remove_trail+0x3c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_trail>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1127 <remove_trail+0x17>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @remove_trail(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %1
store i8 0, i8* %5
br label %9
9: ; preds = %8, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ meta_version_inc();
scalar_t__ of_checknode(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ of_newnode(int /*<<< orphan*/, int /*<<< orphan*/);
int of_mr_acquire(uint32_t sessionid, uint32_t inode) {
  if (of_checknode(sessionid, inode)) {
    return 32;
  }
  of_newnode(sessionid, inode);
  meta_version_inc();
  return 0;
}


x86 assembly (clang, -O0):
<of_mr_acquire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <of_checknode@plt>
cmp    $0x0,%rax
je     115f <of_mr_acquire+0x2f>
movl   $0x20,-0x4(%rbp)
jmp    1178 <of_mr_acquire+0x48>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <of_newnode@plt>
mov    $0x0,%al
call   1050 <meta_version_inc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_mr_acquire>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <of_checknode@plt>
mov    $0x20,%ebx
test   %rax,%rax
jne    115b <of_mr_acquire+0x2b>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <of_newnode@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <meta_version_inc@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @of_mr_acquire(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i64 @of_checknode(i32 %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 32, i32* %3
br label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @of_newnode(i32 %12, i32 %13)
%15 = call i32 (...) @meta_version_inc()
store i32 0, i32* %3
br label %16
16: ; preds = %11, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @of_mr_acquire(i32 %0, i32 %1) {
%3 = tail call i64 @of_checknode(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @of_newnode(i32 %0, i32 %1)
%7 = tail call i32 (...) @meta_version_inc()
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 32, %2 ]
ret i32 %9
}
long long r6(void *x) { return *(long long *)(x + 32762); }


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

x86 assembly (clang, -O2):
<r6>:
mov    0x7ffa(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @r6(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr i8, i8* %3, i64 32762
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @r6(i8* nocapture %0) {
%2 = getelementptr i8, i8* %0, i64 32762
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo();
int main() {
  if (foo() != 28)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x1c,%eax
je     1156 <main+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x1c,%eax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo()
%3 = icmp ne i32 %2, 28
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 28
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int open(const char *name, int oflag, ...) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int fun731() { return 731; }


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

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

LLVM IR (-O0):
define i32 @fun731() {
ret i32 731
}

LLVM IR (-O2):
define i32 @fun731() {
ret i32 731
}
int baz(void) {
  struct foo;
  struct foo {
    struct bar *k;
  };
  struct foo;
  struct undefined {
    int p;
  };
}


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

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

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

LLVM IR (-O2):
define i32 @baz() {
ret i32 undef
}