xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *myFun(void *x) {
  int tid;
  tid = *((int *)x);
  printf("Hi from thread %d!\n", tid);
  return NULL;
}


x86 assembly (clang, -O0):
<myFun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myFun>:
push   %rax
mov    (%rdi),%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Hi from thread %d!\0A\00"
define i8* @myFun(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [20 x i8] c"Hi from thread %d!\0A\00"
define noalias i8* @myFun(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
void f0() {
  register int *x0;
  int *_dummy0 = &(*x0);
  register int *x1;
  int *_dummy1 = &(*(x1 + 1));
}


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f0() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = load i32*, i32** %1
store i32* %5, i32** %2
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
store i32* %7, i32** %4
ret void
}

LLVM IR (-O2):
define void @f0() {
ret void
}
makeext(fname, ext) char *fname, *ext;
{
  while (*fname && (*fname != '.')) {
    *fname = toupper(*fname);
    ++fname;
  }
  *fname++ = '.';
  strcpy(fname, ext);
}


x86 assembly (clang, -O0):
<makeext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1155 <makeext+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1165 <makeext+0x45>
jmp    118a <makeext+0x6a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <makeext+0x10>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2e,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeext>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
movsbl -0x1(%rbx),%edi
test   %edi,%edi
je     114c <makeext+0x2c>
cmp    $0x2e,%dil
je     114c <makeext+0x2c>
call   1040 <toupper@plt>
mov    %al,-0x1(%rbx)
jmp    1130 <makeext+0x10>
movb   $0x2e,-0x1(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i32 @makeext(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 46
br label %16
16: ; preds = %11, %6
%17 = phi i1 [ false, %6 ], [ %15, %11 ]
br i1 %17, label %18, label %27
18: ; preds = %16
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = call i32 @toupper(i32 %21)
%23 = trunc i32 %22 to i8
%24 = load i8*, i8** %4
store i8 %23, i8* %24
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %4
br label %6
27: ; preds = %16
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %4
store i8 46, i8* %28
%30 = load i8*, i8** %4
%31 = load i8*, i8** %5
%32 = call i8* @strcpy(i8* %30, i8* %31)
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @makeext(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %6, %2
%4 = phi i8* [ %0, %2 ], [ %10, %6 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 46, label %11
]
6: ; preds = %3
%7 = sext i8 %5 to i32
%8 = tail call i32 @toupper(i32 %7)
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
11: ; preds = %3, %3
%12 = getelementptr inbounds i8, i8* %4, i64 1
store i8 46, i8* %4
%13 = tail call i8* @strcpy(i8* %12, i8* dereferenceable(1) %1)
ret i32 undef
}
/* Variables and functions */
int is_prime(char *, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char number[256];
  scanf("%s", number);
  int len = strlen(number);
  printf("%d\n", is_prime(number, len));
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
call   1050 <is_prime@plt>
mov    %eax,%esi
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
lea    0xeb1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <is_prime@plt>
lea    0xe90(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @is_prime(i8* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int sigismember(int /*<<< orphan*/ const *, int);
void printsigset(const sigset_t *set) {
  int i;
  for (i = 1; i < 32; i++)
    if (sigismember(set, i) == 1)
      putchar('1');
    else
      putchar('0');
  puts("");
}


x86 assembly (clang, -O0):
<printsigset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    118e <printsigset+0x5e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <sigismember@plt>
cmp    $0x1,%eax
jne    1171 <printsigset+0x41>
mov    $0x31,%edi
call   1030 <putchar@plt>
jmp    117b <printsigset+0x4b>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    1180 <printsigset+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <printsigset+0x13>
lea    0xe6b(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printsigset>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <sigismember@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    1130 <printsigset+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @printsigset(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 1, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 32
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = call i32 @sigismember(i32* %8, i32 %9)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 @putchar(i8 signext 49)
br label %16
14: ; preds = %7
%15 = call i32 @putchar(i8 signext 48)
br label %16
16: ; preds = %14, %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
%21 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printsigset(i32* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = tail call i32 @sigismember(i32* %0, i32 %3)
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i8 49, i8 48
%7 = tail call i32 @putchar(i8 signext %6)
%8 = add nuw nsw i32 %3, 1
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ safefree(void *);
void des3_free_context(void *handle) { safefree(handle); }


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

x86 assembly (clang, -O2):
<des3_free_context>:
jmp    1030 <safefree@plt>

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

LLVM IR (-O2):
define void @des3_free_context(i8* %0) {
%2 = tail call i32 @safefree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fn18(int);
void fn19(void) {
  fn18(1);
  fn18(2);
  fn18(4);
  fn18(16);
  fn18(32);
  fn18(64);
}


x86 assembly (clang, -O0):
<fn19>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <fn18@plt>
mov    $0x2,%edi
call   1030 <fn18@plt>
mov    $0x4,%edi
call   1030 <fn18@plt>
mov    $0x10,%edi
call   1030 <fn18@plt>
mov    $0x20,%edi
call   1030 <fn18@plt>
mov    $0x40,%edi
call   1030 <fn18@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn19>:
push   %rax
mov    $0x1,%edi
call   1030 <fn18@plt>
mov    $0x2,%edi
call   1030 <fn18@plt>
mov    $0x4,%edi
call   1030 <fn18@plt>
mov    $0x10,%edi
call   1030 <fn18@plt>
mov    $0x20,%edi
call   1030 <fn18@plt>
mov    $0x40,%edi
pop    %rax
jmp    1030 <fn18@plt>

LLVM IR (-O0):
define void @fn19() {
%1 = call i32 @fn18(i32 1)
%2 = call i32 @fn18(i32 2)
%3 = call i32 @fn18(i32 4)
%4 = call i32 @fn18(i32 16)
%5 = call i32 @fn18(i32 32)
%6 = call i32 @fn18(i32 64)
ret void
}

LLVM IR (-O2):
define void @fn19() {
%1 = tail call i32 @fn18(i32 1)
%2 = tail call i32 @fn18(i32 2)
%3 = tail call i32 @fn18(i32 4)
%4 = tail call i32 @fn18(i32 16)
%5 = tail call i32 @fn18(i32 32)
%6 = tail call i32 @fn18(i32 64)
ret void
}
/* Type definitions */
typedef scalar_t__ int_fast16_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int_fast16_t(int_fast16_t const k1,
                                           int_fast16_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int_fast16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int_fast16_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_fast16_t(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int_fast16_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void cmc_close(int socketha) { close(socketha); }


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

x86 assembly (clang, -O2):
<cmc_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @cmc_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int initgroups(const char *name, gid_t basegid) { return 0; }


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

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

LLVM IR (-O0):
define i32 @initgroups(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @initgroups(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int i;
  int arr[] = {
      [0] = 5,
      [3] = 9,
  };
  for (i = 0; i < sizeof(arr) / sizeof(arr[0]); i++)
    printf("arr[%d] = %d\n", i, arr[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x4,%rax
jae    116f <main+0x5f>
mov    -0x8(%rbp),%esi
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113c <main+0x2c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x9,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [4 x i32] [i32 5, i32 0, i32 0, i32 9]
@.str = [14 x i8] c"arr[%d] = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %3 to i8*
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 4
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %14)
br label %16
16: ; preds = %9
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"arr[%d] = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 0, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 1, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 2, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 3, i32 9)
ret i32 0
}
int sumofsquares(int limit) {
  int sum = 1;
  int i;
  for (i = 2; i <= limit; i++) {
    sum += (i * i);
  }
  return sum;
}


x86 assembly (clang, -O0):
<sumofsquares>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     113c <sumofsquares+0x3c>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <sumofsquares+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumofsquares>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     113a <sumofsquares+0x3a>
lea    -0x2(%rdi),%eax
lea    -0x3(%rdi),%ecx
imul   %rax,%rcx
lea    -0x4(%rdi),%eax
imul   %rcx,%rax
shr    %rax
imul   $0x55555556,%eax,%eax
lea    (%rdi,%rdi,8),%edx
add    %eax,%edx
shr    %rcx
lea    0x0(,%rcx,8),%eax
sub    %ecx,%eax
add    %edx,%eax
add    $0xfffffff3,%eax
ret

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

LLVM IR (-O2):
define i32 @sumofsquares(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %22, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -2
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -3
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = add nsw i32 %0, -4
%10 = zext i32 %9 to i33
%11 = mul i33 %8, %10
%12 = lshr i33 %11, 1
%13 = trunc i33 %12 to i32
%14 = mul i32 %13, 1431655766
%15 = mul i32 %0, 9
%16 = add i32 %14, %15
%17 = lshr i33 %8, 1
%18 = trunc i33 %17 to i32
%19 = mul i32 %18, 7
%20 = add i32 %16, %19
%21 = add i32 %20, -13
br label %22
22: ; preds = %3, %1
%23 = phi i32 [ 1, %1 ], [ %21, %3 ]
ret i32 %23
}
void INT_Excep_BRK(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_BRK() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xf7() {
  Assert_real((iscntrl(247) == 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_iscntrl.c",
              1240, ("iscntrl should be 0 for 0xf7"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xf7\00"
define void @t_iscntrl_0xf7() {
%1 = call i64 @iscntrl(i32 247)
%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 1240, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xf7\00"
define void @t_iscntrl_0xf7() {
%1 = tail call i64 @iscntrl(i32 247)
%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 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ proutn(char *);
int /*<<< orphan*/ sprintf(char *, char *, int, int, double);
void cramf(double x, int w, int d) {
  char buf[64];
  sprintf(buf, "%*.*f", w, d, x);
  proutn(buf);
}


x86 assembly (clang, -O0):
<cramf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
movsd  -0x8(%rbp),%xmm0
lea    0xeb7(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <proutn@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cramf>:
push   %rbx
sub    $0x40,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <proutn@plt>
add    $0x40,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%*.*f\00"
define void @cramf(double %0, i32 %1, i32 %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, double %0)
%7 = call i32 @proutn(i8* %5)
ret void
}
int get_frame_type(char *frame_id) {
  switch (frame_id[0]) {
  case 'T':
    return 1;
  case 'C':
    return 2;
  case 'A':
    return 3;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_frame_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
sub    $0x41,%eax
je     115a <get_frame_type+0x5a>
jmp    1120 <get_frame_type+0x20>
mov    -0x14(%rbp),%eax
sub    $0x43,%eax
je     114e <get_frame_type+0x4e>
jmp    1131 <get_frame_type+0x31>
mov    -0x14(%rbp),%eax
sub    $0x54,%eax
jne    1166 <get_frame_type+0x66>
jmp    1142 <get_frame_type+0x42>
movl   $0x1,-0x4(%rbp)
jmp    116d <get_frame_type+0x6d>
movl   $0x2,-0x4(%rbp)
jmp    116d <get_frame_type+0x6d>
movl   $0x3,-0x4(%rbp)
jmp    116d <get_frame_type+0x6d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_frame_type>:
movsbl (%rdi),%eax
cmp    $0x41,%eax
je     1118 <get_frame_type+0x18>
cmp    $0x54,%eax
je     111e <get_frame_type+0x1e>
cmp    $0x43,%eax
jne    1124 <get_frame_type+0x24>
mov    $0x2,%eax
ret
mov    $0x3,%eax
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_frame_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %11 [
i32 84, label %8
i32 67, label %9
i32 65, label %10
]
8: ; preds = %1
store i32 1, i32* %2
br label %12
9: ; preds = %1
store i32 2, i32* %2
br label %12
10: ; preds = %1
store i32 3, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_frame_type(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %6 [
i32 84, label %7
i32 67, label %4
i32 65, label %5
]
4: ; preds = %1
br label %7
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %1, %6, %5, %4
%8 = phi i32 [ 0, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %1 ]
ret i32 %8
}
/* Type definitions */
struct playercontrolarg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ writelist_db(char *, struct playercontrolarg *);
int /*<<< orphan*/ writelist_file(char *, struct playercontrolarg *);
void writelist(char *com, struct playercontrolarg *pca) {
  if (com[1] == 'f')
    writelist_file(com, pca);
  else
    writelist_db(com, pca);
}


x86 assembly (clang, -O0):
<writelist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x66,%eax
jne    1153 <writelist+0x33>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <writelist_file@plt>
jmp    1160 <writelist+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <writelist_db@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelist>:
cmpb   $0x66,0x1(%rdi)
jne    112b <writelist+0xb>
jmp    1040 <writelist_file@plt>
jmp    1030 <writelist_db@plt>

LLVM IR (-O0):
%struct.playercontrolarg = type { i32 }
define void @writelist(i8* %0, %struct.playercontrolarg* %1) {
%3 = alloca i8*
%4 = alloca %struct.playercontrolarg*
store i8* %0, i8** %3
store %struct.playercontrolarg* %1, %struct.playercontrolarg** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 102
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load %struct.playercontrolarg*, %struct.playercontrolarg** %4
%13 = call i32 @writelist_file(i8* %11, %struct.playercontrolarg* %12)
br label %18
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load %struct.playercontrolarg*, %struct.playercontrolarg** %4
%17 = call i32 @writelist_db(i8* %15, %struct.playercontrolarg* %16)
br label %18
18: ; preds = %14, %10
ret void
}

LLVM IR (-O2):
%struct.playercontrolarg = type { i32 }
define void @writelist(i8* %0, %struct.playercontrolarg* %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 102
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @writelist_file(i8* %0, %struct.playercontrolarg* %1)
br label %10
8: ; preds = %2
%9 = tail call i32 @writelist_db(i8* %0, %struct.playercontrolarg* %1)
br label %10
10: ; preds = %8, %6
ret void
}
/* Variables and functions */
int __copy(char *, char const *, int);
int strlen(char *);
int safecat(char *dst, const char *src, int dstsize) {
  if (dstsize <= 0)
    return 0;
  int len = strlen(dst);
  dst += len;
  dstsize -= len;
  return __copy(dst, src, dstsize);
}


x86 assembly (clang, -O0):
<safecat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jg     1149 <safecat+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1184 <safecat+0x64>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x1c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <__copy@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safecat>:
test   %edx,%edx
jle    114f <safecat+0x2f>
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
cltq
add    %rax,%r15
sub    %eax,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <__copy@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @safecat(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%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
%9 = load i32, i32* %7
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %4
br label %26
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = call i32 @strlen(i8* %13)
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = load i8*, i8** %5
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8* %18, i8** %5
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, %19
store i32 %21, i32* %7
%22 = load i8*, i8** %5
%23 = load i8*, i8** %6
%24 = load i32, i32* %7
%25 = call i32 @__copy(i8* %22, i8* %23, i32 %24)
store i32 %25, i32* %4
br label %26
26: ; preds = %12, %11
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @safecat(i8* %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %2, 1
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = tail call i32 @strlen(i8* %0)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = sub nsw i32 %2, %6
%10 = tail call i32 @__copy(i8* %8, i8* %1, i32 %9)
br label %11
11: ; preds = %3, %5
%12 = phi i32 [ %10, %5 ], [ 0, %3 ]
ret i32 %12
}
const char *str_stmt_expr() { return "expression"; }


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

x86 assembly (clang, -O2):
<str_stmt_expr>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"expression\00"
define i8* @str_stmt_expr() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"expression\00"
define i8* @str_stmt_expr() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
void *realloc(void *, int);
void *ShrinkBuffer(void *Buf, int Len) {
  if (!(Len % 256)) {
    Buf = realloc(Buf, Len + 256);
  }
  return Buf;
}


x86 assembly (clang, -O0):
<ShrinkBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1149 <ShrinkBuffer+0x39>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x100,%esi
call   1030 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShrinkBuffer>:
test   %sil,%sil
je     1119 <ShrinkBuffer+0x9>
mov    %rdi,%rax
ret
add    $0x100,%esi
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define i8* @ShrinkBuffer(i8* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = add nsw i32 %1, 256
%7 = tail call i8* @realloc(i8* %0, i32 %6)
br label %8
8: ; preds = %5, %2
%9 = phi i8* [ %0, %2 ], [ %7, %5 ]
ret i8* %9
}
void biosal_input_format_interface_init(
    struct biosal_input_format_interface *operations) {}


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

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

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

LLVM IR (-O2):
%struct.biosal_input_format_interface = type opaque
define void @biosal_input_format_interface_init(%struct.biosal_input_format_interface* nocapture %0) {
ret void
}
void ASMAtomicCmpXchgU64(void) {}


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

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

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

LLVM IR (-O2):
define void @ASMAtomicCmpXchgU64() {
ret void
}
regx0adrreg1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[x0]) = (p1[1111111 / 4]); }


x86 assembly (clang, -O0):
<regx0adrreg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x87a22(%rax),%dx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adrreg1_set>:
movzwl 0x87a22(%r9),%eax
movslq %edx,%rcx
mov    %ax,(%r8,%rcx,2)
ret

LLVM IR (-O0):
define i32 @regx0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = getelementptr inbounds i16, i16* %16, i64 277777
%18 = load i16, i16* %17
%19 = load i16*, i16** %12
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i16, i16* %19, i64 %21
store i16 %18, i16* %22
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @regx0adrreg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %5, i64 277777
%8 = load i16, i16* %7
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i16, i16* %4, i64 %9
store i16 %8, i16* %10
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ foo();
int main(int argc, char **argv) {
  int i = 0;
  for (i = 0; i < 100; i++) {
    if (i % 2 == 0) {
      foo();
    } else {
      bar();
    }
  }
}


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   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1188 <main+0x68>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <main+0x4e>
mov    $0x0,%al
call   1040 <foo@plt>
jmp    1175 <main+0x55>
mov    $0x0,%al
call   1030 <bar@plt>
jmp    117a <main+0x5a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
jmp    113d <main+0x1d>
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <bar@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
je     114b <main+0x2b>
xor    %eax,%eax
test   $0x1,%bl
jne    1130 <main+0x10>
call   1040 <foo@plt>
jmp    1135 <main+0x15>
xor    %eax,%eax
pop    %rbx
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 0, i32* %6
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %6
%12 = srem i32 %11, 2
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @foo()
br label %18
16: ; preds = %10
%17 = call i32 (...) @bar()
br label %18
18: ; preds = %16, %14
br label %19
19: ; preds = %18
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %11
%4 = phi i32 [ 0, %2 ], [ %12, %11 ]
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 (...) @foo()
br label %11
9: ; preds = %3
%10 = tail call i32 (...) @bar()
br label %11
11: ; preds = %7, %9
%12 = add nuw nsw i32 %4, 1
%13 = icmp eq i32 %12, 100
br i1 %13, label %14, label %3
14: ; preds = %11
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void wfree(void *ptr) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<wfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <wfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfree>:
test   %rdi,%rdi
je     111a <wfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @wfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @wfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge_parts(int *, int);
void merge_sort(int arr[], int length) {
  if (length > 1) {
    int mid = length / 2;
    merge_sort(arr, mid);
    merge_sort(arr + mid, length - mid);
    merge_parts(arr, length);
  }
}


x86 assembly (clang, -O0):
<merge_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1179 <merge_sort+0x59>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
call   1030 <merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <merge_parts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merge_sort>:
cmp    $0x1,%esi
jle    1154 <merge_sort+0x34>
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
mov    %ebx,%esi
call   1030 <merge_sort@plt>
lea    (%r14,%rbx,4),%rdi
mov    %ebp,%esi
sub    %ebx,%esi
call   1030 <merge_sort@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <merge_parts@plt>
ret

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

LLVM IR (-O2):
define void @merge_sort(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %5, label %4
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %1, 1
tail call void @merge_sort(i32* %0, i32 %6)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = sub nsw i32 %1, %6
tail call void @merge_sort(i32* %8, i32 %9)
%10 = tail call i32 @merge_parts(i32* %0, i32 %1)
br label %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ntohs(int /*<<< orphan*/);
uint16_t hostb_s(uint16_t value) { return ntohs(value); }


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

x86 assembly (clang, -O2):
<hostb_s>:
jmp    1030 <ntohs@plt>

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

LLVM IR (-O2):
define i32 @hostb_s(i32 %0) {
%2 = tail call i32 @ntohs(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int);
int min(int, int /*<<< orphan*/);
int clamp(int v, int low, int high) { return min(high, max(low, v)); }


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <max@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
push   %rbx
mov    %edx,%ebx
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
call   1040 <max@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <min@plt>

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

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @max(i32 %1, i32 %0)
%5 = tail call i32 @min(i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int dwarf_get_MACINFO_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_MACINFO_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_MACINFO_name(val_in, &v);
  return ellipname(res, val_in, v, "MACINFO", printonerr);
}


x86 assembly (clang, -O0):
<get_MACINFO_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <dwarf_get_MACINFO_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1030 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_MACINFO_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1040 <dwarf_get_MACINFO_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1030 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"MACINFO\00"
define i8* @get_MACINFO_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_MACINFO_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [8 x i8] c"MACINFO\00"
define i8* @get_MACINFO_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_MACINFO_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ fibleft(int);
void *fib(void *ignored) { fibleft(7); }


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

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

LLVM IR (-O0):
define i8* @fib(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @fibleft(i32 7)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @fib(i8* nocapture readnone %0) {
%2 = tail call i32 @fibleft(i32 7)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, long *);
int /*<<< orphan*/ solve(long);
int main() {
  long p;
  scanf("%ld", &p);
  printf("%ld\n", solve(p));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rdi
call   1030 <solve@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %2)
%4 = load i64, i64* %2
%5 = call i32 @solve(i64 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = call i32 @solve(i64 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __dump_regs() { abort(); }


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

x86 assembly (clang, -O2):
<__dump_regs>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @__dump_regs() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @__dump_regs() {
%1 = tail call i32 (...) @abort()
unreachable
}
int main(int argc, const char *argv[]) {
  long i = 1;
  while (i) {
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1136 <main+0x36>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <main+0x1a>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 1, i64* %6
br label %7
7: ; preds = %10, %2
%8 = load i64, i64* %6
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i64, i64* %6
%12 = add nsw i64 %11, 1
store i64 %12, i64* %6
br label %7
13: ; preds = %7
ret i32 0
}

LLVM IR (-O2):