xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strchr(char *, char);
int replace(char *rps, char whatc, char toc) {
  char *p1;
  p1 = strchr(rps, whatc);
  while (p1) {
    *p1 = toc;
    p1++;
    p1 = strchr(p1, whatc);
  }
}


x86 assembly (clang, -O0):
<replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     116e <replace+0x5e>
mov    -0x12(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
jmp    1138 <replace+0x28>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replace>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%ebp
call   1030 <strchr@plt>
test   %rax,%rax
je     1145 <replace+0x35>
movsbl %bpl,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %bl,(%rax)
add    $0x1,%rax
mov    %rax,%rdi
mov    %ebp,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <replace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @replace(i8* %0, i8 signext %1, i8 signext %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %4, %3 ]
store i8 %2, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i8* @strchr(i8* %8, i8 signext %1)
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %3
ret i32 undef
}
unsigned long b_file_read(unsigned long handle, void *buf, unsigned int count) {
  unsigned long tlong;
  asm volatile("call *0x00100080"
               : "=c"(tlong)
               : "a"(handle), "D"(buf), "c"(count));
  return tlong;
}


x86 assembly (clang, -O0):
<b_file_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
call   *0x100080
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_file_read>:
mov    %edx,%ecx
mov    %rdi,%rax
mov    %rsi,%rdi
call   *0x100080
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_file_read(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i64 asm sideeffect "call *0x00100080", "={cx},{ax},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %8, i8* %9, i32 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @b_file_read(i64 %0, i8* %1, i32 %2) {
%4 = tail call i64 asm sideeffect "call *0x00100080", "={cx},{ax},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i32 %2)
ret i64 %4
}
unsigned false3(int param, int param2) {
  param = param;
  param2 = param2;
  unsigned nonparam = 5;
  nonparam = nonparam;
  return param2 + nonparam;
}


x86 assembly (clang, -O0):
<false3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<false3>:
lea    0x5(%rsi),%eax
ret

LLVM IR (-O0):
define i32 @false3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %3
%7 = load i32, i32* %4
store i32 %7, i32* %4
store i32 5, i32* %5
%8 = load i32, i32* %5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = add i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @false3(i32 %0, i32 %1) {
%3 = add i32 %1, 5
ret i32 %3
}
/* Variables and functions */
void *hThrowError(int, char const *);
void *fb_ArrayBoundChk(int idx, int lbound, int ubound, int linenum,
                       const char *fname) {
  if ((idx < lbound) || (idx > ubound))
    return hThrowError(linenum, fname);
  else
    return 0;
}


x86 assembly (clang, -O0):
<fb_ArrayBoundChk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1140 <fb_ArrayBoundChk+0x30>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1155 <fb_ArrayBoundChk+0x45>
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <hThrowError@plt>
mov    %rax,-0x8(%rbp)
jmp    115d <fb_ArrayBoundChk+0x4d>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_ArrayBoundChk>:
cmp    %esi,%edi
jl     111b <fb_ArrayBoundChk+0xb>
cmp    %edx,%edi
jg     111b <fb_ArrayBoundChk+0xb>
xor    %eax,%eax
ret
mov    %ecx,%edi
mov    %r8,%rsi
jmp    1030 <hThrowError@plt>

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

