xunge/DecIR huggingface dataset:
void chomp(char *line, int len) {
  while (len-- > 0) {
    if (line[len] != 10 && line[len] != 13)
      break;
    line[len] = 0;
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    115f <chomp+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     114e <chomp+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xd,%eax
je     114e <chomp+0x4e>
jmp    115f <chomp+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    110b <chomp+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
test   %esi,%esi
jle    112f <chomp+0x2f>
mov    %esi,%eax
add    $0x1,%rax
jmp    111e <chomp+0x1e>
nopl   0x0(%rax)
movb   $0x0,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
jbe    112f <chomp+0x2f>
lea    -0x2(%rax),%ecx
movzbl (%rdi,%rcx,1),%edx
cmp    $0xd,%dl
je     1110 <chomp+0x10>
cmp    $0xa,%dl
je     1110 <chomp+0x10>
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %5, %4 ], [ %8, %12 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
switch i8 %11, label %14 [
i8 10, label %12
i8 13, label %12
]
12: ; preds = %6, %6
store i8 0, i8* %10
%13 = icmp ugt i64 %7, 1
br i1 %13, label %6, label %14
14: ; preds = %12, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
scalar_t__ chroot(char const *);
int do_chroot(const char *newroot) {
  if (chroot(newroot))
    return -1;
  chdir("/");
  return 0;
}


x86 assembly (clang, -O0):
<do_chroot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chroot@plt>
cmp    $0x0,%rax
je     114b <do_chroot+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <do_chroot+0x3e>
lea    0xeae(%rip),%rdi
call   1040 <chdir@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_chroot>:
push   %rax
call   1030 <chroot@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1135 <do_chroot+0x15>
pop    %rcx
ret
lea    0xec4(%rip),%rdi
call   1040 <chdir@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @do_chroot(i8* %0) {
%2 = tail call i64 @chroot(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, double);
void doubleToString(char s[], double num) { sprintf(s, "%f", num); }


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

x86 assembly (clang, -O2):
<doubleToString>:
lea    0xee9(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define void @doubleToString(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 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %6)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @doubleToString(i8* nocapture writeonly %0, double %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showMessage(char *msg) { printf("\033[;32;1m%s\033[0m", msg); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"\1B[;32;1m%s\1B[0m\00"
define void @showMessage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
void StringFreeFunc(void *val_addr) {
  char *val = *(char **)val_addr;
  printf("before_free:%s\n", val);
  free(val);
}


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

x86 assembly (clang, -O2):
<StringFreeFunc>:
push   %rbx
mov    (%rdi),%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"before_free:%s\0A\00"
define void @StringFreeFunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"before_free:%s\0A\00"
define void @StringFreeFunc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @free(i8* %3)
ret void
}
void ft_ultimate_ft(int *********nbr) {
  *********nbr = 42;
  return;
}


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

x86 assembly (clang, -O2):
<ft_ultimate_ft>:
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    (%rax),%rax
movl   $0x2a,(%rax)
ret

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

LLVM IR (-O2):
define void @ft_ultimate_ft(i32********* nocapture %0) {
%2 = load i32********, i32********* %0
%3 = load i32*******, i32******** %2
%4 = load i32******, i32******* %3
%5 = load i32*****, i32****** %4
%6 = load i32****, i32***** %5
%7 = load i32***, i32**** %6
%8 = load i32**, i32*** %7
%9 = load i32*, i32** %8
store i32 42, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void sti() { db(0xFB); }


x86 assembly (clang, -O0):
<sti>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfb,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sti>:
mov    $0xfb,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @sti() {
%1 = call i32 @db(i32 251)
ret void
}

LLVM IR (-O2):
define void @sti() {
%1 = tail call i32 @db(i32 251)
ret void
}
void mos_memset(void *mem, unsigned char value, int size) {
  while (size--) {
    *(unsigned char *)mem = value;
    mem = (unsigned char *)mem + 1;
  }
}


x86 assembly (clang, -O0):
<mos_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     113f <mos_memset+0x3f>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1111 <mos_memset+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mos_memset>:
test   %edx,%edx
je     1124 <mos_memset+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @mos_memset(i8* nocapture writeonly %0, i8 zeroext %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
int main(argc, argv)
int argc;
char **argv;
{
  int i;
  for (i = 1; i < argc; ++i) {
    extract(argv[i]);
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115a <main+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x0,%al
call   1030 <extract@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1144 <main+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
xor    %eax,%eax
call   1030 <extract@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @extract to i32 (i8*, ...)*)(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_license_intro() {
  printf("Croatian chess - tests application\n"
         "Copyright (c) 2021 Mario Mlačak, mmlacak@gmail.com.\n");
}


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

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

LLVM IR (-O0):
@.str = [89 x i8] c"Croatian chess - tests application\0ACopyright (c) 2021 Mario Mla\C4\8Dak, mmlacak@gmail.com.\0A\00"
define void @print_license_intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [88 x i8] c"Croatian chess - tests application\0ACopyright (c) 2021 Mario Mla\C4\8Dak, mmlacak@gmail.com.\00"
define void @print_license_intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int NSS_STATUS_SUCCESS;
enum nss_status _nss_test1_endpwent(void) { return NSS_STATUS_SUCCESS; }


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

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

LLVM IR (-O0):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_test1_endpwent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}

LLVM IR (-O2):
@NSS_STATUS_SUCCESS = global i32 0
define i32 @_nss_test1_endpwent() {
%1 = load i32, i32* @NSS_STATUS_SUCCESS
ret i32 %1
}
void AsmJump(void *addrTo, void *addrFrom) {
  unsigned long offset = (unsigned long)addrTo - ((unsigned long)addrFrom + 5);
  char *pq = (char *)addrFrom;
  pq[0] = 0xe9;
  pq[1] = offset & 0xFF;
  pq[2] = (offset >> 8) & 0xFF;
  pq[3] = (offset >> 16) & 0xFF;
  pq[4] = (offset >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<AsmJump>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
add    $0x5,%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0xe9,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AsmJump>:
mov    %rdi,%rax
sub    %rsi,%rax
add    $0xfffffffffffffffb,%rax
movb   $0xe9,(%rsi)
mov    %al,0x1(%rsi)
mov    %ah,0x2(%rsi)
mov    %rax,%rcx
shr    $0x10,%rcx
mov    %cl,0x3(%rsi)
shr    $0x18,%rax
mov    %al,0x4(%rsi)
ret

LLVM IR (-O0):
define void @AsmJump(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
%11 = add i64 %10, 5
%12 = sub i64 %8, %11
store i64 %12, i64* %5
%13 = load i8*, i8** %4
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = getelementptr inbounds i8, i8* %14, i64 0
store i8 -23, i8* %15
%16 = load i64, i64* %5
%17 = and i64 %16, 255
%18 = trunc i64 %17 to i8
%19 = load i8*, i8** %6
%20 = getelementptr inbounds i8, i8* %19, i64 1
store i8 %18, i8* %20
%21 = load i64, i64* %5
%22 = lshr i64 %21, 8
%23 = and i64 %22, 255
%24 = trunc i64 %23 to i8
%25 = load i8*, i8** %6
%26 = getelementptr inbounds i8, i8* %25, i64 2
store i8 %24, i8* %26
%27 = load i64, i64* %5
%28 = lshr i64 %27, 16
%29 = and i64 %28, 255
%30 = trunc i64 %29 to i8
%31 = load i8*, i8** %6
%32 = getelementptr inbounds i8, i8* %31, i64 3
store i8 %30, i8* %32
%33 = load i64, i64* %5
%34 = lshr i64 %33, 24
%35 = and i64 %34, 255
%36 = trunc i64 %35 to i8
%37 = load i8*, i8** %6
%38 = getelementptr inbounds i8, i8* %37, i64 4
store i8 %36, i8* %38
ret void
}

LLVM IR (-O2):
define void @AsmJump(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = add i64 %3, -5
%6 = sub i64 %5, %4
store i8 -23, i8* %1
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = lshr i64 %6, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %10, i8* %11
%12 = lshr i64 %6, 16
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %13, i8* %14
%15 = lshr i64 %6, 24
%16 = trunc i64 %15 to i8
%17 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %16, i8* %17
ret void
}
/* Variables and functions */
char *stringn(char const *, int);
char *string(const char *str) {
  const char *s;
  for (s = str; *s; s++)
    ;
  return stringn(str, s - str);
}


x86 assembly (clang, -O0):
<string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <string+0x37>
jmp    1136 <string+0x26>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <string+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%esi
call   1030 <stringn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string>:
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rsi,1)
lea    0x1(%rsi),%rsi
jne    1120 <string+0x10>
add    $0xffffffff,%esi
jmp    1030 <stringn@plt>

LLVM IR (-O0):
define i8* @string(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i8*, i8** %3
%16 = load i8*, i8** %2
%17 = ptrtoint i8* %15 to i64
%18 = ptrtoint i8* %16 to i64
%19 = sub i64 %17, %18
%20 = trunc i64 %19 to i32
%21 = call i8* @stringn(i8* %14, i32 %20)
ret i8* %21
}

LLVM IR (-O2):
define i8* @string(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = tail call i8* @stringn(i8* %0, i32 %11)
ret i8* %12
}
char *rumStrset(char *str, int i, char el) {
  str[i] = el;
  return str;
}


x86 assembly (clang, -O0):
<rumStrset>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rumStrset>:
mov    %rdi,%rax
movslq %esi,%rcx
mov    %dl,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define i8* @rumStrset(i8* %0, i32 %1, i8 signext %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* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 %7, i8* %11
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @rumStrset(i8* returned writeonly %0, i32 %1, i8 signext %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %2, i8* %5
ret i8* %0
}
/* Type definitions */
typedef char u_char;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
int will_notsup(FILE *sfp, FILE *tfp, int c) {
  (void)putc((u_char)255, sfp);
  (void)putc((u_char)252, sfp);
  (void)putc((char)c, sfp);
  return 0;
}


x86 assembly (clang, -O0):
<will_notsup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xffffffff,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xfffffffc,%edi
call   1030 <putc@plt>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<will_notsup>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
mov    $0xfffffffc,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
movsbl %bpl,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @will_notsup(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @putc(i8 signext -1, i32* %7)
%9 = load i32*, i32** %4
%10 = call i32 @putc(i8 signext -4, i32* %9)
%11 = load i32, i32* %6
%12 = trunc i32 %11 to i8
%13 = load i32*, i32** %4
%14 = call i32 @putc(i8 signext %12, i32* %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @will_notsup(i32* nocapture %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @putc(i8 signext -1, i32* %0)
%5 = tail call i32 @putc(i8 signext -4, i32* %0)
%6 = trunc i32 %2 to i8
%7 = tail call i32 @putc(i8 signext %6, i32* %0)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;
typedef int int64_t;

/* Variables and functions */
int testBit_fun_int64_t(int64_t x, uint32_t i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_int64_t>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_int64_t(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 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @testBit_fun_int64_t(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
long CDRclose(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @CDRclose() {
ret i64 0
}

LLVM IR (-O2):
define i64 @CDRclose() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ test45_M_foo__E();
void test45_Test9_test__I() {
  test45_M_foo__E();
  bar();
  test45_M_foo__E();
  bar();
}


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

x86 assembly (clang, -O2):
<test45_Test9_test__I>:
push   %rax
xor    %eax,%eax
call   1040 <test45_M_foo__E@plt>
xor    %eax,%eax
call   1030 <bar@plt>
xor    %eax,%eax
call   1040 <test45_M_foo__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @test45_Test9_test__I() {
%1 = call i32 (...) @test45_M_foo__E()
%2 = call i32 (...) @bar()
%3 = call i32 (...) @test45_M_foo__E()
%4 = call i32 (...) @bar()
ret void
}

LLVM IR (-O2):
define void @test45_Test9_test__I() {
%1 = tail call i32 (...) @test45_M_foo__E()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @test45_M_foo__E()
%4 = tail call i32 (...) @bar()
ret void
}
/* Variables and functions */
scalar_t__ ceil(float);
int srslte_cqi_hl_get_subband_size(int);
int srslte_cqi_hl_get_no_subbands(int nof_prb) {
  int hl_size = srslte_cqi_hl_get_subband_size(nof_prb);
  if (hl_size > 0) {
    return (int)ceil((float)nof_prb / hl_size);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<srslte_cqi_hl_get_no_subbands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <srslte_cqi_hl_get_subband_size@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115b <srslte_cqi_hl_get_no_subbands+0x3b>
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1040 <ceil@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <srslte_cqi_hl_get_no_subbands+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srslte_cqi_hl_get_no_subbands>:
push   %rbx
mov    %edi,%ebx
call   1030 <srslte_cqi_hl_get_subband_size@plt>
test   %eax,%eax
jle    113f <srslte_cqi_hl_get_no_subbands+0x1f>
cvtsi2ss %ebx,%xmm0
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
call   1040 <ceil@plt>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @srslte_cqi_hl_get_no_subbands(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @srslte_cqi_hl_get_subband_size(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to float
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to float
%14 = fdiv float %11, %13
%15 = call i64 @ceil(float %14)
%16 = trunc i64 %15 to i32
store i32 %16, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @srslte_cqi_hl_get_no_subbands(i32 %0) {
%2 = tail call i32 @srslte_cqi_hl_get_subband_size(i32 %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = sitofp i32 %0 to float
%6 = sitofp i32 %2 to float
%7 = fdiv float %5, %6
%8 = tail call i64 @ceil(float %7)
%9 = trunc i64 %8 to i32
br label %10
10: ; preds = %1, %4
%11 = phi i32 [ %9, %4 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *program_name) {
  fprintf(stderr, "Usage:\n%s -f <configuration file>\n", program_name);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Usage:\0A%s -f <configuration file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Usage:\0A%s -f <configuration file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t linear_rgb565(uint32_t r, uint32_t g, uint32_t b) {
  return (((r & 0xf8ul) >> 3) << 11) | (((g & 0xfcul) >> 2) << 5) |
         ((b & 0xf8ul) >> 3);
}


x86 assembly (clang, -O0):
<linear_rgb565>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
and    $0xf8,%rax
shr    $0x3,%rax
shl    $0xb,%rax
movslq -0x8(%rbp),%rcx
and    $0xfc,%rcx
shr    $0x2,%rcx
shl    $0x5,%rcx
or     %rcx,%rax
movslq -0xc(%rbp),%rcx
and    $0xf8,%rcx
shr    $0x3,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_rgb565>:
shl    $0x8,%edi
and    $0xf800,%edi
and    $0xfc,%esi
lea    (%rdi,%rsi,8),%eax
shr    $0x3,%edx
and    $0x1f,%edx
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @linear_rgb565(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = and i64 %8, 248
%10 = lshr i64 %9, 3
%11 = shl i64 %10, 11
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = and i64 %13, 252
%15 = lshr i64 %14, 2
%16 = shl i64 %15, 5
%17 = or i64 %11, %16
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = and i64 %19, 248
%21 = lshr i64 %20, 3
%22 = or i64 %17, %21
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
define i32 @linear_rgb565(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 8
%5 = and i32 %4, 63488
%6 = shl i32 %1, 3
%7 = and i32 %6, 2016
%8 = or i32 %7, %5
%9 = lshr i32 %2, 3
%10 = and i32 %9, 31
%11 = or i32 %8, %10
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t MPURegionCountGet(void) {
  return (((*((volatile uint32_t *)(0xE000ED90))) & 0x0000FF00) >> 8);
}


x86 assembly (clang, -O0):
<MPURegionCountGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed90,%eax
mov    (%rax),%eax
and    $0xff00,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionCountGet>:
mov    $0xe000ed90,%eax
mov    (%rax),%eax
movzbl %ah,%eax
ret

LLVM IR (-O0):
define i32 @MPURegionCountGet() {
%1 = load volatile i32, i32* inttoptr (i64 3758157200 to i32*)
%2 = and i32 %1, 65280
%3 = ashr i32 %2, 8
ret i32 %3
}

LLVM IR (-O2):
define i32 @MPURegionCountGet() {
%1 = load volatile i32, i32* inttoptr (i64 3758157200 to i32*)
%2 = lshr i32 %1, 8
%3 = and i32 %2, 255
ret i32 %3
}
int f0() {
  int x;
  unsigned short n = 1;
  int *a = &x;
  int *b = &x;
  a = a - n;
  b -= n;
  return a == b;
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
movw   $0x1,-0x6(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movzwl -0x6(%rbp),%ecx
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movzwl -0x6(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f0() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32*
%4 = alloca i32*
store i16 1, i16* %2
store i32* %1, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = sext i32 %7 to i64
%9 = sub i64 0, %8
%10 = getelementptr inbounds i32, i32* %5, i64 %9
store i32* %10, i32** %3
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = load i32*, i32** %4
%14 = sext i32 %12 to i64
%15 = sub i64 0, %14
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32* %16, i32** %4
%17 = load i32*, i32** %3
%18 = load i32*, i32** %4
%19 = icmp eq i32* %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @f0() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ getHeight();
int /*<<< orphan*/ getWidth();
int /*<<< orphan*/ printPattern(int /*<<< orphan*/, int /*<<< orphan*/);
int main() {
  printPattern(getHeight(), getWidth());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getHeight@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getWidth@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1030 <printPattern@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getHeight@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <getWidth@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <printPattern@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getHeight()
%3 = call i32 (...) @getWidth()
%4 = call i32 @printPattern(i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getHeight()
%2 = tail call i32 (...) @getWidth()
%3 = tail call i32 @printPattern(i32 %1, i32 %2)
ret i32 0
}
int ch_cmd_nop(int crpt, int cidx, int eidx, const char **s_r) { return (1); }


x86 assembly (clang, -O0):
<ch_cmd_nop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ch_cmd_nop(i32 %0, i32 %1, i32 %2, i8** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ch_cmd_nop(i32 %0, i32 %1, i32 %2, i8** nocapture readnone %3) {
ret i32 1
}
/* Variables and functions */
void __builtin_wasm_prefetch_nt(void *);
void prefetch_nt(void *p) { return __builtin_wasm_prefetch_nt(p); }


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

x86 assembly (clang, -O2):
<prefetch_nt>:
jmp    1030 <__builtin_wasm_prefetch_nt@plt>

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

LLVM IR (-O2):
define void @prefetch_nt(i8* %0) {
tail call void @__builtin_wasm_prefetch_nt(i8* %0)
ret void
}
int vde_chain_nm7_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 4;
  if (sz_res)
    *sz_res = 3;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 80;
  return 0;
}


x86 assembly (clang, -O0):
<vde_chain_nm7_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <vde_chain_nm7_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x4,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <vde_chain_nm7_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <vde_chain_nm7_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <vde_chain_nm7_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x50,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vde_chain_nm7_work>:
test   %rdi,%rdi
je     110b <vde_chain_nm7_work+0xb>
movl   $0x4,(%rdi)
test   %rsi,%rsi
je     1116 <vde_chain_nm7_work+0x16>
movl   $0x3,(%rsi)
test   %rdx,%rdx
je     1121 <vde_chain_nm7_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <vde_chain_nm7_work+0x2c>
movl   $0x50,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @vde_chain_nm7_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 4, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 3, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 80, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
int fh_create_bound() { return 1; }


x86 assembly (clang, -O0):
<fh_create_bound>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fh_create_bound() {
ret i32 1
}

LLVM IR (-O2):
define i32 @fh_create_bound() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsprintf(char *, char const *, int /*<<< orphan*/);
int vsnprintf(char *buf, size_t len, const char *fmt, va_list ap) {
  return vsprintf(buf, fmt, ap);
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <vsprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <vsprintf@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i32, i32* %8
%12 = call i32 @vsprintf(i8* %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsprintf(i8* %0, i8* %2, i32 %3)
ret i32 %5
}
void POMP2_Off() {}


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

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

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

LLVM IR (-O2):
define void @POMP2_Off() {
ret void
}
/* Variables and functions */
scalar_t__ using_aes_asm();
const char *get_AES_type_string() {
  if (using_aes_asm())
    return "AES-NI";
  return "AES-oSSL";
}


x86 assembly (clang, -O0):
<get_AES_type_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <using_aes_asm@plt>
cmp    $0x0,%rax
je     1139 <get_AES_type_string+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <get_AES_type_string+0x34>
lea    0xec7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_AES_type_string>:
push   %rax
xor    %eax,%eax
call   1030 <using_aes_asm@plt>
test   %rax,%rax
lea    0xee5(%rip),%rcx
lea    0xed7(%rip),%rax
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"AES-NI\00"
@.str.1 = [9 x i8] c"AES-oSSL\00"
define i8* @get_AES_type_string() {
%1 = alloca i8*
%2 = call i64 (...) @using_aes_asm()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
5: ; preds = %0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %4
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"AES-NI\00"
@.str.1 = [9 x i8] c"AES-oSSL\00"
define i8* @get_AES_type_string() {
%1 = tail call i64 (...) @using_aes_asm()
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void OGUSleep(int ius) { usleep(ius); }


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

x86 assembly (clang, -O2):
<OGUSleep>:
jmp    1030 <usleep@plt>

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

LLVM IR (-O2):
define void @OGUSleep(i32 %0) {
%2 = tail call i32 @usleep(i32 %0)
ret void
}
/* Variables and functions */
int gtxt_richtext_get_delimiter(char const *);
const char *_skip_delimiter_and_equal(const char *str) {
  const char *ptr = str;
  int len;
  do {
    if (*ptr == '=') {
      len = 1;
    } else {
      len = gtxt_richtext_get_delimiter(ptr);
    }
    ptr += len;
  } while (len != 0);
  return ptr;
}


x86 assembly (clang, -O0):
<_skip_delimiter_and_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1140 <_skip_delimiter_and_equal+0x30>
movl   $0x1,-0x14(%rbp)
jmp    114c <_skip_delimiter_and_equal+0x3c>
mov    -0x10(%rbp),%rdi
call   1030 <gtxt_richtext_get_delimiter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1124 <_skip_delimiter_and_equal+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_skip_delimiter_and_equal>:
push   %rbx
mov    %rdi,%rbx
jmp    1129 <_skip_delimiter_and_equal+0x19>
cs nopw 0x0(%rax,%rax,1)
cltq
add    %rax,%rbx
test   %eax,%eax
je     113d <_skip_delimiter_and_equal+0x2d>
mov    $0x1,%eax
cmpb   $0x3d,(%rbx)
je     1120 <_skip_delimiter_and_equal+0x10>
mov    %rbx,%rdi
call   1030 <gtxt_richtext_get_delimiter@plt>
jmp    1120 <_skip_delimiter_and_equal+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_skip_delimiter_and_equal(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %11, %8 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 61
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @gtxt_richtext_get_delimiter(i8* %3)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 1, %2 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %3, i64 %10
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %2
13: ; preds = %8
ret i8* %11
}
/* Variables and functions */
int stcli_h(char *, int);
int stci_h(char *string, int i) { return stcli_h(string, i & 0xFFFFL); }


x86 assembly (clang, -O0):
<stci_h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
and    $0xffff,%rax
mov    %eax,%esi
call   1030 <stcli_h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stci_h>:
movzwl %si,%esi
jmp    1030 <stcli_h@plt>

LLVM IR (-O0):
define i32 @stci_h(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = and i64 %7, 65535
%9 = trunc i64 %8 to i32
%10 = call i32 @stcli_h(i8* %5, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @stci_h(i8* %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = tail call i32 @stcli_h(i8* %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x2b() {
  Assert_real((ispunct(43)),
              "/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_ispunct.c",
              220, ("ispunct should be 1 for +"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x2b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2b,%edi
call   1030 <ispunct@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xdc,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x2b>:
push   %rax
mov    $0x2b,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xdc,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for +\00"
define void @t_ispunct_0x2b() {
%1 = call i32 @ispunct(i32 43)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 1 for +\00"
define void @t_ispunct_0x2b() {
%1 = tail call i32 @ispunct(i32 43)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void show_stackframe() {}


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

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

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

LLVM IR (-O2):
define void @show_stackframe() {
ret void
}