xunge/DecIR huggingface dataset:
float min(float x, float y) {
  if (x < y)
    return (x);
  return (y);
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <min+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = fcmp olt float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %13
11: ; preds = %2
%12 = load float, float* %5
store float %12, float* %3
br label %13
13: ; preds = %11, %9
%14 = load float, float* %3
ret float %14
}

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
unsigned int test_func_01(unsigned int a) { return __builtin_bswap32(a); }


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

x86 assembly (clang, -O2):
<test_func_01>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @test_func_01(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @test_func_01(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int getpriority_or_exit();
int /*<<< orphan*/ printf(char *, int);
void check_priority() {
  int nice = getpriority_or_exit();
  if (nice >= 0) {
    printf("WARNING: priority is %d.  Consider running as root, nice -20.\n",
           nice);
  }
}


x86 assembly (clang, -O0):
<check_priority>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getpriority_or_exit@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     114b <check_priority+0x2b>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_priority>:
push   %rax
xor    %eax,%eax
call   1040 <getpriority_or_exit@plt>
test   %eax,%eax
js     113b <check_priority+0x1b>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [63 x i8] c"WARNING: priority is %d. Consider running as root, nice -20.\0A\00"
define void @check_priority() {
%1 = alloca i32
%2 = call i32 (...) @getpriority_or_exit()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"WARNING: priority is %d. Consider running as root, nice -20.\0A\00"
define void @check_priority() {
%1 = tail call i32 (...) @getpriority_or_exit()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, kvad, kub;
  scanf("%d", &a);
  kvad = a * a;
  kub = kvad * a;
  printf("\n%d", kvad);
  printf("\n%d", kub);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int cmpstr(const void *s0, const void *s1) {
  return strcmp(*(char **)s0, *(char **)s1);
}


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

x86 assembly (clang, -O2):
<cmpstr>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpstr(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
unsigned long long int ld2ull(long double d) {
  return (unsigned long long int)d;
}


x86 assembly (clang, -O0):
<ld2ull>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomi %st(1),%st
setbe  %al
fldz
fcmovbe %st(1),%st
fstp   %st(1)
fsubrp %st,%st(1)
fnstcw -0x1a(%rbp)
movzwl -0x1a(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x1c(%rbp)
fldcw  -0x1c(%rbp)
fistpll -0x18(%rbp)
fldcw  -0x1a(%rbp)
movzbl %al,%eax
mov    %eax,%ecx
shl    $0x3f,%rcx
mov    -0x18(%rbp),%rax
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld2ull>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomi %st(1),%st
setbe  %al
fldz
fcmovbe %st(1),%st
fstp   %st(1)
fsubrp %st,%st(1)
fnstcw -0xc(%rsp)
movzwl -0xc(%rsp),%ecx
or     $0xc00,%ecx
mov    %cx,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistpll -0x8(%rsp)
fldcw  -0xc(%rsp)
shl    $0x3f,%rax
xor    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @ld2ull(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptoui x86_fp80 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @ld2ull(x86_fp80 %0) {
%2 = fptoui x86_fp80 %0 to i64
ret i64 %2
}
void __attribute__((warning("curl_easy_setopt expects a struct curl_httppost* "
                            "argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_curl_httpost(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_curl_httpost() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ isalnum(int);
scalar_t__ isprint(int);
scalar_t__ isspace(int);
int ispunct(int c) { return isprint(c) && (!(isspace(c) || isalnum(c))); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1189 <ispunct+0x59>
mov    -0x4(%rbp),%edi
call   1040 <isspace@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x6(%rbp)
jne    1181 <ispunct+0x51>
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%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):
<ispunct>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1050 <isprint@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115c <ispunct+0x2c>
mov    %ebp,%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    115c <ispunct+0x2c>
mov    %ebp,%edi
call   1030 <isalnum@plt>
xor    %ebx,%ebx
test   %rax,%rax
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ispunct(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isprint(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isspace(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i64 @isalnum(i32 %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
%16 = xor i1 %15, true
br label %17
17: ; preds = %14, %1
%18 = phi i1 [ false, %1 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @ispunct(i32 %0) {
%2 = tail call i64 @isprint(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i64 @isspace(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @isalnum(i32 %0)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x5d() {
  Assert_real((isbdigit(93) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              470, ("isbdigit should be 0 for ]"));
}


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

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

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

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


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

x86 assembly (clang, -O2):
<specifier_escape>:
lea    0xeea(%rip),%rsi
lea    0xee2(%rip),%rdx
jmp    1030 <strreplace@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"%\00"
@.str.1 = [3 x i8] c"%%\00"
define i8* @specifier_escape(i8* %0) {
%2 = tail call i8* @strreplace(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
void admhc_dump_td(const struct admhcd *ahcd, const char *label,
                   const struct td *td) {}


x86 assembly (clang, -O0):
<admhc_dump_td>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.admhcd = type opaque
%struct.td = type opaque
define void @admhc_dump_td(%struct.admhcd* %0, i8* %1, %struct.td* %2) {
%4 = alloca %struct.admhcd*
%5 = alloca i8*
%6 = alloca %struct.td*
store %struct.admhcd* %0, %struct.admhcd** %4
store i8* %1, i8** %5
store %struct.td* %2, %struct.td** %6
ret void
}

LLVM IR (-O2):
%struct.admhcd = type opaque
%struct.td = type opaque
define void @admhc_dump_td(%struct.admhcd* nocapture %0, i8* nocapture %1, %struct.td* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tek_graph(void) { printf("\033[?38h"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?38h\00"
define void @tek_graph() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?38h\00"
define void @tek_graph() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ck_bt_stderr(char const *, unsigned int, char const *,
                                char *);
void ck_bt(const char *filename, unsigned int line, const char *msg) {
  ck_bt_stderr(filename, line, msg, "%s.%u: %s\n");
}


x86 assembly (clang, -O0):
<ck_bt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xecb(%rip),%rcx
call   1030 <ck_bt_stderr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck_bt>:
lea    0xee9(%rip),%rcx
jmp    1030 <ck_bt_stderr@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"%s.%u: %s\0A\00"
define void @ck_bt(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @ck_bt_stderr(i8* %0, i32 %1, i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
int hmd_stat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hmd_stat() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void predict_4x4_h(uint8_t *src, int i_stride) {
  int i;
  for (i = 0; i < 4; i++) {
    uint32_t *p = (uint32_t *)src;
    *p = 0x01010101 * src[-1];
    src += i_stride;
  }
}


x86 assembly (clang, -O0):
<predict_4x4_h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    1158 <predict_4x4_h+0x58>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x1010101,-0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <predict_4x4_h+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<predict_4x4_h>:
movslq %esi,%rax
imul   $0x1010101,-0x4(%rdi),%ecx
mov    %ecx,(%rdi)
lea    (%rdi,%rax,4),%rcx
imul   $0x1010101,-0x4(%rdi,%rax,4),%edx
01
mov    %edx,(%rdi,%rax,4)
lea    (%rcx,%rax,4),%rdx
imul   $0x1010101,-0x4(%rcx,%rax,4),%esi
01
mov    %esi,(%rcx,%rax,4)
imul   $0x1010101,-0x4(%rdx,%rax,4),%ecx
01
mov    %ecx,(%rdx,%rax,4)
ret

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

LLVM IR (-O2):
define void @predict_4x4_h(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 -1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 16843009
store i32 %6, i32* %0
%7 = getelementptr inbounds i32, i32* %0, i64 %3
%8 = getelementptr inbounds i32, i32* %7, i64 -1
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, 16843009
store i32 %10, i32* %7
%11 = getelementptr inbounds i32, i32* %7, i64 %3
%12 = getelementptr inbounds i32, i32* %11, i64 -1
%13 = load i32, i32* %12
%14 = mul nsw i32 %13, 16843009
store i32 %14, i32* %11
%15 = getelementptr inbounds i32, i32* %11, i64 %3
%16 = getelementptr inbounds i32, i32* %15, i64 -1
%17 = load i32, i32* %16
%18 = mul nsw i32 %17, 16843009
store i32 %18, i32* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xe0() {
  Assert_real((isdigit(224) == 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",
              1125, ("isdigit should be 0 for 0xe0"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x465,%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 0xe0\00"
define void @t_isdigit_0xe0() {
%1 = call i64 @isdigit(i32 224)
%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 1125, 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 0xe0\00"
define void @t_isdigit_0xe0() {
%1 = tail call i64 @isdigit(i32 224)
%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 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ pv_getnum_ll(char const *);
int pv_getnum_i(const char *str) { return (int)pv_getnum_ll(str); }


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

x86 assembly (clang, -O2):
<pv_getnum_i>:
jmp    1030 <pv_getnum_ll@plt>

LLVM IR (-O0):
define i32 @pv_getnum_i(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @pv_getnum_ll(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @pv_getnum_i(i8* %0) {
%2 = tail call i64 @pv_getnum_ll(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
void usi_topkick_init(void) {}


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

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

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

LLVM IR (-O2):
define void @usi_topkick_init() {
ret void
}
/* Variables and functions */
int log(float);
float rmstodb(float f) {
  if (f <= 0)
    return (0);
  else {
    float val = 100 + 20. / 2.302585092994 * log(f);
    return (val < 0 ? 0 : val);
  }
}


x86 assembly (clang, -O0):
<rmstodb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1137 <rmstodb+0x27>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1194 <rmstodb+0x84>
movss  -0x8(%rbp),%xmm0
call   1030 <log@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1180 <rmstodb+0x70>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    118a <rmstodb+0x7a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rmstodb>:
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm1,%xmm0
jae    114d <rmstodb+0x3d>
push   %rax
movaps %xmm1,%xmm0
call   1030 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xecd(%rip),%xmm0
addsd  0xecd(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
xorps  %xmm0,%xmm0
maxss  %xmm1,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define float @rmstodb(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp ole float %5, 0.000000e+00
br i1 %6, label %7, label %8
7: ; preds = %1
store float 0.000000e+00, float* %2
br label %21
8: ; preds = %1
%9 = load float, float* %3
%10 = call i32 @log(float %9)
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double 0x40215F2CED384F8A, double %11, double 1.000000e+02)
%13 = fptrunc double %12 to float
store float %13, float* %4
%14 = load float, float* %4
%15 = fcmp olt float %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %8
br label %19
17: ; preds = %8
%18 = load float, float* %4
br label %19
19: ; preds = %17, %16
%20 = phi float [ 0.000000e+00, %16 ], [ %18, %17 ]
store float %20, float* %2
br label %21
21: ; preds = %19, %7
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @rmstodb(float %0) {
%2 = fcmp ugt float %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = tail call i32 @log(float %0)
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 0x40215F2CED384F8A, double 1.000000e+02)
%7 = fptrunc double %6 to float
%8 = fcmp olt float %7, 0.000000e+00
%9 = select i1 %8, float 0.000000e+00, float %7
br label %10
10: ; preds = %1, %3
%11 = phi float [ %9, %3 ], [ 0.000000e+00, %1 ]
ret float %11
}
adr0imm1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*((short *)10000000)) = 33; }


x86 assembly (clang, -O0):
<adr0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    $0x989680,%eax
movw   $0x21,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0imm1_set>:
movw   $0x21,0x989680
ret

LLVM IR (-O0):
define i32 @adr0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
store i16 33, i16* inttoptr (i64 10000000 to i16*)
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @adr0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture readnone %5) {
store i16 33, i16* inttoptr (i64 10000000 to i16*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *argv[]) {
  fprintf(stderr,
          "usage: %s "
          "[-d dirname] [-p prefix] [-l doclen] [-n ndocs]\n"
          "[-v noisevocabsize] [-f noisevocabfrac] distfile\n"
          " Will output NDOCS files each of length DOCLEN with"
          " filenames having \n"
          " PREFIX to directory DIRNAME.\n"
          " With probability NOISEVOCABFRAC, instead of picking"
          " a word from the\n"
          " distribution specified by DISTFILE, a word will be chosen"
          " uniformly \n"
          " from one of NOISEVOCABSIZE noise-words\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [387 x i8] c"usage: %s [-d dirname] [-p prefix] [-l doclen] [-n ndocs]\0A[-v noisevocabsize] [-f noisevocabfrac] distfile\0A Will output NDOCS files each of length DOCLEN with filenames having \0A PREFIX to directory DIRNAME.\0A With probability NOISEVOCABFRAC, instead of picking a word from the\0A distribution specified by DISTFILE, a word will be chosen uniformly \0A from one of NOISEVOCABSIZE noise-words\0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([387 x i8], [387 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [387 x i8] c"usage: %s [-d dirname] [-p prefix] [-l doclen] [-n ndocs]\0A[-v noisevocabsize] [-f noisevocabfrac] distfile\0A Will output NDOCS files each of length DOCLEN with filenames having \0A PREFIX to directory DIRNAME.\0A With probability NOISEVOCABFRAC, instead of picking a word from the\0A distribution specified by DISTFILE, a word will be chosen uniformly \0A from one of NOISEVOCABSIZE noise-words\0A\00"
define void @print_usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([387 x i8], [387 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
double cosh(double);
double log(double);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double param, result;
  param = log(2.0);
  result = cosh(param);
  printf("The hyperbolic cosine of %f is %f.\n", param, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cosh@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"The hyperbolic cosine of %f is %f.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double @log(double 2.000000e+00)
store double %4, double* %2
%5 = load double, double* %2
%6 = call double @cosh(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = load double, double* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %7, double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"The hyperbolic cosine of %f is %f.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double 0x3FE62E42FEFA39EF, double 1.250000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ATKprintf(char *, ...);
void SI(int i) {
  if (i == 536870911)
    ATKprintf("    MXI");
  else
    ATKprintf("%7d", i);
}


x86 assembly (clang, -O0):
<SI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1fffffff,-0x4(%rbp)
jne    113b <SI+0x2b>
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <ATKprintf@plt>
jmp    114c <SI+0x3c>
mov    -0x4(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <ATKprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SI>:
cmp    $0x1fffffff,%edi
jne    1126 <SI+0x16>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <ATKprintf@plt>
mov    %edi,%esi
lea    0xed9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <ATKprintf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c" MXI\00"
@.str.1 = [4 x i8] c"%7d\00"
define void @SI(i32 %0) {
%2 = icmp eq i32 %0, 536870911
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @ATKprintf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @ATKprintf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
int nop_unlock(void *handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @nop_unlock(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int do_compare(int /*<<< orphan*/, int /*<<< orphan*/);
int compare(const void *a, const void *b) {
  const struct dirent *a2 = a;
  const struct dirent *b2 = b;
  return do_compare(a2->d_name, b2->d_name);
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1030 <do_compare@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <do_compare@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca %struct.dirent*
%6 = alloca %struct.dirent*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.dirent*
store %struct.dirent* %8, %struct.dirent** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.dirent*
store %struct.dirent* %10, %struct.dirent** %6
%11 = load %struct.dirent*, %struct.dirent** %5
%12 = getelementptr inbounds %struct.dirent, %struct.dirent* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = load %struct.dirent*, %struct.dirent** %6
%15 = getelementptr inbounds %struct.dirent, %struct.dirent* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i32 @do_compare(i32 %13, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @do_compare(i32 %4, i32 %6)
ret i32 %7
}
void reverseList(struct list *list) {}


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

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

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

LLVM IR (-O2):
%struct.list = type opaque
define void @reverseList(%struct.list* nocapture %0) {
ret void
}
void TKDRIV(ifunc, rbuf, nbuf, chr, lchr, mode, w_ifunc, w_rbuf, w_nbuf, w_chr,
            w_lchr, w_mode) int *ifunc;
float *rbuf;
int *nbuf;
char *chr;
int *lchr;
int w_ifunc, w_rbuf, w_nbuf, w_chr, w_lchr, w_mode;
{
  tkdriv_(ifunc, rbuf, nbuf, chr, lchr, mode, w_chr);
  return;
}


x86 assembly (clang, -O0):
<TKDRIV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
mov    0x28(%rbp),%eax
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <tkdriv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TKDRIV>:
push   %rax
mov    0x28(%rsp),%eax
mov    %eax,(%rsp)
xor    %eax,%eax
call   1030 <tkdriv_@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @TKDRIV(i32* %0, float* %1, i32* %2, i8* %3, i32* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca i32*
%14 = alloca float*
%15 = alloca i32*
%16 = alloca i8*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i32* %0, i32** %13
store float* %1, float** %14
store i32* %2, i32** %15
store i8* %3, i8** %16
store i32* %4, i32** %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i32 %10, i32* %23
store i32 %11, i32* %24
%25 = load i32*, i32** %13
%26 = load float*, float** %14
%27 = load i32*, i32** %15
%28 = load i8*, i8** %16
%29 = load i32*, i32** %17
%30 = load i32, i32* %18
%31 = load i32, i32* %22
%32 = call i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...) bitcast (i32 (...)* @tkdriv_ to i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...)*)(i32* %25, float* %26, i32* %27, i8* %28, i32* %29, i32 %30, i32 %31)
ret void
}

LLVM IR (-O2):
define void @TKDRIV(i32* %0, float* %1, i32* %2, i8* %3, i32* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = tail call i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...) bitcast (i32 (...)* @tkdriv_ to i32 (i32*, float*, i32*, i8*, i32*, i32, i32, ...)*)(i32* %0, float* %1, i32* %2, i8* %3, i32* %4, i32 %5, i32 %9)
ret void
}
volatile unsigned read_value(volatile unsigned *gpio, int pin) {
  return *(gpio + 13) &= (1 << (pin));
}


x86 assembly (clang, -O0):
<read_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rcx
mov    0x34(%rcx),%eax
and    %edx,%eax
mov    %eax,0x34(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_value>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    0x34(%rdi),%eax
mov    %eax,0x34(%rdi)
ret

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

LLVM IR (-O2):
define i32 @read_value(i32* %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = getelementptr inbounds i32, i32* %0, i64 13
%5 = load volatile i32, i32* %4
%6 = and i32 %5, %3
store volatile i32 %6, i32* %4
ret i32 %6
}
double recip(z)
double z;
{ return (1.00 / z); }


x86 assembly (clang, -O0):
<recip>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<recip>:
movsd  0xef8(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @recip(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
ret double %4
}

LLVM IR (-O2):
define double @recip(double %0) {
%2 = fdiv double 1.000000e+00, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ddd(char *x) {
  free(x);
  free(x);
}


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

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

LLVM IR (-O0):
define void @ddd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @free(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @ddd(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
%3 = tail call i32 @free(i8* %0)
ret void
}
unsigned char core___core__NativeString____91d_93d(char *self, long p0) {
  unsigned char var;
  unsigned char var1;
  var1 = (unsigned char)((int)self[p0]);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<core___core__NativeString____91d_93d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<core___core__NativeString____91d_93d>:
mov    (%rdi,%rsi,1),%al
ret

LLVM IR (-O0):
define zeroext i8 @core___core__NativeString____91d_93d(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = getelementptr inbounds i8, i8* %7, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = trunc i32 %11 to i8
store i8 %12, i8* %6
%13 = load i8, i8* %6
store i8 %13, i8* %5
br label %14
14: ; preds = %2
%15 = load i8, i8* %5
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @core___core__NativeString____91d_93d(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void msg() {
  char *a = 0;
  *a = 'a';
  printf("Hola mundo\n");
}


x86 assembly (clang, -O0):
<msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x61,(%rax)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [12 x i8] c"Hola mundo\0A\00"
define void @msg() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
store i8 97, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
/* Type definitions */
struct ibv_context {
  int dummy;
};
struct ibv_async_event {
  int dummy;
};

/* Variables and functions */
int _get_async_event(struct ibv_context *, struct ibv_async_event *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_get_async_event(struct ibv_context *context,
                        struct ibv_async_event *event) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _get_async_event(context, event);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_get_async_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_get_async_event@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_get_async_event>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <_get_async_event@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
%struct.ibv_async_event = type { i32 }
define i32 @ibv_get_async_event(%struct.ibv_context* %0, %struct.ibv_async_event* %1) {
%3 = alloca %struct.ibv_context*
%4 = alloca %struct.ibv_async_event*
%5 = alloca i32
store %struct.ibv_context* %0, %struct.ibv_context** %3
store %struct.ibv_async_event* %1, %struct.ibv_async_event** %4
%6 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%7 = load %struct.ibv_context*, %struct.ibv_context** %3
%8 = load %struct.ibv_async_event*, %struct.ibv_async_event** %4
%9 = call i32 @_get_async_event(%struct.ibv_context* %7, %struct.ibv_async_event* %8)
store i32 %9, i32* %5
%10 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
%struct.ibv_async_event = type { i32 }
define i32 @ibv_get_async_event(%struct.ibv_context* %0, %struct.ibv_async_event* %1) {
%3 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%4 = tail call i32 @_get_async_event(%struct.ibv_context* %0, %struct.ibv_async_event* %1)
%5 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %4
}
void callee(int *arr) { arr[0] = 7; }


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

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

LLVM IR (-O0):
define void @callee(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 7, i32* %4
ret void
}

LLVM IR (-O2):
define void @callee(i32* nocapture writeonly %0) {
store i32 7, i32* %0
ret void
}
int test_imm_10int64_midword_reg(long long val) {
  return ((val >> 16) & (0x10 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_10int64_midword_reg>:
test   $0x100000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_10int64_midword_reg(i64 %0) {
%2 = and i64 %0, 1048576
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int xf86RemoveSIGIOHandler(int fd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @xf86RemoveSIGIOHandler(i32 %0) {
ret i32 0
}