LLVM IR (-O2):
define i8* @fb_ArrayBoundChk(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = icmp slt i32 %0, %1
%7 = icmp sgt i32 %0, %2
%8 = or i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i8* @hThrowError(i32 %3, i8* %4)
br label %11
11: ; preds = %5, %9
%12 = phi i8* [ %10, %9 ], [ null, %5 ]
ret i8* %12
}
/* Variables and functions */
int main() {
  bool a = true;
  a = false;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __fpurge(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void limpa_buffer() { __fpurge(stdin); }


x86 assembly (clang, -O0):
<limpa_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__fpurge@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpa_buffer>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__fpurge@plt>

LLVM IR (-O0):
@stdin = global i32 0
define void @limpa_buffer() {
%1 = load i32, i32* @stdin
%2 = call i32 @__fpurge(i32 %1)
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @limpa_buffer() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @__fpurge(i32 %1)
ret void
}
void install_sigvec(sig, new) int sig;
void (*new)();
{ (void)signal(sig, new); }


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

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

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

LLVM IR (-O2):
define void @install_sigvec(i32 %0, void (...)* %1) {
%3 = tail call i32 (i32, void (...)*, ...) bitcast (i32 (...)* @signal to i32 (i32, void (...)*, ...)*)(i32 %0, void (...)* %1)
ret void
}
void handle_PROF(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_PROF(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Hello, Blog Inversing!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Hello, Blog Inversing!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello, Blog Inversing!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t uDMAErrorStatusGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x0000004C))));
}


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

x86 assembly (clang, -O2):
<uDMAErrorStatusGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x4c(%rax),%rax
ret

LLVM IR (-O0):
define i64 @uDMAErrorStatusGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 76
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @uDMAErrorStatusGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 76
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
/* Variables and functions */
int check_4th_gen_intel_core_features();
int can_use_intel_core_4th_gen_features() {
  static int the_4th_gen_features_available = -1;
  if (the_4th_gen_features_available < 0)
    the_4th_gen_features_available = check_4th_gen_intel_core_features();
  return the_4th_gen_features_available;
}


