xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sig_handler() {
  printf("Interrupted by SIGALRM\n");
  printf("Test PASSED: main blocked on barrier init\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sig_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sig_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Interrupted by SIGALRM\0A\00"
@.str.1 = [43 x i8] c"Test PASSED: main blocked on barrier init\0A\00"
define void @sig_handler() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Interrupted by SIGALRM\00"
@str.2 = [42 x i8] c"Test PASSED: main blocked on barrier init\00"
define void @sig_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char, char, char, char);
char *makeIpv4AddresstoStr(uint32_t addr) {
  static char ip_str[15];
  sprintf(ip_str, "%d.%d.%d.%d", ((char *)&addr)[3], ((char *)&addr)[2],
          ((char *)&addr)[1], ((char *)&addr)[0]);
  return ip_str;
}


x86 assembly (clang, -O0):
<makeIpv4AddresstoStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
lea    0x2efe(%rip),%rdi
lea    0xece(%rip),%rsi
movsbl %dl,%edx
movsbl %cl,%ecx
movsbl %al,%r8d
movsbl -0x4(%rbp),%r9d
call   1030 <sprintf@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeIpv4AddresstoStr>:
push   %rbx
mov    %edi,%eax
shr    $0x8,%eax
mov    %edi,%ecx
shr    $0x10,%ecx
mov    %edi,%edx
sar    $0x18,%edx
movsbl %dil,%r9d
movsbl %cl,%ecx
movsbl %al,%r8d
lea    0x2ef7(%rip),%rbx
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@makeIpv4AddresstoStr.ip_str = internal global [15 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @makeIpv4AddresstoStr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = bitcast i32* %2 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = load i8, i8* %7
%9 = bitcast i32* %2 to i8*
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = bitcast i32* %2 to i8*
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @makeIpv4AddresstoStr.ip_str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %8, i8 signext %11, i8 signext %14)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @makeIpv4AddresstoStr.ip_str, i64 0, i64 0)
}

LLVM IR (-O2):
@makeIpv4AddresstoStr.ip_str = internal global [15 x i8] zeroinitializer
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @makeIpv4AddresstoStr(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
%9 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @makeIpv4AddresstoStr.ip_str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8 signext %8, i8 signext %6, i8 signext %4, i8 signext %2)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @makeIpv4AddresstoStr.ip_str, i64 0, i64 0)
}
void maiuscula(char *ltr) {
  if ((ltr[0] >= 97) && (ltr[0] <= 122))
    ltr[0] -= 32;
}


x86 assembly (clang, -O0):
<maiuscula>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1134 <maiuscula+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1134 <maiuscula+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<maiuscula>:
mov    (%rdi),%al
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     110e <maiuscula+0xe>
add    $0xe0,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @maiuscula(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %21
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br i1 %13, label %14, label %21
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 32
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
br label %21
21: ; preds = %14, %8, %1
ret void
}

