xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pana_debug(char *);
void altReject() { pana_debug("altReject function"); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c"altReject function\00"
define void @altReject() {
%1 = tail call i32 @pana_debug(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int sendProtocol(int /*<<< orphan*/, int, long *);
int dbsvSendProtocol(int *clacnt, int protoNo, long *arg) {
  return sendProtocol(0, protoNo, arg);
}


x86 assembly (clang, -O0):
<dbsvSendProtocol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1030 <sendProtocol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbsvSendProtocol>:
xor    %edi,%edi
jmp    1030 <sendProtocol@plt>

LLVM IR (-O0):
define i32 @dbsvSendProtocol(i32* %0, i32 %1, i64* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i64*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i64* %2, i64** %6
%7 = load i32, i32* %5
%8 = load i64*, i64** %6
%9 = call i32 @sendProtocol(i32 0, i32 %7, i64* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @dbsvSendProtocol(i32* nocapture readnone %0, i32 %1, i64* %2) {
%4 = tail call i32 @sendProtocol(i32 0, i32 %1, i64* %2)
ret i32 %4
}
/* Variables and functions */
int printf(char *, double);
int print_double(double v) { return printf("%f", v); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @print_double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i32 %2
}
void busy_wait_nop(void) {}


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

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

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

LLVM IR (-O2):
define void @busy_wait_nop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_1_putc(char);
void uart_1_puts(char *str) {
  for (int i = 0; str[i] != '\0'; ++i) {
    uart_1_putc(str[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<uart_1_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <uart_1_puts+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_1_putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <uart_1_puts+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_1_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_1_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_1_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_1_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_1_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @uart_1_putc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double sin(double);
double opr_sin(struct lifo *stack) {
  double op = pop(stack);
  return sin(op);
}


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

x86 assembly (clang, -O2):
<opr_sin>:
push   %rax
call   1030 <pop@plt>
pop    %rax
jmp    1040 <sin@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_sin(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @sin(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_sin(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @sin(double %2)
ret double %3
}
int opposite_sign_numbers(int x, int y) { return (x ^ y) < 0; }


x86 assembly (clang, -O0):
<opposite_sign_numbers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opposite_sign_numbers>:
mov    %edi,%eax
xor    %esi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @opposite_sign_numbers(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 = xor i32 %5, %6
%8 = icmp slt i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @opposite_sign_numbers(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = lshr i32 %3, 31
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char toBeOverflown[3] = "ls";
  char overflow[5];
  gets(overflow);
  printf("overflow: %s", overflow);
  system(toBeOverflown);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x8(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    -0x3(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xa(%rsp)
movw   $0x736c,0x8(%rsp)
lea    0xb(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0x8(%rsp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.toBeOverflown = [3 x i8] c"ls\00"
@.str = [13 x i8] c"overflow: %s\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [5 x i8]
%3 = bitcast [3 x i8]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%9 = call i32 @system(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.toBeOverflown = [3 x i8] c"ls\00"
@.str = [13 x i8] c"overflow: %s\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @system(i8* %3)
ret i32 0
}
int dummy_func() { return 0; }


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

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

LLVM IR (-O0):
define i32 @dummy_func() {
ret i32 0
}

LLVM IR (-O2):
define i32 @dummy_func() {
ret i32 0
}
unsigned long DivideWithCeiling(unsigned long Dividend, unsigned long Divisor) {
  unsigned long Result;
  Result = Dividend / Divisor;
  if (Dividend % Divisor > 0)
    Result += 1;
  return Result;
}


x86 assembly (clang, -O0):
<DivideWithCeiling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
cmp    $0x0,%rdx
jbe    113e <DivideWithCeiling+0x3e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DivideWithCeiling>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <DivideWithCeiling+0x16>
xor    %edx,%edx
div    %rsi
jmp    111a <DivideWithCeiling+0x1a>
xor    %edx,%edx
div    %esi
cmp    $0x1,%rdx
sbb    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @DivideWithCeiling(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
%4 = urem i64 %0, %1
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = add i64 %3, %6
ret i64 %7
}
/* Variables and functions */
int O_CREAT;
int /*<<< orphan*/ __fortify_fail(char *);
int __openat(int, char const *, int);
int __openat_2(int fd, const char *file, int oflag) {
  if (oflag & O_CREAT)
    __fortify_fail("invalid openat call: O_CREAT without mode");
  return __openat(fd, file, oflag);
}


x86 assembly (clang, -O0):
<__openat_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ebc(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1153 <__openat_2+0x33>
lea    0xeb2(%rip),%rdi
call   1040 <__fortify_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <__openat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__openat_2>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    0x2ec6(%rip),%rax
test   %edx,(%rax)
je     1142 <__openat_2+0x22>
lea    0xec3(%rip),%rdi
call   1040 <__fortify_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__openat@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@.str = [42 x i8] c"invalid openat call: O_CREAT without mode\00"
define i32 @__openat_2(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* %6
%8 = load i32, i32* @O_CREAT
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @__fortify_fail(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @__openat(i32 %14, i8* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@.str = [42 x i8] c"invalid openat call: O_CREAT without mode\00"
define i32 @__openat_2(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @O_CREAT
%5 = and i32 %4, %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @__fortify_fail(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
%10 = tail call i32 @__openat(i32 %0, i8* %1, i32 %2)
ret i32 %10
}
void X509_to_X509_REQ(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_to_X509_REQ() {
ret void
}
/* Variables and functions */
char *memccpy(char *, char const *, int, scalar_t__);
scalar_t__ strlen(char const *);
char *strccpy(char *restrict whither, const char *restrict whence, int c) {
  char *r = memccpy(whither, whence, c, strlen(whence) + 1);
  if (r)
    *r = 0;
  return r;
}


x86 assembly (clang, -O0):
<strccpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    %rax,%rcx
add    $0x1,%rcx
call   1040 <memccpy@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117f <strccpy+0x5f>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strccpy>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rcx
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memccpy@plt>
test   %rax,%rax
je     114f <strccpy+0x2f>
movb   $0x0,(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strccpy(i8* noalias %0, i8* noalias nocapture %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @memccpy(i8* %0, i8* %1, i32 %2, i64 %5)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i8 0, i8* %6
br label %9
9: ; preds = %8, %3
ret i8* %6
}
int test_imm_25uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_25uint64_lowword_mem>:
testb  $0x25,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_25uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 37
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo696(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo696(i32 %0) {
ret void
}
int bq24261_get_bat_health(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @bq24261_get_bat_health() {
ret i32 0
}

LLVM IR (-O2):
define i32 @bq24261_get_bat_health() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SP_Unload(int);
void SP_Shutdown(void) { SP_Unload((0x01) | (0x02) | (0x04) | (0x08)); }


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

x86 assembly (clang, -O2):
<SP_Shutdown>:
mov    $0xf,%edi
jmp    1030 <SP_Unload@plt>

LLVM IR (-O0):
define void @SP_Shutdown() {
%1 = call i32 @SP_Unload(i32 15)
ret void
}

LLVM IR (-O2):
define void @SP_Shutdown() {
%1 = tail call i32 @SP_Unload(i32 15)
ret void
}
/* Variables and functions */
char *strdup(char *);
char *mpui_strdup(char *str) {
  if (!str)
    return str;
  return strdup(str);
}


x86 assembly (clang, -O0):
<mpui_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <mpui_strdup+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1141 <mpui_strdup+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpui_strdup>:
test   %rdi,%rdi
je     111a <mpui_strdup+0xa>
jmp    1030 <strdup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @mpui_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_add_tail(struct list_head *, struct list_head *);
void list_insert_before(struct list_head *new, struct list_head *node) {
  list_add_tail(new, node);
}


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

x86 assembly (clang, -O2):
<list_insert_before>:
jmp    1030 <list_add_tail@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_insert_before(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = load %struct.list_head*, %struct.list_head** %4
%7 = call i32 @list_add_tail(%struct.list_head* %5, %struct.list_head* %6)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_insert_before(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_add_tail(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Variables and functions */
long long bext_ll(long long *, long long *, long long *);
long long intr_wrap_525(long long p1, long long p2, long long p3) {
  return bext_ll(&p1, &p2, &p3);
}


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

x86 assembly (clang, -O2):
<intr_wrap_525>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
mov    %rdx,(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <bext_ll@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @intr_wrap_525(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 = call i64 @bext_ll(i64* %4, i64* %5, i64* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @intr_wrap_525(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 = call i64 @bext_ll(i64* %4, i64* %5, i64* %6)
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ system(char *);
void OpenWebLink(char *web) {
  char cmdline[128];
  snprintf(cmdline, 128, "./browser %s", web);
  system(cmdline);
}


x86 assembly (clang, -O0):
<OpenWebLink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x80,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenWebLink>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"./browser %s\00"
define void @OpenWebLink(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"./browser %s\00"
define void @OpenWebLink(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
ret void
}
int fun215() { return 215; }


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

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

LLVM IR (-O0):
define i32 @fun215() {
ret i32 215
}

LLVM IR (-O2):
define i32 @fun215() {
ret i32 215
}
int useWlanIfVirtIdx(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @useWlanIfVirtIdx() {
ret i32 0
}

LLVM IR (-O2):
define i32 @useWlanIfVirtIdx() {
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
int FileStat(const char *Path, struct stat *Buf) { return stat(Path, Buf); }


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

x86 assembly (clang, -O2):
<FileStat>:
jmp    1030 <stat@plt>

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @FileStat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @stat(i8* %0, %struct.stat* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memexport_put() {
  printf("NOT IMPLEMENTED:"
         "pa_memexport_put"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_memexport_put\00"
define i32 @pa_memexport_put() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int jump1(int *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main() {
  int nums[] = {2, 3, 1, 1, 4};
  printf("%d\n", jump1(nums, 5));
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1050 <jump1@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xed6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1050 <jump1@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @jump1(i32* %4, i32 5)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [5 x i32] [i32 2, i32 3, i32 1, i32 1, i32 4]
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"pause\00"
define i32 @main() {
%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
%4 = call i32 @jump1(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
R0AX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (r0 <= (((unsigned short *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<R0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movzwl -0x6(%rbp),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac7,%ecx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     1144 <R0AX1+0x44>
movl   $0x1,-0x4(%rbp)
jmp    114b <R0AX1+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<R0AX1>:
movzwl %di,%edx
movslq %ecx,%rax
movzwl 0xa98ac7(%rax,%rax,1),%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @R0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
%7 = and i32 %0, 65535
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %8
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = icmp ule i32 %7, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
void chkenv_end(void) {}


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

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

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

LLVM IR (-O2):
define void @chkenv_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ genericError(char *, int, unsigned int const,
                                unsigned int const);
void errorIdMismatch(const unsigned int id1, const unsigned int id2) {
  genericError("Id \"%d\" should be equal to \"%d\" but they are not! Exiting!",
               2, id1, id2);
}


x86 assembly (clang, -O0):
<errorIdMismatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
mov    $0x2,%esi
call   1030 <genericError@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorIdMismatch>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <genericError@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"Id \22%d\22 should be equal to \22%d\22 but they are not! Exiting!\00"
define void @errorIdMismatch(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 = call i32 @genericError(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 2, i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"Id \22%d\22 should be equal to \22%d\22 but they are not! Exiting!\00"
define void @errorIdMismatch(i32 %0, i32 %1) {
%3 = tail call i32 @genericError(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0), i32 2, i32 %0, i32 %1)
ret void
}
int main() {
  int i = 0;
  while (i <= 10) {
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ octet(scalar_t__);
int is_between(unsigned char a, unsigned char b, unsigned char c) {
  return octet(octet(b) - octet(a)) < octet(octet(c) - octet(a));
}


x86 assembly (clang, -O0):
<is_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,%edi
call   1030 <octet@plt>
mov    %rax,-0x20(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%edi
call   1030 <octet@plt>
mov    -0x20(%rbp),%rdi
sub    %rax,%rdi
call   1030 <octet@plt>
mov    %rax,-0x10(%rbp)
movzbl -0x3(%rbp),%eax
mov    %eax,%edi
call   1030 <octet@plt>
mov    %rax,-0x18(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%edi
call   1030 <octet@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
call   1030 <octet@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_between>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <octet@plt>
mov    %rax,%rbx
mov    %ebp,%ebp
mov    %rbp,%rdi
call   1030 <octet@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1030 <octet@plt>
mov    %rax,%r15
mov    %r14d,%edi
call   1030 <octet@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1030 <octet@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1030 <octet@plt>
xor    %ecx,%ecx
cmp    %rax,%r15
setl   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_between(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %5
%8 = zext i8 %7 to i64
%9 = call i64 @octet(i64 %8)
%10 = load i8, i8* %4
%11 = zext i8 %10 to i64
%12 = call i64 @octet(i64 %11)
%13 = sub nsw i64 %9, %12
%14 = call i64 @octet(i64 %13)
%15 = load i8, i8* %6
%16 = zext i8 %15 to i64
%17 = call i64 @octet(i64 %16)
%18 = load i8, i8* %4
%19 = zext i8 %18 to i64
%20 = call i64 @octet(i64 %19)
%21 = sub nsw i64 %17, %20
%22 = call i64 @octet(i64 %21)
%23 = icmp slt i64 %14, %22
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_between(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %1 to i64
%5 = tail call i64 @octet(i64 %4)
%6 = zext i8 %0 to i64
%7 = tail call i64 @octet(i64 %6)
%8 = sub nsw i64 %5, %7
%9 = tail call i64 @octet(i64 %8)
%10 = zext i8 %2 to i64
%11 = tail call i64 @octet(i64 %10)
%12 = tail call i64 @octet(i64 %6)
%13 = sub nsw i64 %11, %12
%14 = tail call i64 @octet(i64 %13)
%15 = icmp slt i64 %9, %14
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_connect;
int syscall(int /*<<< orphan*/, int, struct sockaddr_in *, int);
int xconnect(int fd, struct sockaddr_in *addr, int len) {
  return syscall((SYS_connect), fd, addr, len);
}


x86 assembly (clang, -O0):
<xconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xconnect>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@SYS_connect = global i32 0
define i32 @xconnect(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr_in*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr_in* %1, %struct.sockaddr_in** %5
store i32 %2, i32* %6
%7 = load i32, i32* @SYS_connect
%8 = load i32, i32* %4
%9 = load %struct.sockaddr_in*, %struct.sockaddr_in** %5
%10 = load i32, i32* %6
%11 = call i32 @syscall(i32 %7, i32 %8, %struct.sockaddr_in* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@SYS_connect = global i32 0
define i32 @xconnect(i32 %0, %struct.sockaddr_in* %1, i32 %2) {
%4 = load i32, i32* @SYS_connect
%5 = tail call i32 @syscall(i32 %4, i32 %0, %struct.sockaddr_in* %1, i32 %2)
ret i32 %5
}
unsigned char get_h0(unsigned char *byte) { return (*byte) & 0xf; }


x86 assembly (clang, -O0):
<get_h0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xf,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_h0>:
mov    (%rdi),%al
and    $0xf,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_h0(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @get_h0(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 15
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
bool file_exists(const char *path) { return access(path, F_OK) == 0; }


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_OK = global i32 0
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @file_exists(i8* nocapture %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void periph_init(void) {}


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

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

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

LLVM IR (-O2):
define void @periph_init() {
ret void
}
void benchmarkTeardownEach(char *outputFile) {}


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

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

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

LLVM IR (-O2):
define void @benchmarkTeardownEach(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void bail(const char *error) {
  fprintf(stderr, "%s\n", error);
  exit(1);
}


x86 assembly (clang, -O0):
<bail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<bail>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @bail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @bail(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int abs(int);
int sinal(int x) {
  if (!x)
    return (0);
  return (abs(x) / x);
}


x86 assembly (clang, -O0):
<sinal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sinal+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1140 <sinal+0x30>
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinal>:
mov    %edi,%eax
sar    $0x1f,%eax
or     $0x1,%eax
test   %edi,%edi
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sinal(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
double Sleef_asinh_u10(double x) { return __builtin_asinh(x); }


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

x86 assembly (clang, -O2):
<Sleef_asinh_u10>:
jmp    1030 <asinh@plt>

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

LLVM IR (-O2):
define double @Sleef_asinh_u10(double %0) {
%2 = tail call double @asinh(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *fun1(char *p) {
  printf("%s\n", p);
  return p;
}


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

x86 assembly (clang, -O2):
<fun1>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i8* @fun1(i8* returned %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %0
}
long long shr32(long long n) { return n >> 32; }


x86 assembly (clang, -O0):
<shr32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shr32>:
mov    %rdi,%rax
sar    $0x20,%rax
ret

LLVM IR (-O0):
define i64 @shr32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
ret i64 %4
}

LLVM IR (-O2):
define i64 @shr32(i64 %0) {
%2 = ashr i64 %0, 32
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ build(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  size_t itr;
  argc--;
  argv++;
  if (!argc) {
    printf("usage: %s [gmqcc.h location]\n", argv[-1]);
    return 0;
  }
  build(*argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1175 <main+0x55>
mov    -0x10(%rbp),%rax
mov    -0x8(%rax),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1181 <main+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <build@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1137 <main+0x17>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
jmp    1140 <main+0x20>
mov    0x8(%rsi),%rdi
call   1030 <build@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"usage: %s [gmqcc.h location]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 -1
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 0, i32* %3
br label %22
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = load i8*, i8** %19
%21 = call i32 @build(i8* %20)
br label %22
22: ; preds = %18, %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [30 x i8] c"usage: %s [gmqcc.h location]\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @build(i8* %9)
br label %11
11: ; preds = %7, %4
ret i32 0
}
int is_blank(char c) {
  int state = 34;
  switch (c) {
  case ' ':
    break;
  case '\n':
    break;
  case '\t':
    break;
  default:
    state = 0;
  }
  return state;
}


x86 assembly (clang, -O0):
<is_blank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x22,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x9,%eax
je     1152 <is_blank+0x52>
jmp    1126 <is_blank+0x26>
mov    -0xc(%rbp),%eax
sub    $0xa,%eax
je     114d <is_blank+0x4d>
jmp    1137 <is_blank+0x37>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
jne    1157 <is_blank+0x57>
jmp    1148 <is_blank+0x48>
jmp    115e <is_blank+0x5e>
jmp    115e <is_blank+0x5e>
jmp    115e <is_blank+0x5e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_blank>:
cmp    $0x20,%edi
ja     111d <is_blank+0x1d>
mov    $0x22,%eax
mov    %edi,%ecx
movabs $0x100000600,%rdx
bt     %rcx,%rdx
jae    111d <is_blank+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_blank(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 34, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 32, label %6
i32 10, label %7
i32 9, label %8
]
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
store i32 0, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_blank(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 32, label %4
i32 10, label %4
i32 9, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %3, %1, %1, %1
%5 = phi i32 [ 0, %3 ], [ 34, %1 ], [ 34, %1 ], [ 34, %1 ]
ret i32 %5
}