xunge/DecIR huggingface dataset:
/* Type definitions */
struct pool {
  int dummy;
};

/* Variables and functions */
char *pool_alloc(struct pool *, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *pool_strdup(struct pool *pool, const char *str) {
  char *res;
  res = pool_alloc(pool, strlen(str) + 1);
  strcpy(res, str);
  return res;
}


x86 assembly (clang, -O0):
<pool_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rsi
add    $0x1,%rsi
call   1040 <pool_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%rsi
mov    %r14,%rdi
call   1040 <pool_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.pool = type { i32 }
define i8* @pool_strdup(%struct.pool* %0, i8* %1) {
%3 = alloca %struct.pool*
%4 = alloca i8*
%5 = alloca i8*
store %struct.pool* %0, %struct.pool** %3
store i8* %1, i8** %4
%6 = load %struct.pool*, %struct.pool** %3
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @pool_alloc(%struct.pool* %6, i64 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
%struct.pool = type { i32 }
define i8* @pool_strdup(%struct.pool* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @pool_alloc(%struct.pool* %0, i64 %4)
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret i8* %5
}
void gdk_init_check() {}


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

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

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

LLVM IR (-O2):
define void @gdk_init_check() {
ret void
}
/* Variables and functions */
int pkey_alloc(int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) { return pkey_alloc(0, 0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <pkey_alloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <pkey_alloc@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @pkey_alloc(i32 0, i32 0)
ret i32 %1
}
void troca(int *x, int *y) {
  int aux;
  aux = *x;
  *x = *y;
  *y = aux;
}


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

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

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

LLVM IR (-O2):
define void @troca(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
void fill_array(unsigned char *a, size_t len, char c, char term) {
  size_t i, last;
  last = len - 1;
  for (i = 0; i < last; ++i) {
    a[i] = c;
  }
  a[last] = term;
}


x86 assembly (clang, -O0):
<fill_array>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1157 <fill_array+0x57>
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112a <fill_array+0x2a>
mov    -0x12(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
add    $0xffffffffffffffff,%rbx
je     1131 <fill_array+0x21>
movzbl %dl,%esi
mov    %rbp,%rdi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14b,0x0(%rbp,%rbx,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fill_array(i8* nocapture writeonly %0, i64 %1, i8 signext %2, i8 signext %3) {
%5 = add i64 %1, -1
%6 = icmp eq i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
br label %8
8: ; preds = %7, %4
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %3, i8* %9
ret void
}
/* Variables and functions */
scalar_t__ strchr(char *, char);
int isnum(char c) { return strchr("0123456789+-.eE", c) != 0; }


x86 assembly (clang, -O0):
<isnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnum>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"0123456789+-.eE\00"
define i32 @isnum(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [16 x i8] c"0123456789+-.eE\00"
define i32 @isnum(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
long int x_to_the_n(int x, int n) {
  long int result = 1;
  while (n > 0) {
    result *= x;
    --n;
  }
  return result;
}


x86 assembly (clang, -O0):
<x_to_the_n>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1137 <x_to_the_n+0x37>
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <x_to_the_n+0x12>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_to_the_n>:
test   %esi,%esi
jle    111b <x_to_the_n+0x1b>
movslq %edi,%rcx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1121 <x_to_the_n+0x21>
mov    $0x1,%eax
jmp    1155 <x_to_the_n+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <x_to_the_n+0x30>
test   %edx,%edx
je     1169 <x_to_the_n+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <x_to_the_n+0x60>
ret

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

LLVM IR (-O2):
define i64 @x_to_the_n(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %34
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul nsw i64 %12, %5
%15 = mul nsw i64 %14, %5
%16 = mul nsw i64 %15, %5
%17 = mul nsw i64 %16, %5
%18 = mul nsw i64 %17, %5
%19 = mul nsw i64 %18, %5
%20 = mul nsw i64 %19, %5
%21 = mul nsw i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul nsw i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %24, %28, %2
%35 = phi i64 [ 1, %2 ], [ %25, %24 ], [ %31, %28 ]
ret i64 %35
}
int inverse_effective_depth(int depth) { return (depth + 1) / 2; }


x86 assembly (clang, -O0):
<inverse_effective_depth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<inverse_effective_depth>:
mov    %edi,%eax
add    $0x1,%eax
shr    $0x1f,%eax
add    %edi,%eax
add    $0x1,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @inverse_effective_depth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @inverse_effective_depth(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = sdiv i32 %2, 2
ret i32 %3
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int File_size(char *name) {
  struct stat st;
  if (!stat(name, &st))
    return st.st_size;
  return -1;
}


x86 assembly (clang, -O0):
<File_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
jne    113d <File_size+0x2d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <File_size+0x34>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %eax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @File_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @File_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void hello(char **str) {
  if (str)
    printf("Hello %s\n", *str);
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113a <hello+0x2a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
test   %rdi,%rdi
je     1124 <hello+0x14>
mov    (%rdi),%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @hello(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 %9
5: ; preds = %1
%6 = load i8**, i8*** %2
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Hello %s\0A\00"
define void @hello(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpm_abort();
int /*<<< orphan*/ puts(char *);
void abort_and_solicit_report(void) {
  puts("Please email will@sowerbutts.com if you would like support for "
       "your\nsystem added to this program.");
  cpm_abort();
}


x86 assembly (clang, -O0):
<abort_and_solicit_report>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <cpm_abort@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<abort_and_solicit_report>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cpm_abort@plt>

LLVM IR (-O0):
@.str = [98 x i8] c"Please email will@sowerbutts.com if you would like support for your\0Asystem added to this program.\00"
define void @abort_and_solicit_report() {
%1 = call i32 @puts(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @cpm_abort()
ret void
}

LLVM IR (-O2):
@.str = [98 x i8] c"Please email will@sowerbutts.com if you would like support for your\0Asystem added to this program.\00"
define void @abort_and_solicit_report() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @cpm_abort()
ret void
}
/* Variables and functions */
char *strdup(char const *);
int /*<<< orphan*/ sysErr(char *);
char *xstrdup(const char *s) {
  register char *ret = strdup(s);
  if (!ret)
    sysErr("strdup");
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xstrdup+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <sysErr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xstrdup+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <sysErr@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sysErr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void draws(int minx, int miny, int maxx, int maxy) {}


x86 assembly (clang, -O0):
<draws>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @draws(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int printhoursreport(char *, int);
int usefilename(char *);
int reporter(char userid[4], int usertype, int weekends) {
  char usefile[12];
  int a, b;
  a = usefilename(&usefile[0]);
  if (a != 1) {
    b = printhoursreport(usefile, weekends);
  }
  exit(0);
}


x86 assembly (clang, -O0):
<reporter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <usefilename@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x1,-0x20(%rbp)
je     1167 <reporter+0x37>
lea    -0x1c(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <printhoursreport@plt>
mov    %eax,-0x24(%rbp)
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<reporter>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
lea    0x4(%rsp),%rdi
call   1040 <usefilename@plt>
cmp    $0x1,%eax
je     1152 <reporter+0x22>
lea    0x4(%rsp),%rdi
mov    %ebx,%esi
call   1030 <printhoursreport@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @reporter(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [12 x i8]
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%11 = call i32 @usefilename(i8* %10)
store i32 %11, i32* %8
%12 = load i32, i32* %8
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%16 = load i32, i32* %6
%17 = call i32 @printhoursreport(i8* %15, i32 %16)
store i32 %17, i32* %9
br label %18
18: ; preds = %14, %3
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @reporter(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = alloca [12 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%6 = call i32 @usefilename(i8* %5)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = call i32 @printhoursreport(i8* %5, i32 %2)
br label %10
10: ; preds = %8, %3
%11 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ freework();
int /*<<< orphan*/ plabort(char const *);
void myabort(const char *msg) {
  freework();
  plabort(msg);
}


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

x86 assembly (clang, -O2):
<myabort>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <freework@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <plabort@plt>

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

LLVM IR (-O2):
define void @myabort(i8* %0) {
%2 = tail call i32 (...) @freework()
%3 = tail call i32 @plabort(i8* %0)
ret void
}
/* Variables and functions */
float hgetfontwidth();
float hgetfw_() { return (hgetfontwidth()); }


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

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

LLVM IR (-O0):
define float @hgetfw_() {
%1 = call float (...) @hgetfontwidth()
ret float %1
}

LLVM IR (-O2):
define float @hgetfw_() {
%1 = tail call float (...) @hgetfontwidth()
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x59() {
  Assert_real((islower(89) == 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",
              450, ("islower should be 0 for Y"));
}


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

x86 assembly (clang, -O2):
<t_islower_0x59>:
push   %rax
mov    $0x59,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1c2,%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 Y\00"
define void @t_islower_0x59() {
%1 = call i64 @islower(i32 89)
%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 450, 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 Y\00"
define void @t_islower_0x59() {
%1 = tail call i64 @islower(i32 89)
%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 450, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int parse_char_code_common(char **, int *, char, int /*<<< orphan*/);
int parse_char_code(char **s, int *comp, char terminator) {
  return parse_char_code_common(s, comp, terminator, 0);
}


x86 assembly (clang, -O0):
<parse_char_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %ecx,%ecx
movsbl -0x11(%rbp),%edx
call   1030 <parse_char_code_common@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_char_code>:
xor    %ecx,%ecx
jmp    1030 <parse_char_code_common@plt>

LLVM IR (-O0):
define i32 @parse_char_code(i8** %0, i32* %1, i8 signext %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i8
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i8**, i8*** %4
%8 = load i32*, i32** %5
%9 = load i8, i8* %6
%10 = call i32 @parse_char_code_common(i8** %7, i32* %8, i8 signext %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @parse_char_code(i8** %0, i32* %1, i8 signext %2) {
%4 = tail call i32 @parse_char_code_common(i8** %0, i32* %1, i8 signext %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf2(char *);
void GenStartCommentLine(void) { printf2(" # "); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c" # \00"
define void @GenStartCommentLine() {
%1 = call i32 @printf2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" # \00"
define void @GenStartCommentLine() {
%1 = tail call i32 @printf2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void reportAnswer(int a, int b) { printf("%d %d\n", a, b); }


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

x86 assembly (clang, -O2):
<reportAnswer>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define void @reportAnswer(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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define void @reportAnswer(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
unsigned long long g(unsigned long long a) { return __builtin_bswap64(a); }


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

x86 assembly (clang, -O2):
<g>:
mov    %rdi,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @g(i64 %0) {
%2 = tail call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
void nop_EA(void) {}


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

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

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

LLVM IR (-O2):
define void @nop_EA() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i test_mm_subs_epi8(__m128i A, __m128i B) { return _mm_subs_epi8(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_subs_epi8>:
jmp    1030 <_mm_subs_epi8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_subs_epi8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_epi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void playerInBedroomGotBat() {
  puts("\nYou pick up the bat. It feels quite trusty.");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"\0AYou pick up the bat. It feels quite trusty.\00"
define void @playerInBedroomGotBat() {
%1 = call i32 @puts(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"\0AYou pick up the bat. It feels quite trusty.\00"
define void @playerInBedroomGotBat() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
void INI_GENState_ffnc_ctx() {}


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

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

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

LLVM IR (-O2):
define void @INI_GENState_ffnc_ctx() {
ret void
}
unsigned int hash(s)
char *s;
{
  unsigned char *p;
  unsigned int r;
  p = (unsigned char *)s;
  for (r = 0; *p; p++) {
    r = r * 3 + *p;
  }
  return r;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <hash+0x45>
imul   $0x3,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <hash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <hash+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,2),%edx
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 3
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ Window;

/* Variables and functions */
int /*<<< orphan*/ GetUnsignedLongLongSetting(char *, int /*<<< orphan*/);
int /*<<< orphan*/ None;
Window ReadWindowID(void) {
  return GetUnsignedLongLongSetting("XSCREENSAVER_WINDOW", None);
}


x86 assembly (clang, -O0):
<ReadWindowID>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <GetUnsignedLongLongSetting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadWindowID>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <GetUnsignedLongLongSetting@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"XSCREENSAVER_WINDOW\00"
@None = global i32 0
define i32 @ReadWindowID() {
%1 = load i32, i32* @None
%2 = call i32 @GetUnsignedLongLongSetting(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [20 x i8] c"XSCREENSAVER_WINDOW\00"
@None = global i32 0
define i32 @ReadWindowID() {
%1 = load i32, i32* @None
%2 = tail call i32 @GetUnsignedLongLongSetting(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_ScreenLeft(void) { WriteInstruction("call scrl"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"call scrl\00"
define void @CR_ScreenLeft() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"call scrl\00"
define void @CR_ScreenLeft() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t pos_uint64_t(uint64_t number) { return number; }


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

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

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

LLVM IR (-O2):
define i32 @pos_uint64_t(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
double fabs(int);
double ydistance_from_center(int j, double dy, int yc) {
  return fabs((j - yc) * dy);
}


x86 assembly (clang, -O0):
<ydistance_from_center>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <fabs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ydistance_from_center>:
sub    %esi,%edi
cvtsi2sd %edi,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <fabs@plt>

LLVM IR (-O0):
define double @ydistance_from_center(i32 %0, double %1, i32 %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca i32
store i32 %0, i32* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = sub nsw i32 %7, %8
%10 = sitofp i32 %9 to double
%11 = load double, double* %5
%12 = fmul double %10, %11
%13 = fptosi double %12 to i32
%14 = call double @fabs(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @ydistance_from_center(i32 %0, double %1, i32 %2) {
%4 = sub nsw i32 %0, %2
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %1
%7 = fptosi double %6 to i32
%8 = tail call double @fabs(i32 %7)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void string_delete(const char *str) { free((char *)str); }


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

x86 assembly (clang, -O2):
<string_delete>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @string_delete(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mode_update();
void mode_init(void) { mode_update(); }


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

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

LLVM IR (-O0):
define void @mode_init() {
%1 = call i32 (...) @mode_update()
ret void
}

LLVM IR (-O2):
define void @mode_init() {
%1 = tail call i32 (...) @mode_update()
ret void
}
float uint_as_float(unsigned int i) {
  union {
    unsigned int i;
    float f;
  } u;
  u.i = i;
  return u.f;
}


x86 assembly (clang, -O0):
<uint_as_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_as_float>:
movd   %edi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @uint_as_float(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %union.anon* %3 to i32*
store i32 %4, i32* %5
%6 = bitcast %union.anon* %3 to float*
%7 = load float, float* %6
ret float %7
}

LLVM IR (-O2):
define float @uint_as_float(i32 %0) {
%2 = bitcast i32 %0 to float
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ sd_nvic_SystemReset();
void ser_conn_reset_command_process() {
  (void)sd_nvic_SystemReset();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<ser_conn_reset_command_process>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sd_nvic_SystemReset@plt>
jmp    111b <ser_conn_reset_command_process+0xb>

x86 assembly (clang, -O2):
<ser_conn_reset_command_process>:
push   %rax
xor    %eax,%eax
call   1030 <sd_nvic_SystemReset@plt>
nopl   0x0(%rax,%rax,1)
jmp    1120 <ser_conn_reset_command_process+0x10>

LLVM IR (-O0):
define void @ser_conn_reset_command_process() {
%1 = call i32 (...) @sd_nvic_SystemReset()
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define void @ser_conn_reset_command_process() {
%1 = tail call i32 (...) @sd_nvic_SystemReset()
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int printf(char *);
int main(void) { return printf("hello world\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
double test_nextafter(double x, double y) { return __builtin_nextafter(x, y); }


x86 assembly (clang, -O0):
<test_nextafter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <nextafter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nextafter>:
jmp    1030 <nextafter@plt>

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

LLVM IR (-O2):
define double @test_nextafter(double %0, double %1) {
%3 = tail call double @nextafter(double %0, double %1)
ret double %3
}
void uart1TxFlush(void) {
  (*((volatile unsigned char *)0xE0010008)) |= (1 << 2);
}


x86 assembly (clang, -O0):
<uart1TxFlush>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0010008,%eax
mov    (%rax),%al
movzbl %al,%eax
or     $0x4,%eax
mov    %al,%cl
mov    $0xe0010008,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart1TxFlush>:
mov    $0xe0010008,%eax
orb    $0x4,(%rax)
ret

LLVM IR (-O0):
define void @uart1TxFlush() {
%1 = load volatile i8, i8* inttoptr (i64 3758161928 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 4
%4 = trunc i32 %3 to i8
store volatile i8 %4, i8* inttoptr (i64 3758161928 to i8*)
ret void
}

LLVM IR (-O2):
define void @uart1TxFlush() {
%1 = load volatile i8, i8* inttoptr (i64 3758161928 to i8*)
%2 = or i8 %1, 4
store volatile i8 %2, i8* inttoptr (i64 3758161928 to i8*)
ret void
}
void test() {
#pragma omp taskgroup
  ;
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned long);
int f(int n) {
  printf(" n %d[%lu] \n", n, (unsigned long)&n);
  return f(n + 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x4(%rbp),%rdx
lea    0xec7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %edi,%esi
mov    %edi,0x4(%rsp)
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rdx
call   1040 <printf@plt>
mov    0x4(%rsp),%edi
add    $0x1,%edi
call   1030 <f@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c" n %d[%lu] \0A\00"
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = ptrtoint i32* %2 to i64
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i64 %3)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
%7 = call i32 @f(i32 %6)
ret i32 undef
}
int rgb_max(unsigned char r, unsigned char g, unsigned char b) {
  int max = r;
  if (g > max)
    max = g;
  if (b > max)
    max = b;
  return max;
}


x86 assembly (clang, -O0):
<rgb_max>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1130 <rgb_max+0x30>
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzbl -0x3(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1144 <rgb_max+0x44>
movzbl -0x3(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_max>:
mov    %edi,%eax
cmp    %al,%sil
cmova  %esi,%eax
cmp    %dl,%al
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rgb_max(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp ugt i8 %1, %0
%5 = select i1 %4, i8 %1, i8 %0
%6 = icmp ult i8 %5, %2
%7 = select i1 %6, i8 %2, i8 %5
%8 = zext i8 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void Usage(char *f) { printf("Usage: %s <file> <string>\n", f); }


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

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

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

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s <file> <string>\0A\00"
define void @Usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
char *getcpy(str)
char *str;
{
  register char *cp;
  cp = malloc((unsigned)strlen(str) + 1);
  strcpy(cp, str);
  return (cp);
}


x86 assembly (clang, -O0):
<getcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcpy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @getcpy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = zext i32 %7 to i64
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i8* @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @getcpy(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = and i64 %3, 4294967295
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i8* @strcpy(i8* dereferenceable(1) %5, i8* dereferenceable(1) %0)
ret i8* %5
}