xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
unsigned long VIM_MARB_GetNowCapFrameCount(void) {
  unsigned long Temp = 0;
  Temp = (unsigned long)VIM_HIF_GetReg8((0x2400 + 0x073));
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x072))) << 8;
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x071))) << 16;
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x070))) << 24;
  return Temp;
}


x86 assembly (clang, -O0):
<VIM_MARB_GetNowCapFrameCount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x2473,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2472,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x2471,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x2470,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x18,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_GetNowCapFrameCount>:
push   %r14
push   %rbx
push   %rax
mov    $0x2473,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
mov    $0x2472,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%rbx
shl    $0x8,%rbx
or     %r14,%rbx
mov    $0x2471,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
shl    $0x10,%r14
mov    $0x2470,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x18,%rax
or     %r14,%rax
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @VIM_MARB_GetNowCapFrameCount() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @VIM_HIF_GetReg8(i32 9331)
store i64 %2, i64* %1
%3 = call i64 @VIM_HIF_GetReg8(i32 9330)
%4 = shl i64 %3, 8
%5 = load i64, i64* %1
%6 = or i64 %5, %4
store i64 %6, i64* %1
%7 = call i64 @VIM_HIF_GetReg8(i32 9329)
%8 = shl i64 %7, 16
%9 = load i64, i64* %1
%10 = or i64 %9, %8
store i64 %10, i64* %1
%11 = call i64 @VIM_HIF_GetReg8(i32 9328)
%12 = shl i64 %11, 24
%13 = load i64, i64* %1
%14 = or i64 %13, %12
store i64 %14, i64* %1
%15 = load i64, i64* %1
ret i64 %15
}

LLVM IR (-O2):
define i64 @VIM_MARB_GetNowCapFrameCount() {
%1 = tail call i64 @VIM_HIF_GetReg8(i32 9331)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 9330)
%3 = shl i64 %2, 8
%4 = or i64 %3, %1
%5 = tail call i64 @VIM_HIF_GetReg8(i32 9329)
%6 = shl i64 %5, 16
%7 = or i64 %4, %6
%8 = tail call i64 @VIM_HIF_GetReg8(i32 9328)
%9 = shl i64 %8, 24
%10 = or i64 %7, %9
ret i64 %10
}
extern void *memset(void *s, char c, int count) {
  __asm__("cld\n\t"
          "rep\n\t"
          "stosb" ::"a"(c),
          "D"(s), "c"(count));
  return s;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%ecx
cld
rep stos %al,%es:(%rdi)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %edx,%ecx
mov    %esi,%eax
cld
rep stos %al,%es:(%rdi)
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned %0, i8 signext %1, i32 %2) {
tail call void asm sideeffect "cld\0A\09rep\0A\09stosb", "{ax},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i8 %1, i8* %0, i32 %2)
ret i8* %0
}
/* Variables and functions */
long INT_MAX;
long strtol(char *, char **, int);
int parseId(char *id) {
  char *endptr;
  long res;
  res = strtol(id, &endptr, 10);
  if (*endptr != '\0' || res <= 0 || res >= INT_MAX) {
    return -1;
  }
  return res;
}