x86 assembly (clang, -O0):
<can_use_intel_core_4th_gen_features>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f0d(%rip)
jge    112e <can_use_intel_core_4th_gen_features+0x1e>
mov    $0x0,%al
call   1030 <check_4th_gen_intel_core_features@plt>
mov    %eax,0x2efa(%rip)
mov    0x2ef4(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_use_intel_core_4th_gen_features>:
push   %rax
mov    0x2f11(%rip),%eax
test   %eax,%eax
js     111d <can_use_intel_core_4th_gen_features+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <check_4th_gen_intel_core_features@plt>
mov    %eax,0x2efe(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@can_use_intel_core_4th_gen_features.the_4th_gen_features_available = internal global i32 -1
define i32 @can_use_intel_core_4th_gen_features() {
%1 = load i32, i32* @can_use_intel_core_4th_gen_features.the_4th_gen_features_available
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @check_4th_gen_intel_core_features()
store i32 %4, i32* @can_use_intel_core_4th_gen_features.the_4th_gen_features_available
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @can_use_intel_core_4th_gen_features.the_4th_gen_features_available
ret i32 %6
}

LLVM IR (-O2):
@can_use_intel_core_4th_gen_features.the_4th_gen_features_available = internal unnamed_addr global i32 -1
define i32 @can_use_intel_core_4th_gen_features() {
%1 = load i32, i32* @can_use_intel_core_4th_gen_features.the_4th_gen_features_available
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @check_4th_gen_intel_core_features()
store i32 %4, i32* @can_use_intel_core_4th_gen_features.the_4th_gen_features_available
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
int Pop();
int /*<<< orphan*/ printf(char *, int);
void DoPrintInt() { printf("%d", Pop()); }


x86 assembly (clang, -O0):
<DoPrintInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Pop@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoPrintInt>:
push   %rax
xor    %eax,%eax
call   1040 <Pop@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @DoPrintInt() {
%1 = call i32 (...) @Pop()
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @DoPrintInt() {
%1 = tail call i32 (...) @Pop()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void func2(int x) {}


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

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

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

LLVM IR (-O2):
define void @func2(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ stderr;
char *safealloc(size_t n) {
  char *p = (char *)malloc(n);
  if (p == NULL) {
    fprintf(stderr, "** run out of memory!\n");
    exit(0);
  }
  return p;
}


x86 assembly (clang, -O0):
<safealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <safealloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safealloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safealloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"** run out of memory!\0A\00"
define i8* @safealloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"** run out of memory!\0A\00"
define i8* @safealloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
void ble_rsp_test_get_channel_map(
    const struct ble_msg_test_get_channel_map_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_test_get_channel_map_rsp_t = type opaque
define void @ble_rsp_test_get_channel_map(%struct.ble_msg_test_get_channel_map_rsp_t* %0) {
%2 = alloca %struct.ble_msg_test_get_channel_map_rsp_t*
store %struct.ble_msg_test_get_channel_map_rsp_t* %0, %struct.ble_msg_test_get_channel_map_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_test_get_channel_map_rsp_t = type opaque
define void @ble_rsp_test_get_channel_map(%struct.ble_msg_test_get_channel_map_rsp_t* nocapture %0) {
ret void
}
void f_void_p2(void) { return; }


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

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

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

LLVM IR (-O2):
define void @f_void_p2() {
ret void
}
void swLong(unsigned char *buf, unsigned long val) {
  buf[0] = (unsigned char)((val & 0xff000000) >> 24UL);
  buf[1] = (unsigned char)((val & 0x00ff0000) >> 16UL);
  buf[2] = (unsigned char)((val & 0x0000ff00) >> 8UL);
  buf[3] = (unsigned char)(val & 0x000000ff);
}


x86 assembly (clang, -O0):
<swLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0xff000000,%rax
and    -0x10(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
and    $0xff0000,%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
and    $0xff00,%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swLong>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @swLong(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 4278190080
%7 = lshr i64 %6, 24
%8 = trunc i64 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i64, i64* %4
%12 = and i64 %11, 16711680
%13 = lshr i64 %12, 16
%14 = trunc i64 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i64, i64* %4
%18 = and i64 %17, 65280
%19 = lshr i64 %18, 8
%20 = trunc i64 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i64, i64* %4
%24 = and i64 %23, 255
%25 = trunc i64 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @swLong(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 24
%4 = trunc i64 %3 to i8
store i8 %4, i8* %0
%5 = lshr i64 %1, 16
%6 = trunc i64 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i64 %1, 8
%9 = trunc i64 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i64 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_buffer();
int /*<<< orphan*/ test_linked_list();
int /*<<< orphan*/ test_list();
int main() {
  test_buffer();
  test_list();
  test_linked_list();
  printf("  Tests Finished. Zero Errors\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_buffer@plt>
mov    $0x0,%al
call   1060 <test_list@plt>
mov    $0x0,%al
call   1030 <test_linked_list@plt>
lea    0xe95(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_buffer@plt>
xor    %eax,%eax
call   1060 <test_list@plt>
xor    %eax,%eax
call   1030 <test_linked_list@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c" Tests Finished. Zero Errors\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_buffer()
%3 = call i32 (...) @test_list()
%4 = call i32 (...) @test_linked_list()
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c" Tests Finished. Zero Errors\00"
define i32 @main() {
%1 = tail call i32 (...) @test_buffer()
%2 = tail call i32 (...) @test_list()
%3 = tail call i32 (...) @test_linked_list()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int strcmp(const char *s1, const char *s2) {
  const unsigned char *c1 = s1, *c2 = s2;
  unsigned char ch;
  int d = 0;
  while (1) {
    d = (int)(ch = *c1++) - (int)*c2++;
    if (d || !ch)
      break;
  }
  return d;
}


x86 assembly (clang, -O0):
<strcmp>:
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)
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    %al,-0x21(%rbp)
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    1165 <strcmp+0x65>
cmpb   $0x0,-0x21(%rbp)
jne    116a <strcmp+0x6a>
jmp    116f <strcmp+0x6f>
jmp    1123 <strcmp+0x23>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%edx
movzbl (%rsi,%rcx,1),%r8d
mov    %edx,%eax
sub    %r8d,%eax
jne    1128 <strcmp+0x28>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcmp+0x10>
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
store i8* %9, i8** %5
%10 = load i8*, i8** %4
store i8* %10, i8** %6
store i32 0, i32* %8
br label %11
11: ; preds = %2, %27
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
%14 = load i8, i8* %12
store i8 %14, i8* %7
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %6
%18 = load i8, i8* %16
%19 = zext i8 %18 to i32
%20 = sub nsw i32 %15, %19
store i32 %20, i32* %8
%21 = load i32, i32* %8
%22 = icmp ne i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %11
%24 = load i8, i8* %7
%25 = icmp ne i8 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %23, %11
br label %28
27: ; preds = %23
br label %11
28: ; preds = %26
%29 = load i32, i32* %8
ret i32 %29
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i8* [ %0, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = zext i8 %7 to i32
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = sub nsw i32 %8, %11
%13 = icmp eq i32 %12, 0
%14 = icmp ne i8 %7, 0
%15 = select i1 %13, i1 %14, i1 false
br i1 %15, label %3, label %16
16: ; preds = %3
ret i32 %12
}
int test_imm_B2int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B2int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11665408
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void cprop_result2(int *data) { data[0] = 9; }


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

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

LLVM IR (-O0):
define void @cprop_result2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store i32 9, i32* %4
ret void
}

LLVM IR (-O2):
define void @cprop_result2(i32* nocapture writeonly %0) {
store i32 9, i32* %0
ret void
}
/* Variables and functions */
bool dbetween(double x, double lower, double upper) {
  return ((x - lower) <= (upper - lower));
}


x86 assembly (clang, -O0):
<dbetween>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbetween>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
xor    %eax,%eax
ucomisd %xmm0,%xmm2
setae  %al
ret

LLVM IR (-O0):
define i32 @dbetween(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = fsub double %10, %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @dbetween(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fsub double %2, %1
%6 = fcmp ole double %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dmc_unrar_unicode_utf16_is_surrogate(int);
bool dmc_unrar_unicode_utf32_is_valid(uint32_t code) {
  return (code <= 0x0010FFFF) && !dmc_unrar_unicode_utf16_is_surrogate(code);
}


x86 assembly (clang, -O0):
<dmc_unrar_unicode_utf32_is_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x10ffff,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jg     1140 <dmc_unrar_unicode_utf32_is_valid+0x30>
mov    -0x4(%rbp),%edi
call   1030 <dmc_unrar_unicode_utf16_is_surrogate@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmc_unrar_unicode_utf32_is_valid>:
xor    %eax,%eax
cmp    $0x10ffff,%edi
jg     112d <dmc_unrar_unicode_utf32_is_valid+0x1d>
push   %rax
call   1030 <dmc_unrar_unicode_utf16_is_surrogate@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @dmc_unrar_unicode_utf32_is_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 1114111
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @dmc_unrar_unicode_utf16_is_surrogate(i32 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @dmc_unrar_unicode_utf32_is_valid(i32 %0) {
%2 = icmp slt i32 %0, 1114112
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @dmc_unrar_unicode_utf16_is_surrogate(i32 %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *);
int strlen(char *);
char *xml_string(char *s) {
  size_t length = strlen(s) + 18;
  char *result = (char *)calloc(length, sizeof(char));
  snprintf(result, length, "<string>%s</string>", s);
  return result;
}


x86 assembly (clang, -O0):
<xml_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x12,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xe8d(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xml_string>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x12,%eax
movslq %eax,%r15
mov    %r15,%rdi
mov    $0x1,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xea6(%rip),%rdx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"<string>%s</string>\00"
define i8* @xml_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 18
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i64 @calloc(i64 %9, i32 1)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = load i64, i64* %3
%14 = load i8*, i8** %2
%15 = call i32 @snprintf(i8* %12, i64 %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [20 x i8] c"<string>%s</string>\00"
define i8* @xml_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 18
%4 = sext i32 %3 to i64
%5 = tail call i64 @calloc(i64 %4, i32 1)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @snprintf(i8* %6, i64 %4, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void st_thread_exit(void) { pthread_exit(NULL); }


x86 assembly (clang, -O0):
<st_thread_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <pthread_exit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @st_thread_exit() {
%1 = call i32 @pthread_exit(i32* null)
ret void
}

LLVM IR (-O2):
define void @st_thread_exit() {
%1 = tail call i32 @pthread_exit(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set(int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b, c;
  a = 0;
  b = 1;
  c = 3;
  a = b + c;
  b = 3;
  c = 5;
  set(&a);
  test_assert(a == 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <set@plt>
cmpl   $0x8,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <set@plt>
xor    %edi,%edi
cmpl   $0x8,0x4(%rsp)
sete   %dil
call   1030 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 3, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
store i32 3, i32* %3
store i32 5, i32* %4
%8 = call i32 @set(i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 8
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 4, i32* %1
%3 = call i32 @set(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 8
%6 = zext i1 %5 to i32
%7 = call i32 @test_assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x7f() {
  Assert_real((isprint(127) == 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_isprint.c",
              640, ("isprint should be 0 for 0x7f"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x7f\00"
define void @t_isprint_0x7f() {
%1 = call i64 @isprint(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x7f\00"
define void @t_isprint_0x7f() {
%1 = tail call i64 @isprint(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strncat(char *str1, const char *str2, size_t n) {
  strncpy(str1 + strlen(str1), str2, n);
  return str1;
}


x86 assembly (clang, -O0):
<strncat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncat>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strncat(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @strncpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strncat(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @strncpy(i8* %6, i8* %1, i64 %2)
ret i8* %0
}
void NV12ToRGB24Row_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB24Row_Any_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void sleeper(void) {
  sleep(10);
  exit(0);
}


x86 assembly (clang, -O0):
<sleeper>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<sleeper>:
push   %rax
mov    $0xa,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @sleeper() {
%1 = call i32 @sleep(i32 10)
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sleeper() {
%1 = tail call i32 @sleep(i32 10)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ pow(float, int);
float sqrt(scalar_t__);
float circular_out(float step, float max_steps, float max_val) {
  float ratio = (step - max_steps) / (max_steps - 1.0);
  return max_val * sqrt(1 - pow(ratio, 2));
}


x86 assembly (clang, -O0):
<circular_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeaa(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_out>:
push   %rax
movss  %xmm2,0x4(%rsp)
subss  %xmm1,%xmm0
cvtss2sd %xmm1,%xmm1
addsd  0xec9(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @circular_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %4
%9 = load float, float* %5
%10 = fsub float %8, %9
%11 = fpext float %10 to double
%12 = load float, float* %5
%13 = fpext float %12 to double
%14 = fsub double %13, 1.000000e+00
%15 = fdiv double %11, %14
%16 = fptrunc double %15 to float
store float %16, float* %7
%17 = load float, float* %6
%18 = load float, float* %7
%19 = call i64 @pow(float %18, i32 2)
%20 = sub nsw i64 1, %19
%21 = call float @sqrt(i64 %20)
%22 = fmul float %17, %21
ret float %22
}

LLVM IR (-O2):
define float @circular_out(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = fpext float %4 to double
%6 = fpext float %1 to double
%7 = fadd double %6, -1.000000e+00
%8 = fdiv double %5, %7
%9 = fptrunc double %8 to float
%10 = tail call i64 @pow(float %9, i32 2)
%11 = sub nsw i64 1, %10
%12 = tail call float @sqrt(i64 %11)
%13 = fmul float %12, %2
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int f3() { bar(7); }


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1030 <bar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
mov    $0x7,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
define i32 @f3() {
%1 = alloca i32
%2 = call i32 @bar(i32 7)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @f3() {
%1 = tail call i32 @bar(i32 7)
ret i32 undef
}
int matchtag(int formaltag, int actualtag, int allowcoerce) {
  if (formaltag != actualtag) {
    if (!allowcoerce || formaltag != 0 || (actualtag & 0x4000u) != 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<matchtag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     114f <matchtag+0x4f>
cmpl   $0x0,-0x10(%rbp)
je     113e <matchtag+0x3e>
cmpl   $0x0,-0x8(%rbp)
jne    113e <matchtag+0x3e>
mov    -0xc(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     114a <matchtag+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1156 <matchtag+0x56>
jmp    114f <matchtag+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<matchtag>:
cmp    %esi,%edi
je     1114 <matchtag+0x14>
xor    %eax,%eax
test   %edx,%edx
je     1119 <matchtag+0x19>
and    $0x4000,%esi
or     %edi,%esi
jne    1119 <matchtag+0x19>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @matchtag(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp ne i32 %2, 0
%7 = and i32 %1, 16384
%8 = or i32 %7, %0
%9 = icmp eq i32 %8, 0
%10 = and i1 %6, %9
br i1 %10, label %11, label %12
11: ; preds = %5, %3
br label %12
12: ; preds = %5, %11
%13 = phi i32 [ 1, %11 ], [ 0, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void uDMAChannelRequest(unsigned long ulChannelNum) {
  DEBUG_ASSERT((ulChannelNum & 0xffff) < 32);
  (*((volatile unsigned long *)(0x400FF014))) = 1 << (ulChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
cmp    $0x20,%rax
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
and    $0x1f,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff014,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelRequest>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   $0xffe0,%ebx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
mov    %rax,0x400ff014
40
pop    %rbx
ret

LLVM IR (-O0):
define void @uDMAChannelRequest(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = icmp ult i64 %4, 32
%6 = zext i1 %5 to i32
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %2
%9 = and i64 %8, 31
%10 = trunc i64 %9 to i32
%11 = shl i32 1, %10
%12 = sext i32 %11 to i64
store volatile i64 %12, i64* inttoptr (i64 1074786324 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelRequest(i64 %0) {
%2 = and i64 %0, 65504
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = trunc i64 %0 to i32
%7 = and i32 %6, 31
%8 = shl nuw i32 1, %7
%9 = sext i32 %8 to i64
store volatile i64 %9, i64* inttoptr (i64 1074786324 to i64*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int next_utf8(char const *, int, int /*<<< orphan*/ *);
int utf8_char_len(char const *s) {
  if (*s == '\n' || *s == '\t' || *s == '\r')
    return 1;
  uint32_t cp;
  return next_utf8(s, 64, &cp);
}


x86 assembly (clang, -O0):
<utf8_char_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     114c <utf8_char_len+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
je     114c <utf8_char_len+0x3c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1158 <utf8_char_len+0x48>
movl   $0x1,-0x4(%rbp)
jmp    116d <utf8_char_len+0x5d>
mov    -0x10(%rbp),%rdi
mov    $0x40,%esi
lea    -0x14(%rbp),%rdx
call   1030 <next_utf8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_char_len>:
push   %rax
movzbl (%rdi),%ecx
cmp    $0xd,%rcx
ja     112c <utf8_char_len+0x1c>
mov    $0x1,%eax
mov    $0x2600,%edx
bt     %rcx,%rdx
jae    112c <utf8_char_len+0x1c>
pop    %rcx
ret
lea    0x4(%rsp),%rdx
mov    $0x40,%esi
call   1030 <next_utf8@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @utf8_char_len(i8* %0) {
%2 = alloca i32
%3 = load i8, i8* %0
switch i8 %3, label %4 [
i8 10, label %7
i8 9, label %7
i8 13, label %7
]
4: ; preds = %1
%5 = bitcast i32* %2 to i8*
%6 = call i32 @next_utf8(i8* %0, i32 64, i32* %2)
br label %7
7: ; preds = %1, %1, %1, %4
%8 = phi i32 [ %6, %4 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Stm25pSectorP__SpiResource__granted();
void Stm25pSpiP__ClientResource__granted(void) {
  Stm25pSectorP__SpiResource__granted();
}


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

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

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

LLVM IR (-O2):
define void @Stm25pSpiP__ClientResource__granted() {
%1 = tail call i32 (...) @Stm25pSectorP__SpiResource__granted()
ret void
}