LLVM IR (-O2):
define void @maiuscula(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i8 %2, -32
store i8 %6, i8* %0
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int cmditem_ctop(char const);
int /*<<< orphan*/ printf(char *);
int cmditem_to_prio(const char ch) {
  printf("cmditem_to_prio() is deprecated. use cmditem_ctop() instead.\n");
  return cmditem_ctop(ch);
}


x86 assembly (clang, -O0):
<cmditem_to_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1030 <cmditem_ctop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmditem_to_prio>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <cmditem_ctop@plt>

LLVM IR (-O0):
@.str = [62 x i8] c"cmditem_to_prio() is deprecated. use cmditem_ctop() instead.\0A\00"
define i32 @cmditem_to_prio(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
%5 = call i32 @cmditem_ctop(i8 signext %4)
ret i32 %5
}

LLVM IR (-O2):
@str = [61 x i8] c"cmditem_to_prio() is deprecated. use cmditem_ctop() instead.\00"
define i32 @cmditem_to_prio(i8 signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @cmditem_ctop(i8 signext %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ERR_print_errors_fp(int /*<<< orphan*/);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ stderr;
void handle_crypto_error(void) {
  ERR_print_errors_fp(stderr);
  abort();
}


x86 assembly (clang, -O0):
<handle_crypto_error>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<handle_crypto_error>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1040 <ERR_print_errors_fp@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @handle_crypto_error() {
%1 = load i32, i32* @stderr
%2 = call i32 @ERR_print_errors_fp(i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @handle_crypto_error() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @ERR_print_errors_fp(i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t ifloor(int a) { return a & ~0xfff; }


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

x86 assembly (clang, -O2):
<ifloor>:
mov    %edi,%eax
and    $0xfffff000,%eax
ret

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

LLVM IR (-O2):
define i32 @ifloor(i32 %0) {
%2 = and i32 %0, -4096
ret i32 %2
}
/* Variables and functions */
scalar_t__ EBADF;
int /*<<< orphan*/ F_GETFD;
scalar_t__ errno;
int fcntl(int, int /*<<< orphan*/);
int is_valid_fd(int fd) { return fcntl(fd, F_GETFD) != -1 || errno != EBADF; }


x86 assembly (clang, -O0):
<is_valid_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    $0xffffffff,%ecx
mov    %al,-0x5(%rbp)
jne    1156 <is_valid_fd+0x46>
mov    0x2e9d(%rip),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_fd>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
setne  %al
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9a(%rip),%rdx
cmp    (%rdx),%rcx
setne  %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @is_valid_fd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_GETFD
%5 = call i32 @fcntl(i32 %3, i32 %4)
%6 = icmp ne i32 %5, -1
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i64, i64* @errno
%9 = load i64, i64* @EBADF
%10 = icmp ne i64 %8, %9
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ true, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@errno = global i64 0
@EBADF = global i64 0
define i32 @is_valid_fd(i32 %0) {
%2 = load i32, i32* @F_GETFD
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = icmp ne i32 %3, -1
%5 = load i64, i64* @errno
%6 = load i64, i64* @EBADF
%7 = icmp ne i64 %5, %6
%8 = select i1 %4, i1 true, i1 %7
%9 = zext i1 %8 to i32
ret i32 %9
}
int intCmp(const int left, const int right) {
  if (left != right) {
    return (left < right) ? 1 : -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<intCmp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1133 <intCmp+0x33>
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%esi
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <intCmp+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intCmp>:
xor    %ecx,%ecx
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @intCmp(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 1, i32 -1
%6 = select i1 %3, i32 0, i32 %5
ret i32 %6
}
void incrementar(int *x) { *x *= 2; }


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

x86 assembly (clang, -O2):
<incrementar>:
shll   (%rdi)
ret

LLVM IR (-O0):
define void @incrementar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 2
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @incrementar(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl nsw i32 %2, 1
store i32 %3, i32* %0
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t rot16l3(uint16_t x) { return (x << 3) | (x >> 13); }


x86 assembly (clang, -O0):
<rot16l3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
mov    -0x4(%rbp),%ecx
sar    $0xd,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot16l3>:
lea    0x0(,%rdi,8),%eax
sar    $0xd,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rot16l3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 3
%5 = load i32, i32* %2
%6 = ashr i32 %5, 13
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @rot16l3(i32 %0) {
%2 = shl i32 %0, 3
%3 = ashr i32 %0, 13
%4 = or i32 %2, %3
ret i32 %4
}
void testDiagnosableBranch(int a) {
  if (a) {
    *(volatile int *)0 = 1;
  }
}


x86 assembly (clang, -O0):
<testDiagnosableBranch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1119 <testDiagnosableBranch+0x19>
xor    %eax,%eax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testDiagnosableBranch>:
test   %edi,%edi
je     110f <testDiagnosableBranch+0xf>
movl   $0x1,0x0
ret

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

LLVM IR (-O2):
define void @testDiagnosableBranch(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
store volatile i32 1, i32* null
br label %4
4: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int _onebit(uint8_t c) {
  int n, s;
  if (sizeof(int) >= 3)
    return c != 0 && ((((c - 1) << 15) / c) & 0xFF) == 0x00;
  s = 0;
  for (n = 0; n < 8; n++)
    if (c & (1 << n))
      s++;
  return s == 1;
}


x86 assembly (clang, -O0):
<_onebit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
je     1131 <_onebit+0x31>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
shl    $0xf,%eax
cltd
idivl  -0x4(%rbp)
and    $0xff,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_onebit>:
test   %edi,%edi
je     111b <_onebit+0x1b>
mov    %edi,%eax
shl    $0xf,%eax
add    $0xffff8000,%eax
cltd
idiv   %edi
mov    %eax,%ecx
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_onebit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = shl i32 %9, 15
%11 = load i32, i32* %2
%12 = sdiv i32 %10, %11
%13 = and i32 %12, 255
%14 = icmp eq i32 %13, 0
br label %15
15: ; preds = %7, %1
%16 = phi i1 [ false, %1 ], [ %14, %7 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @_onebit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = shl i32 %0, 15
%5 = add i32 %4, -32768
%6 = sdiv i32 %5, %0
%7 = and i32 %6, 255
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %11
}
/* Type definitions */
struct tm {
  int tm_yday;
};

/* Variables and functions */
int tm_getdayofyear(struct tm date) { return date.tm_yday + 1; }


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

x86 assembly (clang, -O2):
<tm_getdayofyear>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @tm_getdayofyear(i32 %0) {
%2 = alloca %struct.tm
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @tm_getdayofyear(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int good1(void) {
  int(TYP) = 0;
  return TYP;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *OpenFile(char *name) {
  FILE *ReadFile = fopen(name, "r");
  if (ReadFile == NULL) {
    printf("File %s not found!\n", name);
    exit(2);
  }
  return ReadFile;
}


x86 assembly (clang, -O0):
<OpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1175 <OpenFile+0x45>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenFile>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <OpenFile+0x17>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"File %s not found!\0A\00"
define i32* @OpenFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 2)
unreachable
12: ; preds = %1
%13 = load i32*, i32** %3
ret i32* %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [20 x i8] c"File %s not found!\0A\00"
define noalias i32* @OpenFile(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 2)
unreachable
7: ; preds = %1
ret i32* %2
}
INI_Bool_TYPE() {}


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

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

LLVM IR (-O0):
define i32 @INI_Bool_TYPE() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @INI_Bool_TYPE() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinIntClear(int, unsigned int);
unsigned int GPIOPinIntStatus(int, int);
void wave_cap32_clean(void) {
  unsigned int status;
  status = GPIOPinIntStatus(0x40007000, 1);
  GPIOPinIntClear(0x40007000, status);
}


x86 assembly (clang, -O0):
<wave_cap32_clean>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x40007000,%edi
mov    $0x1,%esi
call   1040 <GPIOPinIntStatus@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x40007000,%edi
call   1030 <GPIOPinIntClear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_cap32_clean>:
push   %rax
mov    $0x40007000,%edi
mov    $0x1,%esi
call   1040 <GPIOPinIntStatus@plt>
mov    $0x40007000,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <GPIOPinIntClear@plt>

LLVM IR (-O0):
define void @wave_cap32_clean() {
%1 = alloca i32
%2 = call i32 @GPIOPinIntStatus(i32 1073770496, i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @GPIOPinIntClear(i32 1073770496, i32 %3)
ret void
}

LLVM IR (-O2):
define void @wave_cap32_clean() {
%1 = tail call i32 @GPIOPinIntStatus(i32 1073770496, i32 1)
%2 = tail call i32 @GPIOPinIntClear(i32 1073770496, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_ExpressionSyntaxMethodArgumentsDontConform(long p_position) {
  _Error(p_position, "Expression syntax method arguments must either have "
                     "'input' first, or 'output' last (but not both)");
}


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

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

LLVM IR (-O0):
@.str = [99 x i8] c"Expression syntax method arguments must either have 'input' first, or 'output' last (but not both)\00"
define void @Error_ExpressionSyntaxMethodArgumentsDontConform(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [99 x i8] c"Expression syntax method arguments must either have 'input' first, or 'output' last (but not both)\00"
define void @Error_ExpressionSyntaxMethodArgumentsDontConform(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int callatz(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", callatz(n));
  return 0;
}


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

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

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

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


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

x86 assembly (clang, -O2):
<is_whitespace>:
jmp    1030 <isspace@plt>

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

LLVM IR (-O2):
define i32 @is_whitespace(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
ret i32 %2
}
int strLen(char *str) {
  char *ptr = str;
  while (*ptr != '\0')
    ptr++;
  return ptr - str;
}


x86 assembly (clang, -O0):
<strLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <strLen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strLen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strLen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strLen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strLen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int shdn16(x)
register unsigned short *x;
{
  int i;
  register unsigned short *p;
  x += 14;
  p = x + 1;
  for (i = 0; i < 14 - 2; i++)
    *(--p) = *(--x);
  *(--p) = 0;
  return 0;
}


x86 assembly (clang, -O0):
<shdn16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1c,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jge    1165 <shdn16+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x8(%rbp)
mov    -0x2(%rax),%cx
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffffe,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cx,-0x2(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <shdn16+0x27>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffffe,%rcx
mov    %rcx,-0x18(%rbp)
movw   $0x0,-0x2(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shdn16>:
mov    0x14(%rdi),%rax
mov    %rax,0x16(%rdi)
movups 0x4(%rdi),%xmm0
movups %xmm0,0x6(%rdi)
movw   $0x0,0x4(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @shdn16(i16* nocapture %0) {
%2 = getelementptr i16, i16* %0, i64 3
%3 = bitcast i16* %2 to i8*
%4 = getelementptr i16, i16* %0, i64 2
%5 = bitcast i16* %4 to i8*
%6 = getelementptr i16, i16* %0, i64 2
store i16 0, i16* %6
ret i32 0
}
void INT_Excep_SCI7_RXI7(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_SCI7_RXI7() {
ret void
}
/* Variables and functions */
int get_key(int, int);
int tolower(int);
bool pressed(int key, int input) {
  int i;
  input = tolower(input);
  for (i = 0; i < 2; i++) {
    if (input == get_key(key, i)) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<pressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <tolower@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1187 <pressed+0x67>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <get_key@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jne    1174 <pressed+0x54>
movl   $0x1,-0x4(%rbp)
jmp    118e <pressed+0x6e>
jmp    1179 <pressed+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <pressed+0x20>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pressed>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <tolower@plt>
mov    %eax,%ebx
mov    %ebp,%edi
xor    %esi,%esi
call   1030 <get_key@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%ebx
je     1157 <pressed+0x37>
mov    %ebp,%edi
mov    $0x1,%esi
call   1030 <get_key@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%ebx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @pressed(i32 %0, i32 %1) {
%3 = tail call i32 @tolower(i32 %1)
%4 = tail call i32 @get_key(i32 %0, i32 0)
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = tail call i32 @get_key(i32 %0, i32 1)
%8 = icmp eq i32 %3, %7
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %2
%11 = phi i32 [ 1, %2 ], [ %9, %6 ]
ret i32 %11
}
int setlower(ch, val)
char *ch;
char *val;
{ return (*val & 255); }


x86 assembly (clang, -O0):
<setlower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setlower>:
movzbl (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @setlower(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = and i32 %7, 255
ret i32 %8
}

LLVM IR (-O2):
define i32 @setlower(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/);
size_t ftell(int /*<<< orphan*/ *);
size_t fsize(FILE *file) {
  size_t at = ftell(file);
  fseek(file, 0, SEEK_END);
  size_t size = ftell(file);
  fseek(file, at, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @fsize(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void deadmessage() { printf("Too close to ball. Retreat! \n"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Too close to ball. Retreat! \0A\00"
define void @deadmessage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"Too close to ball. Retreat! \00"
define void @deadmessage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
void rep_ret() { asm("rep; ret"); }


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

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

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

LLVM IR (-O2):
define void @rep_ret() {
tail call void asm sideeffect "rep; ret", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ replace(char *);
void main() {
  char str[100] = "hi this is the string";
  replace(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x64,%edx
call   1030 <memcpy@plt>
lea    -0x70(%rbp),%rdi
call   1040 <replace@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
movaps 0xf35(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xf19(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xefd(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea9(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%rdi
call   1030 <replace@plt>
add    $0x68,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [100 x i8] c"hi this is the string\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = bitcast [100 x i8]* %1 to i8*
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @replace(i8* %3)
ret void
}

LLVM IR (-O2):
@__const.main.str = [100 x i8] c"hi this is the string\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @replace(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_9720() {
  Assert_real((isqrt(9720) == 98),
              "/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/stdlib/isqrt.c",
              1480, ("Integer square root of 9720 should be 98"));
}


x86 assembly (clang, -O0):
<t_sqrt_9720>:
push   %rbp
mov    %rsp,%rbp
mov    $0x25f8,%edi
call   1030 <isqrt@plt>
cmp    $0x62,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x5c8,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_9720>:
push   %rax
mov    $0x25f8,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x62,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x5c8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 9720 should be 98\00"
define void @t_sqrt_9720() {
%1 = call i32 @isqrt(i32 9720)
%2 = icmp eq i32 %1, 98
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1480, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 9720 should be 98\00"
define void @t_sqrt_9720() {
%1 = tail call i32 @isqrt(i32 9720)
%2 = icmp eq i32 %1, 98
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1480, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void greet(int greeting_code) {
  if (greeting_code == 0) {
    puts("Whats up!");
  } else {
    puts("Not implemented");
  }
}


x86 assembly (clang, -O0):
<greet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <greet+0x26>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
jmp    1142 <greet+0x32>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<greet>:
test   %edi,%edi
lea    0xee7(%rip),%rax
lea    0xeea(%rip),%rdi
cmove  %rax,%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Whats up!\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define void @greet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"Whats up!\00"
@.str.1 = [16 x i8] c"Not implemented\00"
define void @greet(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret void
}
int my_mod(int n, int m) { return (n % m); }


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

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

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

LLVM IR (-O2):
define i32 @my_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __explicit_bzero_hook(void *, size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void explicit_bzero(void *buf, size_t len) {
  memset(buf, 0, len);
  __explicit_bzero_hook(buf, len);
}


x86 assembly (clang, -O0):
<explicit_bzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__explicit_bzero_hook@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explicit_bzero>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__explicit_bzero_hook@plt>

LLVM IR (-O0):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @memset(i8* %5, i32 0, i64 %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = call i32 @__explicit_bzero_hook(i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @explicit_bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
%4 = tail call i32 @__explicit_bzero_hook(i8* %0, i64 %1)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ AT_SYMLINK_NOFOLLOW;
int fstatat(int /*<<< orphan*/, char const *, struct stat *,
            int /*<<< orphan*/);
int lstat(const char *pathname, struct stat *statbuf) {
  return fstatat(AT_FDCWD, pathname, statbuf, AT_SYMLINK_NOFOLLOW);
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ecx
call   1030 <fstatat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lstat>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <fstatat@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* @AT_FDCWD
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%9 = call i32 @fstatat(i32 %5, i8* %6, %struct.stat* %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@AT_FDCWD = global i32 0
@AT_SYMLINK_NOFOLLOW = global i32 0
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = load i32, i32* @AT_FDCWD
%4 = load i32, i32* @AT_SYMLINK_NOFOLLOW
%5 = tail call i32 @fstatat(i32 %3, i8* %0, %struct.stat* %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ log10(double);
float log10f(float _X) { return ((float)log10((double)_X)); }


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

x86 assembly (clang, -O2):
<log10f>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <log10@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log10f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @log10(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @log10f(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @log10(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
float glmDot3f(const float x[3], const float y[3]) {
  return x[0] * y[0] + x[1] * y[1] + x[2] * y[2];
}


x86 assembly (clang, -O0):
<glmDot3f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDot3f>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glmDot3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @glmDot3f(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}