xunge/DecIR huggingface dataset:
char test_67_0(char *mem) { return __atomic_xor_fetch(mem + 0, -1, 4); }


x86 assembly (clang, -O0):
<test_67_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_67_0+0x4a>
jmp    111f <test_67_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
xor    %cl,%al
mov    %al,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_67_0>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %cl
lock cmpxchg %cl,(%rdi)
jne    1110 <test_67_0+0x10>
not    %al
ret

LLVM IR (-O0):
define signext i8 @test_67_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -1, i8* %3
%7 = load i8, i8* %3
%8 = atomicrmw xor i8* %6, i8 %7 acq_rel
%9 = xor i8 %8, %7
store i8 %9, i8* %4
%10 = load i8, i8* %4
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @test_67_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 -1 acq_rel
%3 = xor i8 %2, -1
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ehrpwm_write(int /*<<< orphan*/, int, unsigned short);
int ehrpwm_tb_set_phase(uint8_t module, unsigned short val) {
  ehrpwm_write(module, 0x6, val);
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_tb_set_phase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x6,%esi
movzwl -0x6(%rbp),%edx
call   1030 <ehrpwm_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_tb_set_phase>:
push   %rax
mov    %esi,%edx
mov    $0x6,%esi
call   1030 <ehrpwm_write@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ehrpwm_tb_set_phase(i32 %0, i16 zeroext %1) {
%3 = tail call i32 @ehrpwm_write(i32 %0, i32 6, i16 zeroext %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printString(char *str) { printf("%s", str); }


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

x86 assembly (clang, -O2):
<printString>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printString(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *);
int x_printf(const char *format, ...) {
  printf(format);
  return 1;
}


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

x86 assembly (clang, -O2):
<x_printf>:
push   %rax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @x_printf(i8* nocapture %0, ...) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xe7() {
  Assert_real((isdigit(231) == 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_isdigit.c",
              1160, ("isdigit should be 0 for 0xe7"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xe7>:
push   %rax
mov    $0xe7,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x488,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe7\00"
define void @t_isdigit_0xe7() {
%1 = call i64 @isdigit(i32 231)
%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 1160, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xe7\00"
define void @t_isdigit_0xe7() {
%1 = tail call i64 @isdigit(i32 231)
%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 1160, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ orgfx_wait(int);
void Set1024x768_60(void) {
  *((volatile unsigned int *)((0x97000000 + 0x008))) =
      ((136 - 1) << 24) | ((160 - 1) << 16) | (1024 - 1);
  *((volatile unsigned int *)((0x97000000 + 0x00c))) =
      ((6 - 1) << 24) | ((29 - 1) << 16) | (768 - 1);
  *((volatile unsigned int *)((0x97000000 + 0x010))) =
      ((1344 - 1) << 16) | (806 - 1);
  orgfx_wait(2);
  *((volatile unsigned int *)((0xB8000000 + 0x14))) = 1024;
  *((volatile unsigned int *)((0xB8000000 + 0x18))) = 768;
}


x86 assembly (clang, -O0):
<Set1024x768_60>:
push   %rbp
mov    %rsp,%rbp
mov    $0x97000008,%eax
movl   $0x879f03ff,(%rax)
mov    $0x9700000c,%eax
movl   $0x51c02ff,(%rax)
mov    $0x97000010,%eax
movl   $0x53f0325,(%rax)
mov    $0x2,%edi
call   1030 <orgfx_wait@plt>
mov    $0xb8000014,%eax
movl   $0x400,(%rax)
mov    $0xb8000018,%eax
movl   $0x300,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Set1024x768_60>:
push   %rbx
mov    $0x97000008,%ebx
movl   $0x879f03ff,(%rbx)
movl   $0x51c02ff,0x4(%rbx)
movl   $0x53f0325,0x8(%rbx)
mov    $0x2,%edi
call   1030 <orgfx_wait@plt>
movl   $0x400,0x2100000c(%rbx)
movl   $0x300,0x21000010(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Set1024x768_60() {
store volatile i32 -2019621889, i32* inttoptr (i64 2533359624 to i32*)
store volatile i32 85721855, i32* inttoptr (i64 2533359628 to i32*)
store volatile i32 88015653, i32* inttoptr (i64 2533359632 to i32*)
%1 = call i32 @orgfx_wait(i32 2)
store volatile i32 1024, i32* inttoptr (i64 3087007764 to i32*)
store volatile i32 768, i32* inttoptr (i64 3087007768 to i32*)
ret void
}

LLVM IR (-O2):
define void @Set1024x768_60() {
store volatile i32 -2019621889, i32* inttoptr (i64 2533359624 to i32*)
store volatile i32 85721855, i32* inttoptr (i64 2533359628 to i32*)
store volatile i32 88015653, i32* inttoptr (i64 2533359632 to i32*)
%1 = tail call i32 @orgfx_wait(i32 2)
store volatile i32 1024, i32* inttoptr (i64 3087007764 to i32*)
store volatile i32 768, i32* inttoptr (i64 3087007768 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printXmlTenDigits(long long *data, unsigned int offset, const char *name) {
  if (offset > 0) {
    printf("%*c", offset, ' ');
  }
  printf("<%s>%lli</%s>\n", name, *data, name);
}


x86 assembly (clang, -O0):
<printXmlTenDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1143 <printXmlTenDigits+0x33>
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printXmlTenDigits>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
test   %esi,%esi
je     1131 <printXmlTenDigits+0x21>
lea    0xedb(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%rdx
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [15 x i8] c"<%s>%lli</%s>\0A\00"
define void @printXmlTenDigits(i64* %0, i32 %1, i8* %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i8*
store i64* %0, i64** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10, i32 32)
br label %12
12: ; preds = %9, %3
%13 = load i8*, i8** %6
%14 = load i64*, i64** %4
%15 = load i64, i64* %14
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %13, i64 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [15 x i8] c"<%s>%lli</%s>\0A\00"
define void @printXmlTenDigits(i64* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 32)
br label %7
7: ; preds = %5, %3
%8 = load i64, i64* %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2, i64 %8, i8* %2)
ret void
}
char *sha384hex(bitstr, bitcnt)
unsigned char *bitstr;
unsigned long bitcnt;
{ return ((char *)shacomp(384, 2, bitstr, bitcnt)); }


x86 assembly (clang, -O0):
<sha384hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x180,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <shacomp@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sha384hex>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    $0x180,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <shacomp@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sha384hex(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 384, i32 2, i8* %5, i64 %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @sha384hex(i8* %0, i64 %1) {
%3 = tail call i32 (i32, i32, i8*, i64, ...) bitcast (i32 (...)* @shacomp to i32 (i32, i32, i8*, i64, ...)*)(i32 384, i32 2, i8* %0, i64 %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *ourBaseName(char *name) {
  char *base;
  base = strrchr(name, '/');
  return base ? base + 1 : name;
}


x86 assembly (clang, -O0):
<ourBaseName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <ourBaseName+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <ourBaseName+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ourBaseName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ourBaseName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @ourBaseName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void assignGlobal(void) {
  extern int i;
  i = 0x1000;
}


x86 assembly (clang, -O0):
<assignGlobal>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movl   $0x1000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assignGlobal>:
mov    0x2ee1(%rip),%rax
movl   $0x1000,(%rax)
ret

LLVM IR (-O0):
@i = external global i32
define void @assignGlobal() {
store i32 4096, i32* @i
ret void
}

LLVM IR (-O2):
@i = external global i32
define void @assignGlobal() {
store i32 4096, i32* @i
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int f2(int);
void *f3();
int main() {
  if (f2(1) != 27 || f2(0) != 1)
    abort();
  if (f3() != (void *)f3)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f2@plt>
cmp    $0x1b,%eax
jne    1162 <main+0x32>
xor    %edi,%edi
call   1030 <f2@plt>
cmp    $0x1,%eax
je     1169 <main+0x39>
mov    $0x0,%al
call   1040 <abort@plt>
mov    $0x0,%al
call   1060 <f3@plt>
mov    0x2e69(%rip),%rcx
cmp    %rcx,%rax
je     1187 <main+0x57>
mov    $0x0,%al
call   1040 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f2@plt>
cmp    $0x1b,%eax
jne    1163 <main+0x33>
xor    %edi,%edi
call   1030 <f2@plt>
cmp    $0x1,%eax
jne    1163 <main+0x33>
xor    %eax,%eax
call   1060 <f3@plt>
cmp    0x2e86(%rip),%rax
jne    1163 <main+0x33>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f2(i32 1)
%3 = icmp ne i32 %2, 27
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = call i32 @f2(i32 0)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %4, %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %4
%10 = call i8* (...) @f3()
%11 = icmp ne i8* %10, bitcast (i8* (...)* @f3 to i8*)
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %9
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f2(i32 1)
%2 = icmp eq i32 %1, 27
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @f2(i32 0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %3
%9 = tail call i8* (...) @f3()
%10 = icmp eq i8* %9, bitcast (i8* (...)* @f3 to i8*)
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 (...) @abort()
unreachable
13: ; preds = %8
%14 = tail call i32 @exit(i32 0)
unreachable
}
int ld_ne_mr1(long double *a1, long double a2) { return (((*a1) != (a2))); }


x86 assembly (clang, -O0):
<ld_ne_mr1>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
mov    %rdi,-0x8(%rbp)
fstpt  -0x20(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ne_mr1>:
fldt   0x8(%rsp)
fldt   (%rdi)
fucomip %st(1),%st
fstp   %st(0)
setp   %al
setne  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ld_ne_mr1(x86_fp80* %0, x86_fp80 %1) {
%3 = alloca x86_fp80*
%4 = alloca x86_fp80
store x86_fp80* %0, x86_fp80** %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80*, x86_fp80** %3
%6 = load x86_fp80, x86_fp80* %5
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp une x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_ne_mr1(x86_fp80* nocapture %0, x86_fp80 %1) {
%3 = load x86_fp80, x86_fp80* %0
%4 = fcmp une x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TestEvents();
int /*<<< orphan*/ TestIoBuffer();
int /*<<< orphan*/ TestMemory();
int /*<<< orphan*/ TestRegistry();
int /*<<< orphan*/ TestServant();
int /*<<< orphan*/ TestServer();
int main(int argc, char *argv[]) {
  TestMemory();
  TestEvents();
  TestServer();
  TestRegistry();
  TestIoBuffer();
  TestServant();
  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)
mov    $0x0,%al
call   1040 <TestMemory@plt>
mov    $0x0,%al
call   1060 <TestEvents@plt>
mov    $0x0,%al
call   1030 <TestServer@plt>
mov    $0x0,%al
call   1050 <TestRegistry@plt>
mov    $0x0,%al
call   1070 <TestIoBuffer@plt>
mov    $0x0,%al
call   1080 <TestServant@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <TestMemory@plt>
xor    %eax,%eax
call   1060 <TestEvents@plt>
xor    %eax,%eax
call   1030 <TestServer@plt>
xor    %eax,%eax
call   1050 <TestRegistry@plt>
xor    %eax,%eax
call   1070 <TestIoBuffer@plt>
xor    %eax,%eax
call   1080 <TestServant@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 (...) @TestMemory()
%7 = call i32 (...) @TestEvents()
%8 = call i32 (...) @TestServer()
%9 = call i32 (...) @TestRegistry()
%10 = call i32 (...) @TestIoBuffer()
%11 = call i32 (...) @TestServant()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @TestMemory()
%4 = tail call i32 (...) @TestEvents()
%5 = tail call i32 (...) @TestServer()
%6 = tail call i32 (...) @TestRegistry()
%7 = tail call i32 (...) @TestIoBuffer()
%8 = tail call i32 (...) @TestServant()
ret i32 0
}
/* Variables and functions */
unsigned long xorshf96(unsigned long *, unsigned long *, unsigned long *);
unsigned long mctop_rand(unsigned long *seeds) {
  return (xorshf96(seeds, seeds + 1, seeds + 2));
}


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

x86 assembly (clang, -O2):
<mctop_rand>:
lea    0x8(%rdi),%rsi
lea    0x10(%rdi),%rdx
jmp    1030 <xorshf96@plt>

LLVM IR (-O0):
define i64 @mctop_rand(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 1
%6 = load i64*, i64** %2
%7 = getelementptr inbounds i64, i64* %6, i64 2
%8 = call i64 @xorshf96(i64* %3, i64* %5, i64* %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @mctop_rand(i64* %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
%3 = getelementptr inbounds i64, i64* %0, i64 2
%4 = tail call i64 @xorshf96(i64* %0, i64* %2, i64* %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ puts(char *);
char *readline();
int /*<<< orphan*/ sscanf(char *, char *, double *);
double getdouble() {
  double num = 0;
  char *line = readline();
  if (!sscanf(line, "%lf", &num)) {
    puts("No number");
  }
  free(line);
  return num;
}


x86 assembly (clang, -O0):
<getdouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1050 <readline@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe9a(%rip),%rsi
lea    -0x8(%rbp),%rdx
call   1060 <sscanf@plt>
cmp    $0x0,%eax
jne    1184 <getdouble+0x44>
lea    0xe85(%rip),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getdouble>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1050 <readline@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1060 <sscanf@plt>
test   %eax,%eax
jne    117c <getdouble+0x3c>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [10 x i8] c"No number\00"
define double @getdouble() {
%1 = alloca double
%2 = alloca i8*
store double 0.000000e+00, double* %1
%3 = call i8* (...) @readline()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
%12 = load double, double* %1
ret double %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [10 x i8] c"No number\00"
define double @getdouble() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i8* (...) @readline()
%4 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i32 @free(i8* %3)
%10 = load double, double* %1
ret double %10
}
/* Variables and functions */
scalar_t__ stdin;
void *idris_stdin() { return (void *)stdin; }


x86 assembly (clang, -O0):
<idris_stdin>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris_stdin>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
@stdin = global i64 0
define i8* @idris_stdin() {
%1 = load i64, i64* @stdin
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
@stdin = global i64 0
define i8* @idris_stdin() {
%1 = load i64, i64* @stdin
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void smallAdjustmentLT(unsigned a) {
  char *b = ((void *)0);
  if (a + 1 < 2)
    b = malloc(1);
  if (a == 0 || a == (0x7fffffff * 2U + 1U))
    free(b);
  return;
}


x86 assembly (clang, -O0):
<smallAdjustmentLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cmp    $0x2,%eax
jae    1150 <smallAdjustmentLT+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1164 <smallAdjustmentLT+0x44>
cmpl   $0xffffffff,-0x4(%rbp)
jne    116d <smallAdjustmentLT+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smallAdjustmentLT>:
add    $0x1,%edi
cmp    $0x1,%edi
ja     113c <smallAdjustmentLT+0x1c>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @smallAdjustmentLT(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %12, %9
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @smallAdjustmentLT(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %1, %4
ret void
}
void RTStrFormatTypeSetUser(void) {}


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

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

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

LLVM IR (-O2):
define void @RTStrFormatTypeSetUser() {
ret void
}
char getSuit(int suit) {
  switch (suit) {
  case 0:
    return ('c');
  case 1:
    return ('d');
  case 2:
    return ('h');
  case 3:
    return ('s');
  }
}


x86 assembly (clang, -O0):
<getSuit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     114b <getSuit+0x4b>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x63,-0x1(%rbp)
jmp    114b <getSuit+0x4b>
movb   $0x64,-0x1(%rbp)
jmp    114b <getSuit+0x4b>
movb   $0x68,-0x1(%rbp)
jmp    114b <getSuit+0x4b>
movb   $0x73,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSuit>:
lea    -0x8(,%rdi,8),%ecx
mov    %edi,%eax
add    $0xffffffff,%eax
mov    $0x736864,%edx
shr    %cl,%edx
cmp    $0x3,%eax
mov    $0x63,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @getSuit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %1
store i8 99, i8* %2
br label %9
6: ; preds = %1
store i8 100, i8* %2
br label %9
7: ; preds = %1
store i8 104, i8* %2
br label %9
8: ; preds = %1
store i8 115, i8* %2
br label %9
9: ; preds = %5, %6, %7, %8, %1
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @getSuit(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
%4 = trunc i32 %2 to i24
%5 = shl i24 %4, 3
%6 = lshr i24 7563364, %5
%7 = trunc i24 %6 to i8
%8 = select i1 %3, i8 %7, i8 99
ret i8 %8
}
/* Variables and functions */
int rand();
unsigned int rand_bool(void) { return rand() % 2; }


x86 assembly (clang, -O0):
<rand_bool>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_bool>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rand_bool() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 2
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand_bool() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 2
ret i32 %2
}
int test_imm_48uint16_mem(unsigned short *val) {
  return ((*val) & (0x48 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_48uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 72
%7 = icmp ne i32 %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_48uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 72
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int execute_nice() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_nice() {
ret i32 0
}
void fe_silc_modules_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @fe_silc_modules_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(char, int);
void ft_putchar(char c) { ft_putchar_fd(c, 1); }


x86 assembly (clang, -O0):
<ft_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%esi
movsbl -0x1(%rbp),%edi
call   1030 <ft_putchar_fd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putchar>:
mov    $0x1,%esi
jmp    1030 <ft_putchar_fd@plt>

LLVM IR (-O0):
define void @ft_putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @ft_putchar_fd(i8 signext %3, i32 1)
ret void
}

LLVM IR (-O2):
define void @ft_putchar(i8 signext %0) {
%2 = tail call i32 @ft_putchar_fd(i8 signext %0, i32 1)
ret void
}
void reset_column() {}


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

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

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

LLVM IR (-O2):
define void @reset_column() {
ret void
}
/* Variables and functions */
__attribute__((visibility("default"))) const char *
sd_bus_message_get_path(void *m) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_message_get_path(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h264nalst_set_ref(uint8_t *p_start, uint8_t ref) {
  p_start[0] &= 0x1f;
  p_start[0] |= ref << 5;
}


x86 assembly (clang, -O0):
<h264nalst_set_ref>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0x1f,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264nalst_set_ref>:
mov    (%rdi),%eax
and    $0x1f,%eax
shl    $0x5,%esi
or     %eax,%esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @h264nalst_set_ref(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = and i32 %7, 31
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 0
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @h264nalst_set_ref(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 31
%5 = shl i32 %1, 5
%6 = or i32 %4, %5
store i32 %6, i32* %0
ret void
}
void foo_p(struct _Data$$1 *p) { ; }


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

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

LLVM IR (-O0):
%"struct._Data$$1" = type opaque
define void @foo_p(%"struct._Data$$1"* %0) {
%2 = alloca %"struct._Data$$1"*
store %"struct._Data$$1"* %0, %"struct._Data$$1"** %2
ret void
}

LLVM IR (-O2):
%"struct._Data$$1" = type opaque
define void @foo_p(%"struct._Data$$1"* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double rand_gen_range(double min, double max) {
  double diff = max - min;
  double rnd = ((double)rand() / ((double)RAND_MAX + 1)) * diff + min;
  return rnd;
}


x86 assembly (clang, -O0):
<rand_gen_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ea4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xeaf(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_gen_range>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    0x2eae(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
addsd  0xeb6(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @rand_gen_range(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
store double %9, double* %5
%10 = call i64 (...) @rand()
%11 = sitofp i64 %10 to double
%12 = load i64, i64* @RAND_MAX
%13 = sitofp i64 %12 to double
%14 = fadd double %13, 1.000000e+00
%15 = fdiv double %11, %14
%16 = load double, double* %5
%17 = load double, double* %3
%18 = call double @llvm.fmuladd.f64(double %15, double %16, double %17)
store double %18, double* %6
%19 = load double, double* %6
ret double %19
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @rand_gen_range(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %5, %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %3, double %0)
ret double %10
}
/* Variables and functions */
scalar_t__ islower(char);
scalar_t__ isupper(char);
void alphatonum(char *input) {
  if (isupper(*input))
    *input -= 'A';
  else if (islower(*input))
    *input -= 'a';
}


x86 assembly (clang, -O0):
<alphatonum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1153 <alphatonum+0x33>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x41,%ecx
mov    %cl,(%rax)
jmp    117a <alphatonum+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1175 <alphatonum+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x61,%ecx
mov    %cl,(%rax)
jmp    117a <alphatonum+0x5a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphatonum>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1040 <isupper@plt>
mov    (%rbx),%cl
test   %rax,%rax
je     1138 <alphatonum+0x18>
add    $0xbf,%cl
jmp    114a <alphatonum+0x2a>
movsbl %cl,%edi
call   1030 <islower@plt>
test   %rax,%rax
je     114c <alphatonum+0x2c>
mov    (%rbx),%cl
add    $0x9f,%cl
mov    %cl,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @alphatonum(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i64 @isupper(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %10, 65
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
br label %25
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = call i64 @islower(i8 signext %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %21, 97
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
br label %24
24: ; preds = %18, %13
br label %25
25: ; preds = %24, %7
ret void
}

LLVM IR (-O2):
define void @alphatonum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isupper(i8 signext %2)
%4 = icmp eq i64 %3, 0
%5 = load i8, i8* %0
br i1 %4, label %8, label %6
6: ; preds = %1
%7 = add i8 %5, -65
br label %14
8: ; preds = %1
%9 = tail call i64 @islower(i8 signext %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = load i8, i8* %0
%13 = add i8 %12, -97
br label %14
14: ; preds = %6, %11
%15 = phi i8 [ %13, %11 ], [ %7, %6 ]
store i8 %15, i8* %0
br label %16
16: ; preds = %14, %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegWriteByte(int /*<<< orphan*/, int,
                                      int /*<<< orphan*/);
void wiznetSetSocketMode(uint8_t socket, uint8_t mode) {
  wiznetRegWriteByte(socket, (0x0000 + 0x0000), mode);
}


x86 assembly (clang, -O0):
<wiznetSetSocketMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
xor    %esi,%esi
call   1030 <wiznetRegWriteByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiznetSetSocketMode>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wiznetRegWriteByte@plt>

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

LLVM IR (-O2):
define void @wiznetSetSocketMode(i32 %0, i32 %1) {
%3 = tail call i32 @wiznetRegWriteByte(i32 %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
long double erfc(long double);
long double imprecise_erfcl(long double v) { return erfc(v); }


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

x86 assembly (clang, -O2):
<imprecise_erfcl>:
jmp    1030 <erfc@plt>

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

LLVM IR (-O2):
define x86_fp80 @imprecise_erfcl(x86_fp80 %0) {
%2 = tail call x86_fp80 @erfc(x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcpy(char *, char *);
void strcpy_then_free(char *dest, char *src) {
  strcpy(dest, src);
  free(src);
}


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

x86 assembly (clang, -O2):
<strcpy_then_free>:
push   %rbx
mov    %rsi,%rbx
call   1040 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @strcpy_then_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @strcpy_then_free(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i32 @free(i8* %1)
ret void
}
void psp_video_resize(unsigned int width, unsigned int height, int fullscreen) {
}


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

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

LLVM IR (-O0):
define void @psp_video_resize(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 void
}

LLVM IR (-O2):
define void @psp_video_resize(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
char *piece_inverse(char *, char, int);
char *piece_delete(char *source_destination, char delimiter, int piece_offset) {
  return piece_inverse(source_destination, delimiter, piece_offset);
}


x86 assembly (clang, -O0):
<piece_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%edx
movsbl %al,%esi
call   1030 <piece_inverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<piece_delete>:
jmp    1030 <piece_inverse@plt>

LLVM IR (-O0):
define i8* @piece_delete(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** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i8* @piece_inverse(i8* %7, i8 signext %8, i32 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @piece_delete(i8* %0, i8 signext %1, i32 %2) {
%4 = tail call i8* @piece_inverse(i8* %0, i8 signext %1, i32 %2)
ret i8* %4
}
int test_imm_77int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x77 << 0)) ? -20 : -40;
}


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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_store_pd(double *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double, double);
void print128(__m128d val) {
  double a[2];
  _mm_store_pd(&a[0], val);
  printf("%f %f", a[0], a[1]);
}


x86 assembly (clang, -O0):
<print128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_store_pd@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print128>:
sub    $0x18,%rsp
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <_mm_store_pd@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
define void @print128(i32 %0) {
%2 = alloca [2 x double]
%3 = bitcast [2 x double]* %2 to i8*
%4 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 0
%5 = call i32 @_mm_store_pd(double* %4, i32 %0)
%6 = load double, double* %4
%7 = getelementptr inbounds [2 x double], [2 x double]* %2, i64 0, i64 1
%8 = load double, double* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %6, double %8)
ret void
}
__attribute__((always_)) void nnue_incbin_init() { (void)0; }


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

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

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

LLVM IR (-O2):
define void @nnue_incbin_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XSetLocaleModifiers() {
  printf("XSetLocaleModifiers called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"XSetLocaleModifiers called\0A\00"
define i32 @XSetLocaleModifiers() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"XSetLocaleModifiers called\00"
define i32 @XSetLocaleModifiers() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}