xunge/DecIR huggingface dataset:
char tohex(int n) {
  if (n >= 10 && n <= 15) {
    return 'A' + n - 10;
  }
  return '0' + n;
}


x86 assembly (clang, -O0):
<tohex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jl     112c <tohex+0x2c>
cmpl   $0xf,-0x8(%rbp)
jg     112c <tohex+0x2c>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1135 <tohex+0x35>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tohex>:
lea    -0xa(%rdi),%eax
cmp    $0x6,%eax
mov    $0x37,%ecx
mov    $0x30,%eax
cmovb  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @tohex(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 10
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 15
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 65, %10
%12 = sub nsw i32 %11, 10
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %18
14: ; preds = %6, %1
%15 = load i32, i32* %3
%16 = add nsw i32 48, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %18
18: ; preds = %14, %9
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @tohex(i32 %0) {
%2 = add i32 %0, -10
%3 = icmp ult i32 %2, 6
%4 = trunc i32 %0 to i8
%5 = select i1 %3, i8 55, i8 48
%6 = add i8 %5, %4
ret i8 %6
}
relvec(ptr) { free(ptr); }


x86 assembly (clang, -O0):
<relvec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<relvec>:
movslq %edi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define i32 @relvec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @relvec(i32 %0) {
%2 = sext i32 %0 to i64
%3 = inttoptr i64 %2 to i8*
tail call void @free(i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void logMsg(char *msg) {
  char log_str[119];
  strcpy(log_str, "Msg in: ");
  sprintf(log_str, "Msg in: %s", msg);
  strcpy(&(log_str[8]), msg);
  putchar('6');
  putchar('\n');
  return;
}


x86 assembly (clang, -O0):
<logMsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x80(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeab(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x80(%rbp),%rdi
add    $0x8,%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    $0x36,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logMsg>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
lea    0xeb6(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    $0x36,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Msg in: \00"
@.str.1 = [11 x i8] c"Msg in: %s\00"
define void @logMsg(i8* %0) {
%2 = alloca i8*
%3 = alloca [119 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [119 x i8], [119 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [119 x i8], [119 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [119 x i8], [119 x i8]* %3, i64 0, i64 8
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = call i32 @putchar(i8 signext 54)
%13 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Msg in: \00"
@.str.1 = [11 x i8] c"Msg in: %s\00"
define void @logMsg(i8* %0) {
%2 = alloca [119 x i8]
%3 = getelementptr inbounds [119 x i8], [119 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = getelementptr inbounds [119 x i8], [119 x i8]* %2, i64 0, i64 8
%7 = call i32 @strcpy(i8* %6, i8* %0)
%8 = call i32 @putchar(i8 signext 54)
%9 = call i32 @putchar(i8 signext 10)
ret void
}
OP(ed, f1) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
double asin(double);
double tosReal_asin(double x) { return asin(x); }


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

x86 assembly (clang, -O2):
<tosReal_asin>:
jmp    1030 <asin@plt>

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

LLVM IR (-O2):
define double @tosReal_asin(double %0) {
%2 = tail call double @asin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void sys_error(const char *msg, int line) {
  fprintf(stderr, "ERROR [%d: %s: %s]\n", line, msg, strerror(errno));
  exit(-1);
}


x86 assembly (clang, -O0):
<sys_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    %rax,%r8
lea    0xe85(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sys_error>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    0x2ea0(%rip),%rax
mov    (%rax),%ebp
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea9(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %r14,%rcx
mov    %rax,%r8
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"ERROR [%d: %s: %s]\0A\00"
@errno = global i32 0
define void @sys_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %6, i8* %7, i8* %9)
%11 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"ERROR [%d: %s: %s]\0A\00"
@errno = global i32 0
define void @sys_error(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %0, i8* %5)
%7 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
bool nrf53_errata_49(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_49() {
ret i32 0
}
void lmk_init_config(const char *path) {}


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

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

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

LLVM IR (-O2):
define void @lmk_init_config(i8* nocapture %0) {
ret void
}
int float_to_int() {
  double d = 1E100;
  return (int)d;
}


x86 assembly (clang, -O0):
<float_to_int>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @float_to_int() {
%1 = alloca double
store double 1.000000e+100, double* %1
%2 = load double, double* %1
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @float_to_int() {
ret i32 poison
}
/* Variables and functions */
int ENOTSUP;
int fegetround(void) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<fegetround>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    0x2edb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fegetround>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOTSUP = global i32 0
define i32 @fegetround() {
%1 = load i32, i32* @ENOTSUP
%2 = sub nsw i32 0, %1
ret i32 %2
}

LLVM IR (-O2):
@ENOTSUP = global i32 0
define i32 @fegetround() {
%1 = load i32, i32* @ENOTSUP
%2 = sub nsw i32 0, %1
ret i32 %2
}
int test_imm_89uint8_reg(unsigned char val) {
  return ((val) & (0x89 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_89uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -119
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int AF_INET;
int AF_INET6;
int /*<<< orphan*/ assert(int);
size_t PROTO_ADDRESS_SIZE(int proto) {
  assert(proto == AF_INET || proto == AF_INET6);
  return proto == AF_INET6 ? 16 : 4;
}


x86 assembly (clang, -O0):
<PROTO_ADDRESS_SIZE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ec1(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1144 <PROTO_ADDRESS_SIZE+0x34>
mov    -0x4(%rbp),%eax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edx
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%eax
mov    $0x10,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PROTO_ADDRESS_SIZE>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecb(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2eb7(%rip),%r14
cmp    %edi,(%r14)
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
cmp    %ebx,(%r14)
mov    $0x10,%ecx
mov    $0x4,%eax
cmove  %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i64 @PROTO_ADDRESS_SIZE(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @AF_INET
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @AF_INET6
%9 = icmp eq i32 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* @AF_INET6
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 16, i32 4
%19 = sext i32 %18 to i64
ret i64 %19
}

LLVM IR (-O2):
@AF_INET = global i32 0
@AF_INET6 = global i32 0
define i64 @PROTO_ADDRESS_SIZE(i32 %0) {
%2 = load i32, i32* @AF_INET
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @AF_INET6
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i32, i32* @AF_INET6
%10 = icmp eq i32 %9, %0
%11 = select i1 %10, i64 16, i64 4
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_pass(char *msg) {
  printf("%s", msg);
  printf("\x1B[32m");
  printf("%s", "PASS\n");
  printf("\x1B[0m");
}


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

x86 assembly (clang, -O2):
<print_pass>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb6(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.3 = [5 x i8] c"\1B[0m\00"
@str = [5 x i8] c"PASS\00"
define void @print_pass(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
double vde_chain_nm6_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<vde_chain_nm6_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <vde_chain_nm6_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <vde_chain_nm6_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <vde_chain_nm6_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <vde_chain_nm6_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm6_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @vde_chain_nm6_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
unsigned int ft_ullonglen(unsigned long long nbr) {
  unsigned int len;
  len = 1;
  while (nbr > 9) {
    nbr /= 10;
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_ullonglen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpq   $0x9,-0x8(%rbp)
jbe    113a <ft_ullonglen+0x3a>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_ullonglen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_ullonglen>:
mov    $0x1,%ecx
cmp    $0xa,%rdi
jb     1136 <ft_ullonglen+0x36>
mov    $0x1,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <ft_ullonglen+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_ullonglen(i64 %0) {
%2 = icmp ugt i64 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add i32 %4, 1
%8 = icmp ugt i64 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
double __builtin_HEXAGON_F2_dfadd(double, double);
double test2(double rss, double rtt) {
  return __builtin_HEXAGON_F2_dfadd(rss, rtt);
}


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

x86 assembly (clang, -O2):
<test2>:
jmp    1030 <__builtin_HEXAGON_F2_dfadd@plt>

LLVM IR (-O0):
define double @test2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__builtin_HEXAGON_F2_dfadd(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @test2(double %0, double %1) {
%3 = tail call double @__builtin_HEXAGON_F2_dfadd(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ bits_double(int /*<<< orphan*/);
int /*<<< orphan*/ box_double(int /*<<< orphan*/);
int /*<<< orphan*/ dpop();
int /*<<< orphan*/ to_unsigned_8(int /*<<< orphan*/);
void primitive_bits_double(void) {
  box_double(bits_double(to_unsigned_8(dpop())));
}


x86 assembly (clang, -O0):
<primitive_bits_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <to_unsigned_8@plt>
mov    %eax,%edi
call   1040 <bits_double@plt>
mov    %eax,%edi
call   1060 <box_double@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bits_double>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1050 <to_unsigned_8@plt>
mov    %eax,%edi
call   1040 <bits_double@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <box_double@plt>

LLVM IR (-O0):
define void @primitive_bits_double() {
%1 = call i32 (...) @dpop()
%2 = call i32 @to_unsigned_8(i32 %1)
%3 = call i32 @bits_double(i32 %2)
%4 = call i32 @box_double(i32 %3)
ret void
}

LLVM IR (-O2):
define void @primitive_bits_double() {
%1 = tail call i32 (...) @dpop()
%2 = tail call i32 @to_unsigned_8(i32 %1)
%3 = tail call i32 @bits_double(i32 %2)
%4 = tail call i32 @box_double(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void cpustat_normal_linebreak(void) { (void)putc('\n', stdout); }


x86 assembly (clang, -O0):
<cpustat_normal_linebreak>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpustat_normal_linebreak>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @cpustat_normal_linebreak() {
%1 = load i32, i32* @stdout
%2 = call i32 @putc(i8 signext 10, i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @cpustat_normal_linebreak() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @putc(i8 signext 10, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void jne_near_rj(unsigned int saut) {
  put8(0x0F);
  put8(0x85);
  put32(saut);
}


x86 assembly (clang, -O0):
<jne_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x85,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jne_near_rj>:
push   %rbx
mov    %edi,%ebx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x85,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jne_near_rj(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 133)
%5 = load i32, i32* %2
%6 = call i32 @put32(i32 %5)
ret void
}

LLVM IR (-O2):
define void @jne_near_rj(i32 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 133)
%4 = tail call i32 @put32(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ putchar(char);
int main() {
  char string[] = "Hello, there!\n";
  char *s;
  s = string;
  while (putchar(*s))
    s++;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
je     1176 <main+0x66>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    114f <main+0x3f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0xa216572656874,%rax
mov    %rax,0x7(%rsp)
movabs $0x74202c6f6c6c6548,%rax
2c 20 74
mov    %rax,(%rsp)
mov    $0x48,%edi
call   1030 <putchar@plt>
test   %rax,%rax
je     1161 <main+0x51>
lea    0x1(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1150 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.string = [15 x i8] c"Hello, there!\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @putchar(i8 signext 72)
%4 = icmp eq i64 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
br label %7
7: ; preds = %5, %7
%8 = phi i8* [ %6, %5 ], [ %12, %7 ]
%9 = load i8, i8* %8
%10 = tail call i64 @putchar(i8 signext %9)
%11 = icmp eq i64 %10, 0
%12 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %11, label %13, label %7
13: ; preds = %7, %0
ret i32 0
}
/* Variables and functions */
unsigned char msg_send2(int, unsigned char, unsigned char);
unsigned char ANT_SetChannelSearchTimeout(unsigned char chan,
                                          unsigned char timeout) {
  return msg_send2(0x44, chan, timeout);
}


x86 assembly (clang, -O0):
<ANT_SetChannelSearchTimeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
mov    $0x44,%edi
movzbl %al,%esi
movzbl -0x2(%rbp),%edx
call   1030 <msg_send2@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANT_SetChannelSearchTimeout>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x44,%edi
jmp    1030 <msg_send2@plt>

LLVM IR (-O0):
define zeroext i8 @ANT_SetChannelSearchTimeout(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call zeroext i8 @msg_send2(i32 68, i8 zeroext %5, i8 zeroext %6)
ret i8 %7
}

LLVM IR (-O2):
define zeroext i8 @ANT_SetChannelSearchTimeout(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call zeroext i8 @msg_send2(i32 68, i8 zeroext %0, i8 zeroext %1)
ret i8 %3
}
void SPI3_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI3_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
print_usage() {
  fprintf(stderr, "usage: ozz [params] [filein [fileout]]\n"
                  "  -q        quiet\n"
                  "  -v        verbose\n"
                  "  -p        get input from stdin\n"
                  "  -d        turns on debug prints\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [145 x i8] c"usage: ozz [params] [filein [fileout]]\0A -q quiet\0A -v verbose\0A -p get input from stdin\0A -d turns on debug prints\0A\00"
define i32 @print_usage() {
%1 = alloca i32
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [145 x i8] c"usage: ozz [params] [filein [fileout]]\0A -q quiet\0A -v verbose\0A -p get input from stdin\0A -d turns on debug prints\0A\00"
define i32 @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x40() {
  Assert_real((isbdigit(64) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              325, ("isbdigit should be 0 for @"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for @\00"
define void @t_isbdigit_0x40() {
%1 = tail call i64 @isbdigit(i32 64)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char readSerial();
int /*<<< orphan*/ writeSerial(char);
void main() {
  char val = 0;
  while (1) {
    val = readSerial();
    writeSerial(val);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <readSerial@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <writeSerial@plt>
jmp    112c <main+0xc>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <readSerial@plt>
movsbl %al,%edi
call   1040 <writeSerial@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %0, %2
%3 = call signext i8 (...) @readSerial()
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @writeSerial(i8 signext %4)
br label %2
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @readSerial()
%3 = tail call i32 @writeSerial(i8 signext %2)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
char *strchr(char const *, int);
char *trio_index_last(const char *string, int character) {
  assert(string);
  return strchr(string, character);
}


x86 assembly (clang, -O0):
<trio_index_last>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_index_last>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @trio_index_last(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 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @strchr(i8* %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @trio_index_last(i8* %0, i32 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %4
}
/* Type definitions */
struct pt_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_timer(struct pt_regs *);
void anakin_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) {
  do_timer(regs);
}


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

x86 assembly (clang, -O2):
<anakin_timer_interrupt>:
mov    %rdx,%rdi
jmp    1030 <do_timer@plt>

LLVM IR (-O0):
%struct.pt_regs = type { i32 }
define void @anakin_timer_interrupt(i32 %0, i8* %1, %struct.pt_regs* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.pt_regs*
store i32 %0, i32* %4
store i8* %1, i8** %5
store %struct.pt_regs* %2, %struct.pt_regs** %6
%7 = load %struct.pt_regs*, %struct.pt_regs** %6
%8 = call i32 @do_timer(%struct.pt_regs* %7)
ret void
}

LLVM IR (-O2):
%struct.pt_regs = type { i32 }
define void @anakin_timer_interrupt(i32 %0, i8* nocapture readnone %1, %struct.pt_regs* %2) {
%4 = tail call i32 @do_timer(%struct.pt_regs* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int open_null(char *path) {
  printf("Hello, this is a test!\n");
  printf("PATH: %s\n", path);
  return 0;
}


x86 assembly (clang, -O0):
<open_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_null>:
push   %rbx
mov    %rdi,%rbx
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hello, this is a test!\0A\00"
@.str.1 = [10 x i8] c"PATH: %s\0A\00"
define i32 @open_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"PATH: %s\0A\00"
@str = [23 x i8] c"Hello, this is a test!\00"
define i32 @open_null(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 0
}
void setval_328(unsigned *p) { *p = 3526935169U; }


x86 assembly (clang, -O0):
<setval_328>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xd238c281,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_328>:
movl   $0xd238c281,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_328(i32* nocapture writeonly %0) {
store i32 -768032127, i32* %0
ret void
}
int get_stuff() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_stuff() {
ret i32 0
}
void v2(register float *a) {
  register float t1, t2;
  t1 = a[0] + a[1];
  t2 = a[0] - a[1];
  a[0] = t1;
  a[1] = t2;
}


x86 assembly (clang, -O0):
<v2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<v2>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm1,%xmm0
movss  %xmm2,(%rdi)
movss  %xmm0,0x4(%rdi)
ret

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

LLVM IR (-O2):
define void @v2(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fadd float %2, %4
%6 = fsub float %2, %4
store float %5, float* %0
store float %6, float* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_ffs(int /*<<< orphan*/);
__attribute__((warn_unused_result)) int32_t
bitfield_find_first_set32(int32_t bitfield) {
  return __builtin_ffs(bitfield);
}


x86 assembly (clang, -O0):
<bitfield_find_first_set32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
bsf    %edx,%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitfield_find_first_set32>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @bitfield_find_first_set32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.cttz.i32(i32 %3, i1 true)
%5 = add i32 %4, 1
%6 = icmp eq i32 %3, 0
%7 = select i1 %6, i32 0, i32 %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @bitfield_find_first_set32(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = add nuw nsw i32 %2, 1
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
void ff_hevc_put_hevc_bi_w_qpel_v8_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_v8_12_sse4() {
ret void
}
int sum(int n) {
  if (n == 0)
    return 0;
  return n + sum(n - 1);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <sum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <sum+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
je     1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
scalar_t__ getenv(char *);
int in_android(void) {
  if (getenv("ANDROID_ROOT"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<in_android>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     113a <in_android+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <in_android+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_android>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"ANDROID_ROOT\00"
define i32 @in_android() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DMA6_DMA22_DriverIRQHandler();
__attribute__((weak)) void DMA6_DMA22_IRQHandler(void) {
  DMA6_DMA22_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA6_DMA22_IRQHandler() {
%1 = call i32 (...) @DMA6_DMA22_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA6_DMA22_IRQHandler() {
%1 = tail call i32 (...) @DMA6_DMA22_DriverIRQHandler()
ret void
}
void TestFunc() {
  write_line("Before first notification");
  __asm__ __volatile__("."
                       "loc1"
                       ": .byte 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00\n");
  write_line("Before second notification");
  __asm__ __volatile__("."
                       "loc2"
                       ": .byte 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00\n");
  write_line("After second notification");
}


x86 assembly (clang, -O0):
<TestFunc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <write_line@plt>

x86 assembly (clang, -O2):
<TestFunc>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <write_line@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Before first notification\00"
@.str.1 = [27 x i8] c"Before second notification\00"
@.str.2 = [26 x i8] c"After second notification\00"
define void @TestFunc() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @write_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @write_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @write_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Before first notification\00"
@.str.1 = [27 x i8] c"Before second notification\00"
@.str.2 = [26 x i8] c"After second notification\00"
define void @TestFunc() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
tail call void asm sideeffect ".loc1: .byte 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
tail call void asm sideeffect ".loc2: .byte 0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @write_line to i32 (i8*, ...)*)(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_winnwstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_winnwstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_winnwstr+0x2a>
jmp    1170 <cmd_winnwstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_winnwstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_winnwstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_winnwstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}