xunge/DecIR huggingface dataset:
char *ft_strcpy(char *dst, const char *src) {
  char *save;
  save = dst;
  while (*src != '\0')
    *(dst++) = *(src++);
  *dst = '\0';
  return (save);
}


x86 assembly (clang, -O0):
<ft_strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <ft_strcpy+0x4b>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1114 <ft_strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <ft_strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <ft_strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @ft_strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    c -= 'a' + 'A';
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1126 <ft_toupper+0x26>
cmpl   $0x7a,-0x4(%rbp)
jg     1126 <ft_toupper+0x26>
mov    -0x4(%rbp),%eax
sub    $0xa2,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0xa2(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_toupper(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 162
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -162
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int main(void) {
  void *ptr;
label:
  ptr = &&label;
  goto *ptr;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
lea    -0x7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
br label %3
3: ; preds = %5, %0
store i8* blockaddress(@main, %3), i8** %2
%4 = load i8*, i8** %2
br label %5
5: ; preds = %3
%6 = phi i8* [ %4, %3 ]
indirectbr i8* %6, [label %3]
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int ASN1_item_i2d_bio(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_it;
int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) {
  return ASN1_item_i2d_bio(&X509_CRL_it, bp, crl);
}


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

x86 assembly (clang, -O2):
<i2d_X509_CRL_bio>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rdi
jmp    1030 <ASN1_item_i2d_bio@plt>

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

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define i32 @i2d_X509_CRL_bio(i32* %0, i32* %1) {
%3 = tail call i32 @ASN1_item_i2d_bio(i32* @X509_CRL_it, i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ value_compare();
int list_compare(int *list1) {
  if (list1)
    value_compare();
}


x86 assembly (clang, -O0):
<list_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112e <list_compare+0x1e>
mov    $0x0,%al
call   1030 <value_compare@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_compare>:
test   %rdi,%rdi
je     1121 <list_compare+0x11>
push   %rax
xor    %eax,%eax
call   1030 <value_compare@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @list_compare(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @value_compare()
br label %5
5: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ __setjmp(char *);
int /*<<< orphan*/ bar();
void foo(char *p) {
  int d = 0;
  bar();
  if (__setjmp(p))
    return;
  long a = d;
  d = 8;
  if (!a)
    bar();
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x8(%rbp),%rdi
call   1040 <__setjmp@plt>
cmp    $0x0,%rax
je     1152 <foo+0x32>
jmp    1173 <foo+0x53>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0xc(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <foo+0x53>
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rdi
call   1040 <__setjmp@plt>
test   %rax,%rax
je     113a <foo+0x1a>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
jmp    1030 <bar@plt>

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = call i32 (...) @bar()
%6 = load i8*, i8** %2
%7 = call i64 @__setjmp(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
store i64 %12, i64* %4
store i32 8, i32* %3
%13 = load i64, i64* %4
%14 = icmp ne i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %10
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %9, %15, %10
ret void
}

LLVM IR (-O2):
define void @foo(i8* %0) {
%2 = tail call i32 (...) @bar()
%3 = tail call i64 @__setjmp(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @bar()
br label %7
7: ; preds = %1, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int f;
  int c;
  int i;
  f = 1;
  i = 11;
  for (c = 1; c < i; c++)
    f = f * c;
  printf("10!=%d \n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xb,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <main+0x24>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"10!=%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
/* Type definitions */
struct vmbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ vmbuf_wloc2(struct vmbuf *);
char *vmbuf_wloc(struct vmbuf *vmbuf) { return (char *)vmbuf_wloc2(vmbuf); }


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

x86 assembly (clang, -O2):
<vmbuf_wloc>:
jmp    1030 <vmbuf_wloc2@plt>

LLVM IR (-O0):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_wloc(%struct.vmbuf* %0) {
%2 = alloca %struct.vmbuf*
store %struct.vmbuf* %0, %struct.vmbuf** %2
%3 = load %struct.vmbuf*, %struct.vmbuf** %2
%4 = call i64 @vmbuf_wloc2(%struct.vmbuf* %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
%struct.vmbuf = type { i32 }
define i8* @vmbuf_wloc(%struct.vmbuf* %0) {
%2 = tail call i64 @vmbuf_wloc2(%struct.vmbuf* %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
char *isolate(char *s, char c) {
  while (*s && *s != c)
    ++s;
  if (*s != '\0')
    *s++ = '\0';
  return s;
}


x86 assembly (clang, -O0):
<isolate>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1136 <isolate+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1146 <isolate+0x46>
jmp    1157 <isolate+0x57>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <isolate+0xe>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1179 <isolate+0x79>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isolate>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1120 <isolate+0x20>
cmp    %sil,%cl
jne    1110 <isolate+0x10>
lea    -0x1(%rax),%rdx
test   %cl,%cl
je     112c <isolate+0x2c>
movb   $0x0,(%rdx)
ret
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @isolate(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
br i1 %6, label %12, label %11
11: ; preds = %10
store i8 0, i8* %4
br label %12
12: ; preds = %11, %10
%13 = phi i8* [ %9, %11 ], [ %4, %10 ]
ret i8* %13
}
int op(int a, int b) { return a / b; }


x86 assembly (clang, -O0):
<op>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<op>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @op(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
int get_cs(void) {
  int r;
  asm volatile("mov %%cs, %0" : "=r"(r));
  return r;
}


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

x86 assembly (clang, -O2):
<get_cs>:
mov    %cs,%eax
ret

LLVM IR (-O0):
define i32 @get_cs() {
%1 = alloca i32
%2 = call i32 asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_cs() {
%1 = tail call i32 asm sideeffect "mov %cs, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t max32(int32_t a, int32_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<max32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <max32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max32(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 slt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void ft_strclr(char *s) {
  if (s)
    while (*s)
      *(s++) = 0;
}


x86 assembly (clang, -O0):
<ft_strclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <ft_strclr+0x41>
jmp    1118 <ft_strclr+0x18>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113c <ft_strclr+0x3c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
jmp    1118 <ft_strclr+0x18>
jmp    1141 <ft_strclr+0x41>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strclr>:
test   %rdi,%rdi
je     111d <ft_strclr+0x1d>
cmpb   $0x0,(%rdi)
je     111d <ft_strclr+0x1d>
add    $0x1,%rdi
xchg   %ax,%ax
movb   $0x0,-0x1(%rdi)
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strclr+0x10>
ret

LLVM IR (-O0):
define void @ft_strclr(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 %14
5: ; preds = %1
br label %6
6: ; preds = %10, %5
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
store i8 0, i8* %11
br label %6
13: ; preds = %6
br label %14
14: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
define void @ft_strclr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %8, %6 ], [ %0, %3 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 0, i8* %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x37() {
  Assert_real((islower(55) == 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_islower.c",
              280, ("islower should be 0 for 7"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x37>:
push   %rax
mov    $0x37,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x118,%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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 7\00"
define void @t_islower_0x37() {
%1 = call i64 @islower(i32 55)
%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 280, 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_islower.c\00"
@.str.1 = [26 x i8] c"islower should be 0 for 7\00"
define void @t_islower_0x37() {
%1 = tail call i64 @islower(i32 55)
%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 280, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
float fabs(float);
float Float_abs(float x) { return fabs(x); }


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

x86 assembly (clang, -O2):
<Float_abs>:
andps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define float @Float_abs(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
void hw2(double r1, double r2) {
  double s;
  s = sin(r1 + r2);
  printf('Hello, World! sin(%g+%g)=%g\n', r1, r2, s);
}


x86 assembly (clang, -O0):
<hw2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
mov    $0x3d25670a,%edi
mov    $0x3,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw2>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
addsd  %xmm1,%xmm0
call   1040 <sin@plt>
movapd %xmm0,%xmm2
mov    $0x3d25670a,%edi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    $0x3,%al
add    $0x18,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @hw2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fadd double %6, %7
%9 = call double @sin(double %8)
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %4
%12 = load double, double* %5
%13 = call i32 (i8*, ...) @printf(i8* inttoptr (i64 1025861386 to i8*), double %10, double %11, double %12)
ret void
}

LLVM IR (-O2):
define void @hw2(double %0, double %1) {
%3 = fadd double %0, %1
%4 = tail call double @sin(double %3)
%5 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1025861386 to i8*), double %0, double %1, double %4)
ret void
}
void __attribute__((warning(
    "curl_easy_setopt expects a curl_seek_callback argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_seek_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_seek_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void make(int ***p1, int **p2) { *p1 = p2; }


x86 assembly (clang, -O0):
<make>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @make(i32*** nocapture writeonly %0, i32** %1) {
store i32** %1, i32*** %0
ret void
}
void eglCreateContext(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglCreateContext() {
ret void
}
/* Variables and functions */
unsigned long __raw_local_save_flags();
int /*<<< orphan*/ raw_local_irq_disable();
__attribute__((always_)) unsigned long __raw_local_irq_save(void) {
  unsigned long f;
  f = __raw_local_save_flags();
  raw_local_irq_disable();
  return f;
}


x86 assembly (clang, -O0):
<__raw_local_irq_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__raw_local_save_flags@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <raw_local_irq_disable@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__raw_local_irq_save>:
push   %rbx
xor    %eax,%eax
call   1030 <__raw_local_save_flags@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <raw_local_irq_disable@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @__raw_local_irq_save() {
%1 = alloca i64
%2 = call i64 (...) @__raw_local_save_flags()
store i64 %2, i64* %1
%3 = call i32 (...) @raw_local_irq_disable()
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @__raw_local_irq_save() {
%1 = tail call i64 (...) @__raw_local_save_flags()
%2 = tail call i32 (...) @raw_local_irq_disable()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void putc(char c) { write(1, &c, 1); }


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edx
lea    -0x1(%rbp),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @write(i32 1, i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solveMaze(int **);
int main() {
  int maze[4][4] = {{1, 0, 0, 0}, {1, 1, 0, 1}, {0, 1, 0, 0}, {1, 1, 1, 1}};
  solveMaze(maze);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <solveMaze@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <solveMaze@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.maze = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 0, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 0, i32 1], [4 x i32] [i32 0, i32 1, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 1, i32 1]]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x [4 x i32]]
store i32 0, i32* %1
%3 = bitcast [4 x [4 x i32]]* %2 to i8*
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %2, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @solveMaze(i32** %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.maze = [4 x [4 x i32]] [[4 x i32] [i32 1, i32 0, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 0, i32 1], [4 x i32] [i32 0, i32 1, i32 0, i32 0], [4 x i32] [i32 1, i32 1, i32 1, i32 1]]
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = bitcast [4 x [4 x i32]]* %1 to i32**
%4 = call i32 @solveMaze(i32** %3)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int fstat(int fildes, struct stat *buf) {
  errno = EIO;
  return -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@EIO = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @EIO
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@EIO = global i32 0
@errno = global i32 0
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = load i32, i32* @EIO
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int bitbang_spi_shutdown(void *data) {
  free(data);
  return 0;
}


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

x86 assembly (clang, -O2):
<bitbang_spi_shutdown>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @bitbang_spi_shutdown(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int parse_byte_stream(char const *, int, int /*<<< orphan*/ *, int *);
int parse_byte_stream_exact_length(const char *sval, uint8_t *dst, int len) {
  int actual_len;
  int rc;
  rc = parse_byte_stream(sval, len, dst, &actual_len);
  if (rc != 0) {
    return rc;
  }
  if (actual_len != len) {
    return (-2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<parse_byte_stream_exact_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1030 <parse_byte_stream@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     114f <parse_byte_stream_exact_length+0x3f>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <parse_byte_stream_exact_length+0x5e>
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     1167 <parse_byte_stream_exact_length+0x57>
movl   $0xfffffffe,-0x4(%rbp)
jmp    116e <parse_byte_stream_exact_length+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_byte_stream_exact_length>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %rsi,%rdx
lea    0xc(%rsp),%rcx
mov    %ebx,%esi
call   1030 <parse_byte_stream@plt>
xor    %ecx,%ecx
cmp    %ebx,0xc(%rsp)
sete   %cl
test   %eax,%eax
lea    -0x2(%rcx,%rcx,1),%ecx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @parse_byte_stream_exact_length(i8* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @parse_byte_stream(i8* %0, i32 %2, i32* %1, i32* %4)
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, %2
%10 = select i1 %9, i32 0, i32 -2
%11 = select i1 %7, i32 %10, i32 %6
ret i32 %11
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateGPIORetentionDisable(void) {
  (*((volatile uint32_t *)(0x400FC010))) &= ~(0x40000000 | 0x00000100);
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateGPIORetentionDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%ecx
and    $0xbffffeff,%ecx
mov    $0x400fc010,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateGPIORetentionDisable>:
andl   $0xbffffeff,0x400fc010
ff fe ff bf
xor    %eax,%eax
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateGPIORetentionDisable() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = and i32 %1, -1073742081
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateGPIORetentionDisable() {
%1 = load volatile i32, i32* inttoptr (i64 1074774032 to i32*)
%2 = and i32 %1, -1073742081
store volatile i32 %2, i32* inttoptr (i64 1074774032 to i32*)
%3 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
unsigned short NMI320_i2c_speed(void) { return 150; }


x86 assembly (clang, -O0):
<NMI320_i2c_speed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x96,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NMI320_i2c_speed>:
mov    $0x96,%ax
ret

LLVM IR (-O0):
define zeroext i16 @NMI320_i2c_speed() {
ret i16 150
}

LLVM IR (-O2):
define zeroext i16 @NMI320_i2c_speed() {
ret i16 150
}
int (*(*f3(int i))[10])(int i, int k) {}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define [10 x i32 (i32, i32)*]* @f3(i32 %0) {
%2 = alloca [10 x i32 (i32, i32)*]*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load [10 x i32 (i32, i32)*]*, [10 x i32 (i32, i32)*]** %2
ret [10 x i32 (i32, i32)*]* %4
}

LLVM IR (-O2):
define noalias [10 x i32 (i32, i32)*]* @f3(i32 %0) {
ret [10 x i32 (i32, i32)*]* undef
}
int IsWordRange(long Val) { return (Val & ~0xFFFFL) == 0; }


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

x86 assembly (clang, -O2):
<IsWordRange>:
xor    %eax,%eax
cmp    $0x10000,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsWordRange(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -65536
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @IsWordRange(i64 %0) {
%2 = icmp ult i64 %0, 65536
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ rr_off();
uint8_t rr_on(void) { return (!rr_off()); }


x86 assembly (clang, -O0):
<rr_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rr_off@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rr_on>:
push   %rax
xor    %eax,%eax
call   1030 <rr_off@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rr_on() {
%1 = call i32 (...) @rr_off()
%2 = icmp ne i32 %1, 0
%3 = xor i1 %2, true
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @rr_on() {
%1 = tail call i32 (...) @rr_off()
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void sigpipe() { ; }


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

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

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

LLVM IR (-O2):
define void @sigpipe() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ caesarShift(char const, long const);
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void shiftAndPrint(const long caesarKey, const char *msg) {
  const char *ptr = msg;
  while (*ptr != '\0') {
    putchar(caesarShift(*ptr, caesarKey));
    ptr++;
  }
}


x86 assembly (clang, -O0):
<shiftAndPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <shiftAndPrint+0x52>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <caesarShift@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <shiftAndPrint+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftAndPrint>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     115d <shiftAndPrint+0x3d>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1040 <caesarShift@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <shiftAndPrint+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @shiftAndPrint(i64 %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = tail call i32 @caesarShift(i8 signext %6, i64 %0)
%9 = tail call i32 @putchar(i32 %8)
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
void dump_data(const char *desc, void *data, int len) {}


x86 assembly (clang, -O0):
<dump_data>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dump_data(i8* %0, i8* %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
ret void
}

LLVM IR (-O2):
define void @dump_data(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
int initialise_benchmark() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @initialise_benchmark() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
scalar_t__ bind_context(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int bind_cpu(uint64_t cpu, cpu_set_t *old_context) {
  int err = 0;
  cpu_set_t cpu_context;
  CPU_ZERO(&cpu_context);
  CPU_SET(cpu, &cpu_context);
  err += bind_context(&cpu_context, old_context);
  return err;
}


x86 assembly (clang, -O0):
<bind_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <CPU_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <CPU_SET@plt>
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1050 <bind_context@plt>
mov    %rax,%rcx
movslq -0x14(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_cpu>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <CPU_ZERO@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <CPU_SET@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <bind_context@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @bind_cpu(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
%7 = call i32 @CPU_ZERO(i32* %6)
%8 = load i32, i32* %3
%9 = call i32 @CPU_SET(i32 %8, i32* %6)
%10 = load i32*, i32** %4
%11 = call i64 @bind_context(i32* %6, i32* %10)
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @bind_cpu(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @CPU_ZERO(i32* %3)
%6 = call i32 @CPU_SET(i32 %0, i32* %3)
%7 = call i64 @bind_context(i32* %3, i32* %1)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int fun_call_base_1(int x) {
  printf("x = %d\n", x);
  return x + 5;
}


x86 assembly (clang, -O0):
<fun_call_base_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x5,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_base_1>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x5,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"x = %d\0A\00"
define i32 @fun_call_base_1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = add nsw i32 %0, 5
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printDashesfloat(unsigned n) {
  for (unsigned i = 0; i < n; ++i) {
    printf("-");
  }
}


x86 assembly (clang, -O0):
<printDashesfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1148 <printDashesfloat+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <printDashesfloat+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDashesfloat>:
push   %rbx
test   %edi,%edi
je     112f <printDashesfloat+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printDashesfloat+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printDashesfloat(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %4, %1
ret void
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putchar(i32 45)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %3, label %4
}
void utp_log(char const *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @utp_log(i8* nocapture %0, ...) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ flockfile(int /*<<< orphan*/ *);
int /*<<< orphan*/ funlockfile(int /*<<< orphan*/ *);
int putc_unlocked(int, int /*<<< orphan*/ *);
int putc(int c, FILE *fp) {
  int ret;
  flockfile(fp);
  ret = putc_unlocked(c, fp);
  funlockfile(fp);
  return (ret);
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <flockfile@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <putc_unlocked@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <funlockfile@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <flockfile@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <putc_unlocked@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <funlockfile@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @putc(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 = call i32 @flockfile(i32* %6)
%8 = load i32, i32* %3
%9 = load i32*, i32** %4
%10 = call i32 @putc_unlocked(i32 %8, i32* %9)
store i32 %10, i32* %5
%11 = load i32*, i32** %4
%12 = call i32 @funlockfile(i32* %11)
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @putc(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @flockfile(i32* %1)
%4 = tail call i32 @putc_unlocked(i32 %0, i32* %1)
%5 = tail call i32 @funlockfile(i32* %1)
ret i32 %4
}
/* Variables and functions */
int rename(char *, char *);
int file_move(char *oldpath, char *newpath) { return rename(oldpath, newpath); }


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

x86 assembly (clang, -O2):
<file_move>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @file_move(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}