xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void set_hostname_and_port(char *hostname, char *portstr, int family,
                           int port) {
  strcpy(hostname, "0.0.0.0");
  sprintf(portstr, "%u", port);
}


x86 assembly (clang, -O0):
<set_hostname_and_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_hostname_and_port>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %rsi,%rbx
lea    0xed1(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"0.0.0.0\00"
@.str.1 = [3 x i8] c"%u\00"
define void @set_hostname_and_port(i8* %0, i8* nocapture writeonly %1, i32 %2, i32 %3) {
%5 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
OP(dd, af) { op_af(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_af()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ giterr_set_oom();
void *realloc(void *, size_t);
void *git__realloc(void *ptr, size_t size) {
  void *new_ptr = realloc(ptr, size);
  if (!new_ptr)
    giterr_set_oom();
  return new_ptr;
}


x86 assembly (clang, -O0):
<git__realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <git__realloc+0x33>
mov    $0x0,%al
call   1030 <giterr_set_oom@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<git__realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <git__realloc+0x15>
xor    %eax,%eax
call   1030 <giterr_set_oom@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @git__realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 (...) @giterr_set_oom()
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @git__realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @giterr_set_oom()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void MakeTrack_AddSync(char **pTrackData) {
  int i;
  unsigned char *pLocalTrackData = (unsigned char *)*pTrackData;
  for (i = 12 - 1; i >= 0; i--) {
    pLocalTrackData[0] = 0x0;
    pLocalTrackData++;
  }
  pLocalTrackData[0] = 0x0a1;
  pLocalTrackData++;
  pLocalTrackData[0] = 0x0a1;
  pLocalTrackData++;
  pLocalTrackData[0] = 0x0a1;
  pLocalTrackData++;
  *pTrackData = (char *)pLocalTrackData;
}


x86 assembly (clang, -O0):
<MakeTrack_AddSync>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0xb,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1145 <MakeTrack_AddSync+0x45>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111a <MakeTrack_AddSync+0x1a>
mov    -0x18(%rbp),%rax
movb   $0xa1,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0xa1,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0xa1,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MakeTrack_AddSync>:
mov    (%rdi),%rax
movl   $0x0,0x8(%rax)
movq   $0x0,(%rax)
movw   $0xa1a1,0xc(%rax)
movb   $0xa1,0xe(%rax)
add    $0xf,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @MakeTrack_AddSync(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr i8, i8* %2, i64 12
store i8 -95, i8* %3
%4 = getelementptr i8, i8* %2, i64 13
store i8 -95, i8* %4
%5 = getelementptr i8, i8* %2, i64 14
store i8 -95, i8* %5
%6 = getelementptr i8, i8* %2, i64 15
store i8* %6, i8** %0
ret void
}
int main() {
  char var_m[8];
  var_m[7] = 0xFA;
  return 5;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 7
store i8 -6, i8* %3
ret i32 5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
int intwidth(int i) {
  int j = 1;
  while (i /= 10)
    j++;
  return ((j > 10) ? 10 : j);
}


x86 assembly (clang, -O0):
<intwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1133 <intwidth+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <intwidth+0xe>
cmpl   $0xa,-0x8(%rbp)
jle    114a <intwidth+0x4a>
mov    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <intwidth+0x50>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intwidth>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1144 <intwidth+0x44>
xor    %ecx,%ecx
nop
movslq %edi,%rax
imul   $0x66666667,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rax
lea    (%rax,%rdx,1),%edi
add    %edx,%eax
add    $0x9,%eax
add    $0x1,%ecx
cmp    $0x12,%eax
ja     1110 <intwidth+0x10>
mov    $0xa,%eax
cmp    $0x8,%ecx
ja     1144 <intwidth+0x44>
add    $0x1,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @intwidth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 10
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 10
br i1 %13, label %14, label %15
14: ; preds = %11
br label %17
15: ; preds = %11
%16 = load i32, i32* %3
br label %17
17: ; preds = %15, %14
%18 = phi i32 [ 10, %14 ], [ %16, %15 ]
ret i32 %18
}

LLVM IR (-O2):
define i32 @intwidth(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4
%12 = icmp ult i32 %5, 9
br i1 %12, label %13, label %15
13: ; preds = %1, %11
%14 = phi i32 [ %8, %11 ], [ 1, %1 ]
br label %15
15: ; preds = %11, %13
%16 = phi i32 [ %14, %13 ], [ 10, %11 ]
ret i32 %16
}
int is_inet() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_inet() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unmap_region(void *, int);
void unmap_page(void *vaddr) { unmap_region(vaddr, 0x1000); }


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

x86 assembly (clang, -O2):
<unmap_page>:
mov    $0x1000,%esi
jmp    1030 <unmap_region@plt>

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

LLVM IR (-O2):
define void @unmap_page(i8* %0) {
%2 = tail call i32 @unmap_region(i8* %0, i32 4096)
ret void
}
unsigned long ieee80211_tu_to_usec(unsigned long tu) { return 1024 * tu; }


x86 assembly (clang, -O0):
<ieee80211_tu_to_usec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0xa,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_tu_to_usec>:
mov    %rdi,%rax
shl    $0xa,%rax
ret

LLVM IR (-O0):
define i64 @ieee80211_tu_to_usec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 1024, %3
ret i64 %4
}

LLVM IR (-O2):
define i64 @ieee80211_tu_to_usec(i64 %0) {
%2 = shl i64 %0, 10
ret i64 %2
}
int file_discard(env, fid)
register struct wnn_env *env;
register int fid;
{
  delete_file_from_env(env, fid);
  return (js_file_discard(env, fid));
}


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

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

LLVM IR (-O0):
%struct.wnn_env = type opaque
define i32 @file_discard(%struct.wnn_env* %0, i32 %1) {
%3 = alloca %struct.wnn_env*
%4 = alloca i32
store %struct.wnn_env* %0, %struct.wnn_env** %3
store i32 %1, i32* %4
%5 = load %struct.wnn_env*, %struct.wnn_env** %3
%6 = load i32, i32* %4
%7 = call i32 (%struct.wnn_env*, i32, ...) bitcast (i32 (...)* @delete_file_from_env to i32 (%struct.wnn_env*, i32, ...)*)(%struct.wnn_env* %5, i32 %6)
%8 = load %struct.wnn_env*, %struct.wnn_env** %3
%9 = load i32, i32* %4
%10 = call i32 (%struct.wnn_env*, i32, ...) bitcast (i32 (...)* @js_file_discard to i32 (%struct.wnn_env*, i32, ...)*)(%struct.wnn_env* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.wnn_env = type opaque
define i32 @file_discard(%struct.wnn_env* %0, i32 %1) {
%3 = tail call i32 (%struct.wnn_env*, i32, ...) bitcast (i32 (...)* @delete_file_from_env to i32 (%struct.wnn_env*, i32, ...)*)(%struct.wnn_env* %0, i32 %1)
%4 = tail call i32 (%struct.wnn_env*, i32, ...) bitcast (i32 (...)* @js_file_discard to i32 (%struct.wnn_env*, i32, ...)*)(%struct.wnn_env* %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int x, y;
  printf("hello%n world%n\n", &x, &y);
  printf("%d %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"hello%n world%n\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c_nngetrd(char *, double *);
void nngetrd_(char *pnam, double *rval) { c_nngetrd(pnam, rval); }


x86 assembly (clang, -O0):
<nngetrd_>:
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   1030 <c_nngetrd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nngetrd_>:
jmp    1030 <c_nngetrd@plt>

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

LLVM IR (-O2):
define void @nngetrd_(i8* %0, double* %1) {
%3 = tail call i32 @c_nngetrd(i8* %0, double* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Usage: [-w<window_size>] filename0 filename1 filename2...");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: [-w<window_size>] filename0 filename1 filename2...\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Usage: [-w<window_size>] filename0 filename1 filename2...\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int call(int, int /*<<< orphan*/);
int /*<<< orphan*/ t();
int first(int list) { return call(list, t()); }


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

x86 assembly (clang, -O2):
<first>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <t@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <call@plt>

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

LLVM IR (-O2):
define i32 @first(i32 %0) {
%2 = tail call i32 (...) @t()
%3 = tail call i32 @call(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AT_SECURE;
scalar_t__ getauxval(int /*<<< orphan*/);
char *getenv(char const *);
char *secure_getenv(const char *name) {
  if (getauxval(AT_SECURE))
    return NULL;
  return getenv(name);
}


x86 assembly (clang, -O0):
<secure_getenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <getauxval@plt>
cmp    $0x0,%rax
je     1151 <secure_getenv+0x31>
movq   $0x0,-0x8(%rbp)
jmp    115e <secure_getenv+0x3e>
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secure_getenv>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <getauxval@plt>
test   %rax,%rax
je     113b <secure_getenv+0x1b>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <getenv@plt>

LLVM IR (-O0):
@AT_SECURE = global i32 0
define i8* @secure_getenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @AT_SECURE
%5 = call i64 @getauxval(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @getenv(i8* %9)
store i8* %10, i8** %2
br label %11
11: ; preds = %8, %7
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@AT_SECURE = global i32 0
define i8* @secure_getenv(i8* nocapture %0) {
%2 = load i32, i32* @AT_SECURE
%3 = tail call i64 @getauxval(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i8* @getenv(i8* %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
void INT_Excep_PERIA_INTA252(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIA_INTA252() {
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef unsigned long uint16_t;

/* Variables and functions */
void LCDIDDDataWrite(uint32_t ui32Base, uint32_t ui32CS, uint16_t ui16Data) {
  uint32_t ui32Reg;
  ;
  ;
  ui32Reg = ui32CS ? 0x00000024 : 0x00000018;
  (*((volatile unsigned long *)(ui32Base + ui32Reg))) = ui16Data;
}


x86 assembly (clang, -O0):
<LCDIDDDataWrite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x18,%eax
mov    $0x24,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%eax
add    -0x14(%rbp),%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDIDDDataWrite>:
test   %esi,%esi
mov    $0x18,%eax
mov    $0x24,%ecx
cmove  %eax,%ecx
movslq %edi,%rax
mov    %rdx,(%rcx,%rax,1)
ret

LLVM IR (-O0):
define void @LCDIDDDataWrite(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 36, i32 24
store i32 %11, i32* %7
%12 = load i64, i64* %6
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i64*
store volatile i64 %12, i64* %17
ret void
}

LLVM IR (-O2):
define void @LCDIDDDataWrite(i32 %0, i32 %1, i64 %2) {
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 24, i32 36
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i64*
store volatile i64 %2, i64* %8
ret void
}
/* Variables and functions */
int spi_send_command(int, char *);
int nrf_get_status(char *retstatus) {
  return spi_send_command(0xFF, retstatus);
}


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

x86 assembly (clang, -O2):
<nrf_get_status>:
mov    %rdi,%rsi
mov    $0xff,%edi
jmp    1030 <spi_send_command@plt>

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

LLVM IR (-O2):
define i32 @nrf_get_status(i8* %0) {
%2 = tail call i32 @spi_send_command(i32 255, i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_sad_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_sad_pu8(__m64 a, __m64 b) { return _mm_sad_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_sad_pu8>:
jmp    1030 <_mm_sad_pu8@plt>

LLVM IR (-O0):
define i32 @test_mm_sad_pu8(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 @_mm_sad_pu8(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_sad_pu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_sad_pu8(i32 %0, i32 %1)
ret i32 %3
}
void test_hasht_search(struct hasht *t, char *k, char *v) {
  void *test_v = hasht_search(t, k);
  assert(test_v == v);
}


x86 assembly (clang, -O0):
<test_hasht_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <hasht_search@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hasht_search>:
push   %rbx
mov    %rdx,%rbx
xor    %eax,%eax
call   1030 <hasht_search@plt>
cltq
xor    %edi,%edi
cmp    %rbx,%rax
sete   %dil
xor    %eax,%eax
pop    %rbx
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.hasht = type opaque
define void @test_hasht_search(%struct.hasht* %0, i8* %1, i8* %2) {
%4 = alloca %struct.hasht*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store %struct.hasht* %0, %struct.hasht** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load %struct.hasht*, %struct.hasht** %4
%9 = load i8*, i8** %5
%10 = call i32 (%struct.hasht*, i8*, ...) bitcast (i32 (...)* @hasht_search to i32 (%struct.hasht*, i8*, ...)*)(%struct.hasht* %8, i8* %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = load i8*, i8** %6
%15 = icmp eq i8* %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %16)
ret void
}

LLVM IR (-O2):
%struct.hasht = type opaque
define void @test_hasht_search(%struct.hasht* %0, i8* %1, i8* readnone %2) {
%4 = tail call i32 (%struct.hasht*, i8*, ...) bitcast (i32 (...)* @hasht_search to i32 (%struct.hasht*, i8*, ...)*)(%struct.hasht* %0, i8* %1)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i8* %6, %2
%8 = zext i1 %7 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %8)
ret void
}
void trace_exception_unwind_to_native(struct jit_stack_frame *frame) {}


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

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

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

LLVM IR (-O2):
%struct.jit_stack_frame = type opaque
define void @trace_exception_unwind_to_native(%struct.jit_stack_frame* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *wcrt_openfile(char *filename, char *mode) {
  FILE *fptr;
  fptr = fopen(filename, mode);
  if (!fptr) {
    fprintf(stderr, "Failed to open file %s. (handler.c:48)\n", filename);
    exit(1);
  }
  return fptr;
}


x86 assembly (clang, -O0):
<wcrt_openfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <wcrt_openfile+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcrt_openfile>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <wcrt_openfile+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Failed to open file %s. (handler.c:48)\0A\00"
define i32* @wcrt_openfile(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Failed to open file %s. (handler.c:48)\0A\00"
define noalias i32* @wcrt_openfile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int curs_set(int);
int wrap_curs_set(int visibility) { return curs_set(visibility); }


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

x86 assembly (clang, -O2):
<wrap_curs_set>:
jmp    1030 <curs_set@plt>

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

LLVM IR (-O2):
define i32 @wrap_curs_set(i32 %0) {
%2 = tail call i32 @curs_set(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int get_rega(uint32_t insn) { return (insn & 0x0001f000) >> 12; }


x86 assembly (clang, -O0):
<get_rega>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f000,%eax
sar    $0xc,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rega>:
mov    %edi,%eax
shr    $0xc,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @get_rega(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 126976
%5 = ashr i32 %4, 12
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_rega(i32 %0) {
%2 = lshr i32 %0, 12
%3 = and i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xae() {
  Assert_real((isspace(174) == 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_isspace.c",
              875, ("isspace should be 0 for 0xae"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xae>:
push   %rax
mov    $0xae,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x36b,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xae\00"
define void @t_isspace_0xae() {
%1 = call i64 @isspace(i32 174)
%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 875, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xae\00"
define void @t_isspace_0xae() {
%1 = tail call i64 @isspace(i32 174)
%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 875, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int HOST_NAME_MAX;
int PATH_MAX;
int /*<<< orphan*/ print_title(char *);
int /*<<< orphan*/ prompt_fill(char *, int);
void print_default_title(void) {
  char buf[PATH_MAX + HOST_NAME_MAX];
  prompt_fill(buf, sizeof(buf));
  print_title(buf);
}


x86 assembly (clang, -O0):
<print_default_title>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%ecx
add    %ecx,%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x18(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x10(%rbp)
mov    %eax,%esi
call   1040 <prompt_fill@plt>
mov    -0x18(%rbp),%rdi
call   1030 <print_title@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_default_title>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2ec3(%rip),%rax
mov    0x2eac(%rip),%rcx
mov    (%rcx),%esi
add    (%rax),%esi
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%rbx
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <prompt_fill@plt>
mov    %rbx,%rdi
call   1030 <print_title@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@HOST_NAME_MAX = global i32 0
define void @print_default_title() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i32, i32* @PATH_MAX
%4 = load i32, i32* @HOST_NAME_MAX
%5 = add nsw i32 %3, %4
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %1
%8 = alloca i8, i64 %6
store i64 %6, i64* %2
%9 = trunc i64 %6 to i32
%10 = call i32 @prompt_fill(i8* %8, i32 %9)
%11 = call i32 @print_title(i8* %8)
%12 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@HOST_NAME_MAX = global i32 0
define void @print_default_title() {
%1 = load i32, i32* @PATH_MAX
%2 = load i32, i32* @HOST_NAME_MAX
%3 = add nsw i32 %2, %1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @prompt_fill(i8* %5, i32 %3)
%7 = call i32 @print_title(i8* %5)
ret void
}
int is_factor3(int n) {
  if ((n % 3 == 0) && n)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_factor3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1131 <is_factor3+0x31>
cmpl   $0x0,-0x8(%rbp)
je     1131 <is_factor3+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <is_factor3+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_factor3>:
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
setb   %al
test   %edi,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_factor3(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = icmp ne i32 %0, 0
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
size_t plus_linear_min(int);
void plus_linear_min3_Good_FP() {
  int a[20];
  a[plus_linear_min(15)] = 1;
}


x86 assembly (clang, -O0):
<plus_linear_min3_Good_FP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0xf,%edi
call   1030 <plus_linear_min@plt>
movl   $0x1,-0x50(%rbp,%rax,4)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus_linear_min3_Good_FP>:
mov    $0xf,%edi
jmp    1030 <plus_linear_min@plt>

LLVM IR (-O0):
define void @plus_linear_min3_Good_FP() {
%1 = alloca [20 x i32]
%2 = call i64 @plus_linear_min(i32 15)
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 %2
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @plus_linear_min3_Good_FP() {
%1 = tail call i64 @plus_linear_min(i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int);
void exitfunc3(int status, void *arg) {
  printf("Executing exitfunc3 (status=%d, arg=%d)\n", status, (int)arg);
  exit((int)arg);
}


x86 assembly (clang, -O0):
<exitfunc3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc3>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
lea    0xed3(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Executing exitfunc3 (status=%d, arg=%d)\0A\00"
define void @exitfunc3(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i32
%8 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i32
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Executing exitfunc3 (status=%d, arg=%d)\0A\00"
define void @exitfunc3(i32 %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %4)
%6 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stub_state_post_print(void *);
int /*<<< orphan*/ stub_state_pre_print(void *);
int stub_read_bool(int value, void *data) {
  stub_state_pre_print(data);
  if (value)
    printf("true");
  else
    printf("false");
  stub_state_post_print(data);
  return 0;
}


x86 assembly (clang, -O0):
<stub_read_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <stub_state_pre_print@plt>
cmpl   $0x0,-0x4(%rbp)
je     1163 <stub_read_bool+0x33>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
jmp    116f <stub_read_bool+0x3f>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <stub_state_post_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_read_bool>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1050 <stub_state_pre_print@plt>
test   %ebp,%ebp
lea    0xebc(%rip),%rax
lea    0xeb0(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <stub_state_post_print@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i32 @stub_read_bool(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @stub_state_pre_print(i8* %5)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i8*, i8** %4
%15 = call i32 @stub_state_post_print(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"true\00"
@.str.1 = [6 x i8] c"false\00"
define i32 @stub_read_bool(i32 %0, i8* %1) {
%3 = tail call i32 @stub_state_pre_print(i8* %1)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
%7 = tail call i32 @stub_state_post_print(i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_6() {
  char *x = "aBDe";
  char *y = "abc";
  clang_analyzer_eval(strncasecmp(x, y, 3) == 1);
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncasecmp_diff_length_6>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncasecmp@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"aBDe\00"
@.str.1 = [4 x i8] c"abc\00"
define void @strncasecmp_diff_length_6() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 3)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"aBDe\00"
@.str.1 = [4 x i8] c"abc\00"
define void @strncasecmp_diff_length_6() {
%1 = tail call i32 @strncasecmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int ls_strcmp(const char *a, const char *b) {
  if (a == b) {
    return 0;
  }
  if (a == NULL) {
    return -1;
  }
  if (b == NULL) {
    return 1;
  }
  return strcmp(a, b);
}


x86 assembly (clang, -O0):
<ls_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <ls_strcmp+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1178 <ls_strcmp+0x68>
cmpq   $0x0,-0x10(%rbp)
jne    1151 <ls_strcmp+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <ls_strcmp+0x68>
cmpq   $0x0,-0x18(%rbp)
jne    1168 <ls_strcmp+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1178 <ls_strcmp+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_strcmp>:
cmp    %rsi,%rdi
je     1124 <ls_strcmp+0x14>
test   %rdi,%rdi
je     1127 <ls_strcmp+0x17>
test   %rsi,%rsi
je     112d <ls_strcmp+0x1d>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ls_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %4, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %4 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int doubleToRawLongBits(double);
double const longBitsToDouble(int);
__attribute__((always_)) const double fabsk(double x) {
  return longBitsToDouble(0x7fffffffffffffffLL & doubleToRawLongBits(x));
}


x86 assembly (clang, -O0):
<fabsk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
cltq
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %eax,%edi
call   1030 <longBitsToDouble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsk>:
push   %rax
call   1040 <doubleToRawLongBits@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <longBitsToDouble@plt>

LLVM IR (-O0):
define double @fabsk(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @doubleToRawLongBits(double %3)
%5 = sext i32 %4 to i64
%6 = and i64 9223372036854775807, %5
%7 = trunc i64 %6 to i32
%8 = call double @longBitsToDouble(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @fabsk(double %0) {
%2 = tail call i32 @doubleToRawLongBits(double %0)
%3 = tail call double @longBitsToDouble(i32 %2)
ret double %3
}
int array_size(int n, int sz) {
  sz = (((sz) + 7) & ~7);
  return n * sz;
}


x86 assembly (clang, -O0):
<array_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x7,%eax
and    $0xfffffff8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_size>:
lea    0x7(%rsi),%eax
and    $0xfffffff8,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @array_size(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 = add nsw i32 %5, 7
%7 = and i32 %6, -8
store i32 %7, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @array_size(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 7
%4 = and i32 %3, -8
%5 = mul nsw i32 %4, %0
ret i32 %5
}
int test_imm_98int32_reg(int val) { return ((val) & (0x98 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_98int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x98,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_98int32_reg(i32 %0) {
%2 = and i32 %0, 152
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double FLT_MAX;
extern double cmax_float() { return FLT_MAX; }


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

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

LLVM IR (-O0):
@FLT_MAX = global double 0.000000e+00
define double @cmax_float() {
%1 = load double, double* @FLT_MAX
ret double %1
}

LLVM IR (-O2):
@FLT_MAX = global double 0.000000e+00
define double @cmax_float() {
%1 = load double, double* @FLT_MAX
ret double %1
}