xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void usage(FILE *stream, const char *cmd, int code) {
  (void)fprintf(stream,
                "Usage: %s -s server -p port -u user [-i image URL] -m message "
                "[-v] [-h]\n",
                cmd);
  exit(code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: %s -s server -p port -u user [-i image URL] -m message [-v] [-h]\0A\00"
define void @usage(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8*, i8** %5
%9 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* %6
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [73 x i8] c"Usage: %s -s server -p port -u user [-i image URL] -m message [-v] [-h]\0A\00"
define void @usage(i32* nocapture %0, i8* %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void agile_aligned_free(void *ap) {
  void *p = ((void **)ap)[-1];
  free(p);
}


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

x86 assembly (clang, -O2):
<agile_aligned_free>:
mov    -0x8(%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @agile_aligned_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i8**
%6 = getelementptr inbounds i8*, i8** %5, i64 -1
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
define void @agile_aligned_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -8
%3 = bitcast i8* %2 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
long EOF;
long getchar();
int /*<<< orphan*/ printf(char *, long);
void printLineNumber() {
  long c, nl;
  nl = 0;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      ++nl;
    }
  }
  printf("Line number: %ld\n", nl);
}


x86 assembly (clang, -O0):
<printLineNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %rax,-0x8(%rbp)
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
je     1167 <printLineNumber+0x47>
cmpq   $0xa,-0x8(%rbp)
jne    1162 <printLineNumber+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1130 <printLineNumber+0x10>
mov    -0x10(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLineNumber>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb4(%rip),%r14
cmp    (%r14),%rax
je     1158 <printLineNumber+0x38>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%ecx
cmp    $0xa,%rax
sete   %cl
add    %rcx,%rbx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%rax
jne    1140 <printLineNumber+0x20>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [18 x i8] c"Line number: %ld\0A\00"
define void @printLineNumber() {
%1 = alloca i64
%2 = alloca i64
store i64 0, i64* %2
br label %3
3: ; preds = %13, %0
%4 = call i64 (...) @getchar()
store i64 %4, i64* %1
%5 = load i64, i64* @EOF
%6 = icmp ne i64 %4, %5
br i1 %6, label %7, label %14
7: ; preds = %3
%8 = load i64, i64* %1
%9 = icmp eq i64 %8, 10
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i64, i64* %2
%12 = add nsw i64 %11, 1
store i64 %12, i64* %2
br label %13
13: ; preds = %10, %7
br label %3
14: ; preds = %3
%15 = load i64, i64* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %15)
ret void
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [18 x i8] c"Line number: %ld\0A\00"
define void @printLineNumber() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i64 [ %10, %4 ], [ %1, %0 ]
%6 = phi i64 [ %9, %4 ], [ 0, %0 ]
%7 = icmp eq i64 %5, 10
%8 = zext i1 %7 to i64
%9 = add nuw nsw i64 %6, %8
%10 = tail call i64 (...) @getchar()
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
%14 = phi i64 [ 0, %0 ], [ %9, %4 ]
%15 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int execv(const char *path, char *const argv[]) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<execv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execv(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @execv(i8* nocapture readnone %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
int obj5func1(int a __attribute__((unused))) { return 66; }


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

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

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

LLVM IR (-O2):
define i32 @obj5func1(i32 %0) {
ret i32 66
}
void _start() {
  asm("int $0x80" ::"a"(4), "b"(1), "c"("Hello world!\n"), "d"(13));
  asm("int $0x80" ::"a"(1), "b"(0));
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
lea    0xef4(%rip),%rcx
mov    $0x4,%eax
mov    $0x1,%ebx
mov    $0xd,%edx
int    $0x80
mov    $0x1,%eax
xor    %ebx,%ebx
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
push   %rbx
lea    0xef8(%rip),%rcx
mov    $0x4,%eax
mov    $0x1,%ebx
mov    $0xd,%edx
int    $0x80
mov    $0x1,%eax
xor    %ebx,%ebx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @_start() {
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define void @_start() {
tail call void asm sideeffect "int $$0x80", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 4, i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
tail call void asm sideeffect "int $$0x80", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cursors();
int /*<<< orphan*/ lprintf(char *, int);
void ydhi(int x) {
  cursors();
  lprintf("\nYou don't have item %c!", x);
}


x86 assembly (clang, -O0):
<ydhi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cursors@plt>
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
call   1040 <lprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ydhi>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <cursors@plt>
lea    0xecf(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <lprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0AYou don't have item %c!\00"
define void @ydhi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cursors()
%4 = load i32, i32* %2
%5 = call i32 @lprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0AYou don't have item %c!\00"
define void @ydhi(i32 %0) {
%2 = tail call i32 (...) @cursors()
%3 = tail call i32 @lprintf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void ikcp_qprint(const char *name, const struct IQUEUEHEAD *head) {}


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

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

LLVM IR (-O0):
%struct.IQUEUEHEAD = type opaque
define void @ikcp_qprint(i8* %0, %struct.IQUEUEHEAD* %1) {
%3 = alloca i8*
%4 = alloca %struct.IQUEUEHEAD*
store i8* %0, i8** %3
store %struct.IQUEUEHEAD* %1, %struct.IQUEUEHEAD** %4
ret void
}

LLVM IR (-O2):
%struct.IQUEUEHEAD = type opaque
define void @ikcp_qprint(i8* nocapture %0, %struct.IQUEUEHEAD* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_sys_cfg_rsn_replay_prot_usage(void) {
  printf("\nUsage : sys_cfg_rsn_replay_prot [0|1]\n");
  printf("\nOptions: 0     - Disable RSN replay protection");
  printf("\n         1     - Enable  RSN replay protection");
  printf("\n         empty - Get current RSN replay protection setting\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_sys_cfg_rsn_replay_prot_usage>:
push   %rax
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
call   1040 <printf@plt>
lea    0xf3b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"\0AUsage : sys_cfg_rsn_replay_prot [0|1]\0A\00"
@.str.1 = [48 x i8] c"\0AOptions: 0 - Disable RSN replay protection\00"
@.str.2 = [48 x i8] c"\0A 1 - Enable RSN replay protection\00"
@.str.3 = [61 x i8] c"\0A empty - Get current RSN replay protection setting\0A\00"
define void @print_sys_cfg_rsn_replay_prot_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [48 x i8] c"\0AOptions: 0 - Disable RSN replay protection\00"
@.str.2 = [48 x i8] c"\0A 1 - Enable RSN replay protection\00"
@str = [39 x i8] c"\0AUsage : sys_cfg_rsn_replay_prot [0|1]\00"
@str.4 = [60 x i8] c"\0A empty - Get current RSN replay protection setting\00"
define void @print_sys_cfg_rsn_replay_prot_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.4, i64 0, i64 0))
ret void
}
unsigned int bcm2835_version(void) { return 10048; }


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

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

LLVM IR (-O0):
define i32 @bcm2835_version() {
ret i32 10048
}

LLVM IR (-O2):
define i32 @bcm2835_version() {
ret i32 10048
}
/* Variables and functions */
int /*<<< orphan*/ log_init(char *);
void amf_cluster_init(void) { log_init("AMF"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"AMF\00"
define void @amf_cluster_init() {
%1 = tail call i32 @log_init(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool isFirstCol(long w) { return (w == 0); }


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

x86 assembly (clang, -O2):
<isFirstCol>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isFirstCol(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned Time2Frame(int min, int sec, int frame) {
  return (unsigned)(min * 60 * 75 + sec * 75 + frame);
}


x86 assembly (clang, -O0):
<Time2Frame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
imul   $0x4b,%eax,%eax
imul   $0x4b,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Time2Frame>:
imul   $0x1194,%edi,%ecx
imul   $0x4b,%esi,%eax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @Time2Frame(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 60
%9 = mul nsw i32 %8, 75
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 75
%12 = add nsw i32 %9, %11
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @Time2Frame(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 4500
%5 = mul nsw i32 %1, 75
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
void test(int x) {
#pragma omp target update to(x)
}


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

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

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

LLVM IR (-O2):
define void @test(i32 %0) {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double rtclock() {
  struct timeval Tp;
  gettimeofday(&Tp, NULL);
  return (Tp.tv_sec + Tp.tv_usec * 1.0e-6);
}


x86 assembly (clang, -O0):
<rtclock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtclock>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @rtclock() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @rtclock() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
/* Variables and functions */
char *strerror(int errnum) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strerror(i32 %0) {
ret i8* null
}
/* Variables and functions */
int strlen(char *);
int os_strlen(char *s) { return strlen(s); }


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

x86 assembly (clang, -O2):
<os_strlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @os_strlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
double floor(double);
double dd_nint_d(double d) {
  if (d == floor(d))
    return d;
  return floor(d + 0.5);
}


x86 assembly (clang, -O0):
<dd_nint_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jne    1158 <dd_nint_d+0x48>
jp     1158 <dd_nint_d+0x48>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    116f <dd_nint_d+0x5f>
movsd  0xea0(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_nint_d>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
jne    112e <dd_nint_d+0x1e>
jp     112e <dd_nint_d+0x1e>
pop    %rax
ret
addsd  0xeca(%rip),%xmm0
pop    %rax
jmp    1030 <floor@plt>

LLVM IR (-O0):
define double @dd_nint_d(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = load double, double* %3
%6 = call double @llvm.floor.f64(double %5)
%7 = fcmp oeq double %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load double, double* %3
store double %9, double* %2
br label %14
10: ; preds = %1
%11 = load double, double* %3
%12 = fadd double %11, 5.000000e-01
%13 = call double @llvm.floor.f64(double %12)
store double %13, double* %2
br label %14
14: ; preds = %10, %8
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @dd_nint_d(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fcmp oeq double %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = fadd double %0, 5.000000e-01
%6 = tail call double @llvm.floor.f64(double %5)
br label %7
7: ; preds = %1, %4
%8 = phi double [ %6, %4 ], [ %0, %1 ]
ret double %8
}
/* Variables and functions */
float asinf(float);
float r_asin(float *x) { return (asinf(*x)); }


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

x86 assembly (clang, -O2):
<r_asin>:
movss  (%rdi),%xmm0
jmp    1030 <asinf@plt>

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

LLVM IR (-O2):
define float @r_asin(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @asinf(float %2)
ret float %3
}
int do_what_you_want(void) {}


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

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

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

LLVM IR (-O2):
define i32 @do_what_you_want() {
ret i32 undef
}
int test_34() {
  int x;
  (void)x;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @test_34() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ test_balanced_brackets();
int /*<<< orphan*/ test_calc();
int /*<<< orphan*/ test_data_ownership();
int /*<<< orphan*/ test_ustack_api();
int main(void) {
  test_calc();
  test_ustack_api();
  test_balanced_brackets();
  test_data_ownership();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_calc@plt>
mov    $0x0,%al
call   1040 <test_ustack_api@plt>
mov    $0x0,%al
call   1050 <test_balanced_brackets@plt>
mov    $0x0,%al
call   1060 <test_data_ownership@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_calc@plt>
xor    %eax,%eax
call   1040 <test_ustack_api@plt>
xor    %eax,%eax
call   1050 <test_balanced_brackets@plt>
xor    %eax,%eax
call   1060 <test_data_ownership@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_calc()
%3 = call i32 (...) @test_ustack_api()
%4 = call i32 (...) @test_balanced_brackets()
%5 = call i32 (...) @test_data_ownership()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_calc()
%2 = tail call i32 (...) @test_ustack_api()
%3 = tail call i32 (...) @test_balanced_brackets()
%4 = tail call i32 (...) @test_data_ownership()
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ report(char const *);
scalar_t__ strncmp(char const *, char *, int);
int re_report(const char *file, const struct stat *sb, int flag) {
  if (strncmp(file, "/proc", 5) != 0)
    report(file);
  return 0;
}


x86 assembly (clang, -O0):
<re_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     115b <re_report+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <report@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_report>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1142 <re_report+0x22>
mov    %rbx,%rdi
call   1040 <report@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [6 x i8] c"/proc\00"
define i32 @re_report(i8* %0, %struct.stat* nocapture readnone %1, i32 %2) {
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @report(i8* %0)
br label %8
8: ; preds = %6, %3
ret i32 0
}
char *return_pointer(char *value) { return value; }


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

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

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

LLVM IR (-O2):
define i8* @return_pointer(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ func(int);
int main(void) {
  func(5);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <func@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func(i32 5)
ret i32 0
}
void process_file(const char *path) {}


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

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

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

LLVM IR (-O2):
define void @process_file(i8* nocapture %0) {
ret void
}
void gdb_ensure_or1k_stalled() { return; }


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

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

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

LLVM IR (-O2):
define void @gdb_ensure_or1k_stalled() {
ret void
}
/* Variables and functions */
int f(int);
int g(int x) {
  if (x == 0) {
    return 1;
  } else
    return f(x * 2);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <g+0x21>
movl   $0x1,-0x4(%rbp)
jmp    113f <g+0x2f>
mov    -0x8(%rbp),%edi
shl    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
test   %edi,%edi
je     111b <g+0xb>
add    %edi,%edi
jmp    1030 <f@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 2
%10 = call i32 @f(i32 %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = shl nsw i32 %0, 1
%5 = tail call i32 @f(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
int addTwoNumbers(int a, int b) { return 42; }


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

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

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

LLVM IR (-O2):
define i32 @addTwoNumbers(i32 %0, i32 %1) {
ret i32 42
}
int rach_max_trans_val2raw(int val) { return (val >> 1) & 3; }


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

x86 assembly (clang, -O2):
<rach_max_trans_val2raw>:
mov    %edi,%eax
shr    %eax
and    $0x3,%eax
ret

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

LLVM IR (-O2):
define i32 @rach_max_trans_val2raw(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 3
ret i32 %3
}
__attribute__((noreturn)) void xalloc_fail() {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<xalloc_fail>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <xalloc_fail+0x9>
jmp    1109 <xalloc_fail+0x9>

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

LLVM IR (-O0):
define void @xalloc_fail() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @xalloc_fail() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void rtcp_xr_dlrr_set_reserved(uint8_t *p_rtcp_xr_dlrr) {
  p_rtcp_xr_dlrr[1] = 0;
}


x86 assembly (clang, -O0):
<rtcp_xr_dlrr_set_reserved>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcp_xr_dlrr_set_reserved>:
movq   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @rtcp_xr_dlrr_set_reserved(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 1
store i64 0, i64* %4
ret void
}

LLVM IR (-O2):
define void @rtcp_xr_dlrr_set_reserved(i64* nocapture writeonly %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 1
store i64 0, i64* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze(char *, char *);
int main(void) {
  char s1[] = "aBCDEFghi";
  squeeze(s1, "ABCdefGhI");
  printf("%s\n", s1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <squeeze@plt>
lea    -0xe(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6867464544434261,%rax
46 67 68
mov    %rax,(%rsp)
movw   $0x69,0x8(%rsp)
lea    0xec9(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <squeeze@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"aBCDEFghi\00"
@.str = [10 x i8] c"ABCdefGhI\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = bitcast [10 x i8]* %2 to i8*
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @squeeze(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"aBCDEFghi\00"
@.str = [10 x i8] c"ABCdefGhI\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @squeeze(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
void signed_char_mul_signed_char_signed_int(signed char *LHS, signed int RHS) {
  (*LHS) *= RHS;
}


x86 assembly (clang, -O0):
<signed_char_mul_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
imul   %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_mul_signed_char_signed_int>:
mov    (%rdi),%al
mul    %sil
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_mul_signed_char_signed_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = mul nsw i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_mul_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = trunc i32 %1 to i8
%5 = mul i8 %3, %4
store i8 %5, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, int, size_t);
void *realloc(void *, size_t);
void *erealloc(void *ptr, size_t n) {
  void *p;
  p = realloc(ptr, n);
  if (p == NULL)
    eprintf("realloc of "
            "%zu"
            " bytes failed:",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/libcheck/check/refs/heads/master/src/"
            "check_error.c",
            74 - 2, n);
  return p;
}


x86 assembly (clang, -O0):
<erealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <erealloc+0x48>
mov    -0x10(%rbp),%rcx
lea    0xea9(%rip),%rdi
lea    0xebf(%rip),%rsi
mov    $0x48,%edx
call   1030 <eprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114f <erealloc+0x2f>
lea    0xec5(%rip),%rdi
lea    0xedb(%rip),%rsi
mov    $0x48,%edx
mov    %r14,%rcx
call   1030 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"realloc of %zu bytes failed:\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/libcheck/check/refs/heads/master/src/check_error.c\00"
define i8* @erealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i64, i64* %4
%13 = call i32 @eprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 72, i64 %12)
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [29 x i8] c"realloc of %zu bytes failed:\00"
@.str.1 = [141 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/libcheck/check/refs/heads/master/src/check_error.c\00"
define noalias i8* @erealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), i32 72, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int prv_test_bad_cases();
int prv_test_expressions();
int prv_test_let();
int prv_test_print();
int parser_test(void) {
  int failure = 0;
  failure |= prv_test_let();
  failure |= prv_test_print();
  failure |= prv_test_expressions();
  failure |= prv_test_bad_cases();
  return failure;
}


x86 assembly (clang, -O0):
<parser_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <prv_test_let@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <prv_test_print@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <prv_test_expressions@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <prv_test_bad_cases@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_test>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <prv_test_let@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <prv_test_print@plt>
mov    %eax,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <prv_test_expressions@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <prv_test_bad_cases@plt>
or     %ebx,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @parser_test() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @prv_test_let()
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = call i32 (...) @prv_test_print()
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = call i32 (...) @prv_test_expressions()
%9 = load i32, i32* %1
%10 = or i32 %9, %8
store i32 %10, i32* %1
%11 = call i32 (...) @prv_test_bad_cases()
%12 = load i32, i32* %1
%13 = or i32 %12, %11
store i32 %13, i32* %1
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @parser_test() {
%1 = tail call i32 (...) @prv_test_let()
%2 = tail call i32 (...) @prv_test_print()
%3 = or i32 %2, %1
%4 = tail call i32 (...) @prv_test_expressions()
%5 = or i32 %3, %4
%6 = tail call i32 (...) @prv_test_bad_cases()
%7 = or i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ yall_close_all();
void test_yall_close(void) { yall_close_all(); }


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

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

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

LLVM IR (-O2):
define void @test_yall_close() {
%1 = tail call i32 (...) @yall_close_all()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_assert(int);
void error(void) { test_assert(1); }


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

x86 assembly (clang, -O2):
<error>:
mov    $0x1,%edi
jmp    1030 <test_assert@plt>

LLVM IR (-O0):
define void @error() {
%1 = call i32 @test_assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @error() {
%1 = tail call i32 @test_assert(i32 1)
ret void
}
int line_detect() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @line_detect() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int const);
int main(void) {
  const int SZ = 10;
  int *p = malloc(SZ * sizeof(int));
  int *end = &p[SZ];
  while (p < end)
    *p++ = 0;
  free(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    $0x28,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1178 <main+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
jmp    1150 <main+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x28,%edi
call   1040 <malloc@plt>
xorps  %xmm0,%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movq   $0x0,0x20(%rax)
lea    0x28(%rax),%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
%5 = call i32* @malloc(i32 40)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 10
store i32* %7, i32** %4
br label %8
8: ; preds = %12, %0
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = icmp ult i32* %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i32 1
store i32* %14, i32** %3
store i32 0, i32* %13
br label %8
15: ; preds = %8
%16 = load i32*, i32** %3
%17 = call i32 @free(i32* %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 40)
%2 = bitcast i32* %1 to i8*
%3 = getelementptr i32, i32* %1, i64 10
%4 = tail call i32 @free(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _bad_return_address(int);
void bad_return_mmr(void) { _bad_return_address(0xFFC00014); }


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

x86 assembly (clang, -O2):
<bad_return_mmr>:
mov    $0xffc00014,%edi
jmp    1030 <_bad_return_address@plt>

LLVM IR (-O0):
define void @bad_return_mmr() {
%1 = call i32 @_bad_return_address(i32 -4194284)
ret void
}

LLVM IR (-O2):
define void @bad_return_mmr() {
%1 = tail call i32 @_bad_return_address(i32 -4194284)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hdate_is_hebrew_locale();
char *hdate_string(int /*<<< orphan*/, int const, int, int);
char *hdate_get_int_string(int const n) {
  char *dest;
  int hebrew_form = 1;
  if (!hdate_is_hebrew_locale())
    hebrew_form = 0;
  return hdate_string(0, n, 1, hebrew_form);
}


x86 assembly (clang, -O0):
<hdate_get_int_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
mov    $0x0,%al
call   1030 <hdate_is_hebrew_locale@plt>
cmp    $0x0,%eax
jne    1149 <hdate_get_int_string+0x29>
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x14(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <hdate_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdate_get_int_string>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <hdate_is_hebrew_locale@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
xor    %edi,%edi
mov    %ebx,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1040 <hdate_string@plt>

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

LLVM IR (-O2):
define i8* @hdate_get_int_string(i32 %0) {
%2 = tail call i32 (...) @hdate_is_hebrew_locale()
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i8* @hdate_string(i32 0, i32 %0, i32 1, i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handler() { exit(0); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @handler() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @handler() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int hello() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @hello() {
ret i32 1
}
unsigned int f10(unsigned int x, unsigned long int y) {
  return (x << y) | (x >> ((-y) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
mov    %rsi,%rcx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f10(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 0, %10
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = lshr i32 %9, %13
%15 = or i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f10(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = lshr i32 %0, %6
%8 = or i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
void f1() {
  static int i = 0;
  i++;
  printf("%p: i = %d\n", &i, i);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f09(%rip)
mov    0x2f03(%rip),%edx
lea    0xed0(%rip),%rdi
lea    0x2ef5(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0x2f15(%rip),%rsi
mov    0x2f0f(%rip),%edx
add    $0x1,%edx
mov    %edx,0x2f06(%rip)
lea    0xed3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@f1.i = internal global i32 0
@.str = [12 x i8] c"%p: i = %d\0A\00"
define void @f1() {
%1 = load i32, i32* @f1.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f1.i
%3 = load i32, i32* @f1.i
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* @f1.i, i32 %3)
ret void
}

LLVM IR (-O2):
@f1.i = internal global i32 0
@.str = [12 x i8] c"%p: i = %d\0A\00"
define void @f1() {
%1 = load i32, i32* @f1.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @f1.i
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* @f1.i, i32 %2)
ret void
}