x86 assembly (clang, -O0):
<parseId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1161 <parseId+0x51>
cmpq   $0x0,-0x20(%rbp)
jle    1161 <parseId+0x51>
mov    -0x20(%rbp),%rax
mov    0x2e90(%rip),%rcx
cmp    (%rcx),%rax
jl     116d <parseId+0x5d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <parseId+0x64>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseId>:
push   %rax
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%rax
mov    $0xffffffff,%ecx
cmovl  %eax,%ecx
mov    $0xffffffff,%edx
test   %rax,%rax
cmovle %edx,%ecx
mov    (%rsp),%rax
xor    %edx,%edx
cmp    (%rax),%dl
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@INT_MAX = global i64 0
define i32 @parseId(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strtol(i8* %6, i8** %4, i32 10)
store i64 %7, i64* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %1
%13 = load i64, i64* %5
%14 = icmp sle i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = load i64, i64* %5
%17 = load i64, i64* @INT_MAX
%18 = icmp sge i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15, %12, %1
store i32 -1, i32* %2
br label %23
20: ; preds = %15
%21 = load i64, i64* %5
%22 = trunc i64 %21 to i32
store i32 %22, i32* %2
br label %23
23: ; preds = %20, %19
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
@INT_MAX = global i64 0
define i32 @parseId(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp sgt i64 %4, 0
%9 = select i1 %7, i1 %8, i1 false
%10 = load i64, i64* @INT_MAX
%11 = icmp slt i64 %4, %10
%12 = select i1 %9, i1 %11, i1 false
%13 = trunc i64 %4 to i32
%14 = select i1 %12, i32 %13, i32 -1
ret i32 %14
}
float kPhysicsWorldScale() { return 0.05f; }


x86 assembly (clang, -O0):
<kPhysicsWorldScale>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<kPhysicsWorldScale>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @kPhysicsWorldScale() {
ret float 0x3FA99999A0000000
}

LLVM IR (-O2):
define float @kPhysicsWorldScale() {
ret float 0x3FA99999A0000000
}
/* Variables and functions */
int /*<<< orphan*/ abort();
main() {
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int malloc_error(const char *err) {
  fprintf(stderr, "Failed to allocate the field %s.\n", err);
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<malloc_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Failed to allocate the field %s.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @malloc_error(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 ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
ret i32 %6
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Failed to allocate the field %s.\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @malloc_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
ret i32 %4
}
void warn_err() {
  do {
    char *msg;
    if ((msg = errmsg_err()) != ((void *)0)) {
      do_dispatch_message(msg);
      free(msg);
    } else {
      fallback_warn();
    }
  } while (0);
}


x86 assembly (clang, -O0):
<warn_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <errmsg_err@plt>
cltq
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1178 <warn_err+0x38>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1060 <do_dispatch_message@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
jmp    117f <warn_err+0x3f>
mov    $0x0,%al
call   1050 <fallback_warn@plt>
jmp    1184 <warn_err+0x44>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warn_err>:
push   %rbx
xor    %eax,%eax
call   1040 <errmsg_err@plt>
test   %eax,%eax
je     1162 <warn_err+0x22>
movslq %eax,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <do_dispatch_message@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <fallback_warn@plt>

LLVM IR (-O0):
define void @warn_err() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 (...) @errmsg_err()
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %1
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @do_dispatch_message to i32 (i8*, ...)*)(i8* %8)
%10 = load i8*, i8** %1
br label %13
11: ; preds = %2
%12 = call i32 (...) @fallback_warn()
br label %13
13: ; preds = %11, %7
br label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @warn_err() {
%1 = tail call i32 (...) @errmsg_err()
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @do_dispatch_message to i32 (i8*, ...)*)(i8* %3)
tail call void @free(i8* %3)
br label %9
7: ; preds = %0
%8 = tail call i32 (...) @fallback_warn()
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
void check(int bequal) {
  if (bequal) {
    printf("find\n");
  } else {
    perror("false\n");
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <check+0x26>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <check+0x32>
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1130 <check+0x10>
lea    0xedc(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xec9(%rip),%rdi
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"find\0A\00"
@.str.1 = [7 x i8] c"false\0A\00"
define void @check(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"false\0A\00"
@str = [5 x i8] c"find\00"
define void @check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_submatrix(double **b, long nrl, long nrh, long ncl, long nch) {
  free((char *)(b + nrl - 1));
}


x86 assembly (clang, -O0):
<free_submatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_submatrix>:
lea    (%rdi,%rsi,8),%rdi
add    $0xfffffffffffffff8,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_submatrix(double** %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca double**
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store double** %0, double*** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%11 = load double**, double*** %6
%12 = load i64, i64* %7
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = getelementptr inbounds double*, double** %13, i64 -1
%15 = bitcast double** %14 to i8*
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @free_submatrix(double** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds double*, double** %0, i64 %1
%7 = getelementptr inbounds double*, double** %6, i64 -1
%8 = bitcast double** %7 to i8*
%9 = tail call i32 @free(i8* %8)
ret void
}
unsigned int ipStringToInt(char *str) {}


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

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

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

LLVM IR (-O2):
define i32 @ipStringToInt(i8* nocapture readnone %0) {
ret i32 undef
}
/* Type definitions */
struct room {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ append_room(struct room **, char *, char *,
                               int /*<<< orphan*/, int /*<<< orphan*/,
                               int /*<<< orphan*/);
int rooms_linkedlist_create(struct room **rooms) {
  append_room(rooms, "", "", 0, 0, 0);
  return (0);
}


x86 assembly (clang, -O0):
<rooms_linkedlist_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rdx
xor    %r9d,%r9d
mov    %rdx,%rsi
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <append_room@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rooms_linkedlist_create>:
push   %rax
lea    0xee8(%rip),%rdx
mov    %rdx,%rsi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <append_room@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.room = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @rooms_linkedlist_create(%struct.room** %0) {
%2 = alloca %struct.room**
store %struct.room** %0, %struct.room*** %2
%3 = load %struct.room**, %struct.room*** %2
%4 = call i32 @append_room(%struct.room** %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.room = type { i32 }
@.str = [1 x i8] zeroinitializer
define i32 @rooms_linkedlist_create(%struct.room** %0) {
%2 = tail call i32 @append_room(%struct.room** %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0)
ret i32 0
}
int ValArrayDefaultCompareFn(const void *pleft, const void *pright) {
  const unsigned *left = pleft, *right = pright;
  return *left < *right ? -1 : (*left > *right ? 1 : 0);
}


x86 assembly (clang, -O0):
<ValArrayDefaultCompareFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%eax
jae    113b <ValArrayDefaultCompareFn+0x3b>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1156 <ValArrayDefaultCompareFn+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ValArrayDefaultCompareFn>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
seta   %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ValArrayDefaultCompareFn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = icmp ult i32 %12, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %25
17: ; preds = %2
%18 = load i32*, i32** %5
%19 = load i32, i32* %18
%20 = load i32*, i32** %6
%21 = load i32, i32* %20
%22 = icmp ugt i32 %19, %21
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
br label %25
25: ; preds = %17, %16
%26 = phi i32 [ -1, %16 ], [ %24, %17 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @ValArrayDefaultCompareFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ult i32 %5, %6
%8 = icmp ugt i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
int test_imm_16int64_lowword_reg(long long val) {
  return ((val) & (0x16 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_16int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 22
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ list_dir(char *);
int main(int argc, const char *argv[]) {
  list_dir("~");
  list_dir("/tmp");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"~\00"
@.str.1 = [5 x i8] c"/tmp\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @list_dir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @list_dir(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ata_wait_for_bsy();
int ata_wait_for_rdy(void) {
  ata_wait_for_bsy();
  return (*((volatile unsigned char *)0x06200206)) & 0x40;
}


x86 assembly (clang, -O0):
<ata_wait_for_rdy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ata_wait_for_bsy@plt>
mov    $0x6200206,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x40,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ata_wait_for_rdy>:
push   %rax
xor    %eax,%eax
call   1030 <ata_wait_for_bsy@plt>
movzbl 0x6200206,%eax
06
and    $0x40,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ata_wait_for_rdy() {
%1 = call i32 (...) @ata_wait_for_bsy()
%2 = load volatile i8, i8* inttoptr (i64 102760966 to i8*)
%3 = zext i8 %2 to i32
%4 = and i32 %3, 64
ret i32 %4
}

LLVM IR (-O2):
define i32 @ata_wait_for_rdy() {
%1 = tail call i32 (...) @ata_wait_for_bsy()
%2 = load volatile i8, i8* inttoptr (i64 102760966 to i8*)
%3 = and i8 %2, 64
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
long timer_to_time(int /*<<< orphan*/);
long qfits_time_now(void) {
  struct timeval time_struct;
  gettimeofday(&time_struct, 0);
  return (timer_to_time(time_struct.tv_sec) + time_struct.tv_usec / 10000);
}


x86 assembly (clang, -O0):
<qfits_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    -0x4(%rbp),%edi
call   1040 <timer_to_time@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2710,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfits_time_now>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%edi
call   1040 <timer_to_time@plt>
movslq (%rsp),%rcx
imul   $0x68db8bad,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @qfits_time_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i32, i32* %3
%5 = call i64 @timer_to_time(i32 %4)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 10000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @qfits_time_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i32, i32* %4
%6 = call i64 @timer_to_time(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 10000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
void __attribute__((__no__)) copy(long *a, long *b) { *b = *a; }


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
mov    (%rdi),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @copy(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = load i64*, i64** %4
store i64 %6, i64* %7
ret void
}

LLVM IR (-O2):
define void @copy(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
store i64 %3, i64* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x1a() {
  Assert_real((isxdigit(26) == 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_isxdigit.c",
              135, ("isxdigit should be 0 for 0x1a"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x1a>:
push   %rax
mov    $0x1a,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x87,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1a\00"
define void @t_isxdigit_0x1a() {
%1 = call i64 @isxdigit(i32 26)
%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 135, i8* getelementptr inbounds ([30 x i8], [30 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x1a\00"
define void @t_isxdigit_0x1a() {
%1 = tail call i64 @isxdigit(i32 26)
%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 135, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void set_voice_bank(int bank) {}


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

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

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

LLVM IR (-O2):
define void @set_voice_bank(i32 %0) {
ret void
}
void glTexStorage2D(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glTexStorage2D() {
ret void
}
OP(fd, df) { op_df(); }


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 <op_df@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
xor    %eax,%eax
jmp    1030 <op_df@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 (...) @op_df()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_df()
ret i32 undef
}
/* Variables and functions */
unsigned int do_csum(void const *, int);
unsigned int csum_partial(const void *buff, int len, unsigned int wsum) {
  unsigned int sum = (unsigned int)wsum;
  unsigned int result = do_csum(buff, len);
  result += sum;
  if (sum > result)
    result += 1;
  return (unsigned int)result;
}


x86 assembly (clang, -O0):
<csum_partial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <do_csum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jbe    1155 <csum_partial+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csum_partial>:
push   %rbx
mov    %edx,%ebx
call   1030 <do_csum@plt>
add    %ebx,%eax
adc    $0x0,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @csum_partial(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @do_csum(i8* %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = add i32 %14, %13
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = icmp ugt i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load i32, i32* %8
%21 = add i32 %20, 1
store i32 %21, i32* %8
br label %22
22: ; preds = %19, %3
%23 = load i32, i32* %8
ret i32 %23
}

LLVM IR (-O2):
define i32 @csum_partial(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @do_csum(i8* %0, i32 %1)
%5 = add i32 %4, %2
%6 = icmp ult i32 %5, %2
%7 = zext i1 %6 to i32
%8 = add i32 %5, %7
ret i32 %8
}
/* Variables and functions */
void *null_code_init(int k, int m, int hd) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @null_code_init(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @null_code_init(i32 %0, i32 %1, i32 %2) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ box_double(double);
int /*<<< orphan*/ dpop();
double untag_float_fast(int /*<<< orphan*/);
void primitive_float_subtract(void) {
  double y = untag_float_fast(dpop());
  double x = untag_float_fast(dpop());
  ;
  box_double(x - y);
}


x86 assembly (clang, -O0):
<primitive_float_subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1050 <box_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_float_subtract>:
push   %rax
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <dpop@plt>
mov    %eax,%edi
call   1040 <untag_float_fast@plt>
subsd  (%rsp),%xmm0
pop    %rax
jmp    1050 <box_double@plt>

LLVM IR (-O0):
define void @primitive_float_subtract() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (...) @dpop()
%4 = call double @untag_float_fast(i32 %3)
store double %4, double* %1
%5 = call i32 (...) @dpop()
%6 = call double @untag_float_fast(i32 %5)
store double %6, double* %2
%7 = load double, double* %2
%8 = load double, double* %1
%9 = fsub double %7, %8
%10 = call i32 @box_double(double %9)
ret void
}

LLVM IR (-O2):
define void @primitive_float_subtract() {
%1 = tail call i32 (...) @dpop()
%2 = tail call double @untag_float_fast(i32 %1)
%3 = tail call i32 (...) @dpop()
%4 = tail call double @untag_float_fast(i32 %3)
%5 = fsub double %4, %2
%6 = tail call i32 @box_double(double %5)
ret void
}
void Counter_2_RestoreConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Counter_2_RestoreConfig() {
ret void
}
/* Variables and functions */
char *getClassPath();
int /*<<< orphan*/ parseClassPath(char *);
void initClassPath() {
  char *classpath = getClassPath();
  parseClassPath(classpath);
}


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

x86 assembly (clang, -O2):
<initClassPath>:
push   %rax
xor    %eax,%eax
call   1030 <getClassPath@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <parseClassPath@plt>

LLVM IR (-O0):
define void @initClassPath() {
%1 = alloca i8*
%2 = call i8* (...) @getClassPath()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @parseClassPath(i8* %3)
ret void
}

LLVM IR (-O2):
define void @initClassPath() {
%1 = tail call i8* (...) @getClassPath()
%2 = tail call i32 @parseClassPath(i8* %1)
ret void
}
/* Variables and functions */
char tolower(char);
void strlow(char *s) {
  while (*s) {
    *s = tolower(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strlow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strlow+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strlow+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strlow(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int test_imm_7Buint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x7B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Buint64_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, 123
%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_7Buint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 123
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ XMappingEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XMappingEvent(void) {
  XMappingEvent *_p = (XMappingEvent *)malloc(sizeof(XMappingEvent));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XMappingEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XMappingEvent+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XMappingEvent>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XMappingEvent+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XMappingEvent() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XMappingEvent() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void i2c_init(void) {
  (*(volatile unsigned long *)0x56000048) |= 0xc000;
  (*(volatile unsigned long *)0x56000040) |= 0xa0000000;
  (*(volatile unsigned long *)0x4A000008) &= ~((0x1 << 27));
  (*(volatile unsigned char *)0x54000000) =
      (1 << 7) | (0 << 6) | (1 << 5) | (0xf);
  (*(volatile unsigned char *)0x54000008) = 0x10;
  (*(volatile unsigned char *)0x54000004) = 0x10;
}


x86 assembly (clang, -O0):
<i2c_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000048,%eax
mov    (%rax),%rcx
or     $0xc000,%rcx
mov    $0x56000048,%eax
mov    %rcx,(%rax)
mov    $0x56000040,%eax
mov    (%rax),%rcx
movabs $0xa0000000,%rax
or     %rax,%rcx
mov    $0x56000040,%eax
mov    %rcx,(%rax)
mov    $0x4a000008,%eax
mov    (%rax),%rcx
and    $0xfffffffff7ffffff,%rcx
mov    $0x4a000008,%eax
mov    %rcx,(%rax)
mov    $0x54000000,%eax
movb   $0xaf,(%rax)
mov    $0x54000008,%eax
movb   $0x10,(%rax)
mov    $0x54000004,%eax
movb   $0x10,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_init>:
orq    $0xc000,0x56000048
mov    $0xa0000000,%eax
or     %rax,0x56000040
56
andq   $0xfffffffff7ffffff,0x4a000008
4a ff ff ff f7
movb   $0xaf,0x54000000
af
movb   $0x10,0x54000008
10
movb   $0x10,0x54000004
10
ret

LLVM IR (-O0):
define void @i2c_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840648 to i64*)
%2 = or i64 %1, 49152
store volatile i64 %2, i64* inttoptr (i64 1442840648 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840640 to i64*)
%4 = or i64 %3, 2684354560
store volatile i64 %4, i64* inttoptr (i64 1442840640 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1241513992 to i64*)
%6 = and i64 %5, -134217729
store volatile i64 %6, i64* inttoptr (i64 1241513992 to i64*)
store volatile i8 -81, i8* inttoptr (i64 1409286144 to i8*)
store volatile i8 16, i8* inttoptr (i64 1409286152 to i8*)
store volatile i8 16, i8* inttoptr (i64 1409286148 to i8*)
ret void
}

LLVM IR (-O2):
define void @i2c_init() {
%1 = load volatile i64, i64* inttoptr (i64 1442840648 to i64*)
%2 = or i64 %1, 49152
store volatile i64 %2, i64* inttoptr (i64 1442840648 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840640 to i64*)
%4 = or i64 %3, 2684354560
store volatile i64 %4, i64* inttoptr (i64 1442840640 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 1241513992 to i64*)
%6 = and i64 %5, -134217729
store volatile i64 %6, i64* inttoptr (i64 1241513992 to i64*)
store volatile i8 -81, i8* inttoptr (i64 1409286144 to i8*)
store volatile i8 16, i8* inttoptr (i64 1409286152 to i8*)
store volatile i8 16, i8* inttoptr (i64 1409286148 to i8*)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ FifoProtocol_memcpy(scalar_t__ *, void const *, int);
void inv_fifo_protocol_helper_decode_relative_humidity_data(
    const void *in, uint16_t len, float *relative_humidity) {
  uint16_t tmp;
  FifoProtocol_memcpy((&tmp), (in), (sizeof(tmp)));
  tmp = tmp;
  *relative_humidity = ((float)(uint16_t)(tmp) / (float)(1ULL << (9)));
  (void)len;
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_relative_humidity_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cvtsi2ssq -0x20(%rbp),%xmm0
movss  0xeb4(%rip),%xmm1
divss  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_relative_humidity_data>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rdi,%rsi
lea    0x8(%rsp),%rdi
mov    $0x8,%edx
call   1030 <FifoProtocol_memcpy@plt>
cvtsi2ssq 0x8(%rsp),%xmm0
mulss  0xec7(%rip),%xmm0
movss  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @inv_fifo_protocol_helper_decode_relative_humidity_data(i8* %0, i64 %1, float* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca float*
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store float* %2, float** %6
%8 = load i8*, i8** %4
%9 = call i32 @FifoProtocol_memcpy(i64* %7, i8* %8, i32 8)
%10 = load i64, i64* %7
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = sitofp i64 %11 to float
%13 = fdiv float %12, 5.120000e+02
%14 = load float*, float** %6
store float %13, float* %14
%15 = load i64, i64* %5
ret void
}

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_relative_humidity_data(i8* %0, i64 %1, float* nocapture writeonly %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @FifoProtocol_memcpy(i64* %4, i8* %0, i32 8)
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to float
%9 = fmul float %8, 0x3F60000000000000
store float %9, float* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void CheckFailed(const char *expression, const char *filename,
                 int line_number) {
  fprintf(stderr, "ERROR: CHECK failed: %s:%d: %s\n", filename, line_number,
          expression);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<CheckFailed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<CheckFailed>:
push   %rbx
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: CHECK failed: %s:%d: %s\0A\00"
define void @CheckFailed(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fflush(i32 %12)
%14 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"ERROR: CHECK failed: %s:%d: %s\0A\00"
define void @CheckFailed(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void add_slash(char *c) {
  if (c[strlen(c) - 1] != '/')
    strcat(c, "/");
}


x86 assembly (clang, -O0):
<add_slash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
je     1166 <add_slash+0x46>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_slash>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rax,%rbx,1)
jne    1134 <add_slash+0x14>
pop    %rbx
ret
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define void @add_slash(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 47
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
void kaen_emc_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @kaen_emc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, size_t);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *ret;
  if (NULL == (ret = malloc(size)))
    fatal("malloc(%zu) failed:", size);
  return ret;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    1157 <emalloc+0x37>
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <emalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <fatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"malloc(%zu) failed:\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}