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

/* Variables and functions */
scalar_t__ IPPROTO_TCP;
scalar_t__ packet_echoed_ip_protocol(struct packet *);
scalar_t__ packet_echoed_layer4_header(struct packet *);
struct tcp *packet_echoed_tcp_header(struct packet *packet) {
  if (packet_echoed_ip_protocol(packet) == IPPROTO_TCP)
    return (struct tcp *)(packet_echoed_layer4_header(packet));
  return NULL;
}


x86 assembly (clang, -O0):
<packet_echoed_tcp_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <packet_echoed_ip_protocol@plt>
mov    0x2eac(%rip),%rcx
cmp    (%rcx),%rax
jne    1157 <packet_echoed_tcp_header+0x37>
mov    -0x10(%rbp),%rdi
call   1030 <packet_echoed_layer4_header@plt>
mov    %rax,-0x8(%rbp)
jmp    115f <packet_echoed_tcp_header+0x3f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packet_echoed_tcp_header>:
push   %rbx
mov    %rdi,%rbx
call   1040 <packet_echoed_ip_protocol@plt>
mov    0x2eb8(%rip),%rcx
cmp    (%rcx),%rax
jne    113f <packet_echoed_tcp_header+0x1f>
mov    %rbx,%rdi
call   1030 <packet_echoed_layer4_header@plt>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tcp = type { i32 }
%struct.packet = type { i32 }
@IPPROTO_TCP = global i64 0
define %struct.tcp* @packet_echoed_tcp_header(%struct.packet* %0) {
%2 = alloca %struct.tcp*
%3 = alloca %struct.packet*
store %struct.packet* %0, %struct.packet** %3
%4 = load %struct.packet*, %struct.packet** %3
%5 = call i64 @packet_echoed_ip_protocol(%struct.packet* %4)
%6 = load i64, i64* @IPPROTO_TCP
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.packet*, %struct.packet** %3
%10 = call i64 @packet_echoed_layer4_header(%struct.packet* %9)
%11 = inttoptr i64 %10 to %struct.tcp*
store %struct.tcp* %11, %struct.tcp** %2
br label %13
12: ; preds = %1
store %struct.tcp* null, %struct.tcp** %2
br label %13
13: ; preds = %12, %8
%14 = load %struct.tcp*, %struct.tcp** %2
ret %struct.tcp* %14
}

LLVM IR (-O2):
%struct.tcp = type { i32 }
%struct.packet = type { i32 }
@IPPROTO_TCP = global i64 0
define %struct.tcp* @packet_echoed_tcp_header(%struct.packet* %0) {
%2 = tail call i64 @packet_echoed_ip_protocol(%struct.packet* %0)
%3 = load i64, i64* @IPPROTO_TCP
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i64 @packet_echoed_layer4_header(%struct.packet* %0)
%7 = inttoptr i64 %6 to %struct.tcp*
br label %8
8: ; preds = %1, %5
%9 = phi %struct.tcp* [ %7, %5 ], [ null, %1 ]
ret %struct.tcp* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ __jmp_buf;

/* Variables and functions */
int __dummy(int /*<<< orphan*/, int /*<<< orphan*/);
int __my_setjmp(__jmp_buf buf) { return __dummy(buf, 0); }


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

x86 assembly (clang, -O2):
<__my_setjmp>:
xor    %esi,%esi
jmp    1030 <__dummy@plt>

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

LLVM IR (-O2):
define i32 @__my_setjmp(i32 %0) {
%2 = tail call i32 @__dummy(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int get_export(char const *, void **);
void *get_export_address(const char *name) {
  void *address;
  if (get_export(name, &address) != -1)
    return address;
  return NULL;
}


x86 assembly (clang, -O0):
<get_export_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <get_export@plt>
cmp    $0xffffffff,%eax
je     113f <get_export_address+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1147 <get_export_address+0x37>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_export_address>:
push   %rax
mov    %rsp,%rsi
call   1030 <get_export@plt>
cmp    $0xffffffff,%eax
je     1124 <get_export_address+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i8* @get_export_address(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @get_export(i8* %0, i8** %2)
%5 = icmp eq i32 %4, -1
%6 = load i8*, i8** %2
%7 = select i1 %5, i8* null, i8* %6
ret i8* %7
}
int dBtoSig() { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ SwapByteOrder_64(int /*<<< orphan*/);
void bswap_64(const int n, void *u) {
  uint64_t *T = u;
  int i;
  for (i = 0; i < n; i++) {
    *(T + i) = SwapByteOrder_64(*(T + i));
  }
  return;
}


x86 assembly (clang, -O0):
<bswap_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1165 <bswap_64+0x55>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <SwapByteOrder_64@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <bswap_64+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_64>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
jle    1146 <bswap_64+0x36>
mov    %rsi,%r15
mov    %edi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1030 <SwapByteOrder_64@plt>
mov    %eax,(%r15,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <bswap_64+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @bswap_64(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @SwapByteOrder_64(i32 %10)
store i32 %11, i32* %9
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
int remove(char *);
int util_deletefile(char *filename) { return remove(filename); }


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

x86 assembly (clang, -O2):
<util_deletefile>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @util_deletefile(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
__attribute__((always_)) void arch_alloc_page(struct page *page, int order) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @arch_alloc_page(%struct.page* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_json_indent(FILE *file, int level) {
  for (int i = 0; i < level; i++) {
    fprintf(file, " ");
  }
}


x86 assembly (clang, -O0):
<write_json_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1150 <write_json_indent+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <write_json_indent+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_json_indent>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <write_json_indent+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <write_json_indent+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @write_json_indent(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @fputc(i32 32, i32* %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int mapcon_number_of_maps(int dim, int *nbmaps) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(434, &dim, nbmaps, c);
  return fail;
}


x86 assembly (clang, -O0):
<mapcon_number_of_maps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1b2,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapcon_number_of_maps>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1b2,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mapcon_number_of_maps(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc(i32 434, i32* %3, i32* %7, double* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @mapcon_number_of_maps(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 434, i32* %3, i32* %1, double* undef)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void f(char *src) {
  char dst[2];
  strcpy(dst, src);
}


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

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    %rdi,%rsi
lea    0x6(%rsp),%rdi
call   1030 <strcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @f(i8* %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BasicIOInit();
int /*<<< orphan*/ HeapInit(int);
int /*<<< orphan*/ IncludeInit();
int /*<<< orphan*/ LexInit();
int /*<<< orphan*/ LibraryInit();
int /*<<< orphan*/ PlatformLibraryInit();
int /*<<< orphan*/ TableInit();
int /*<<< orphan*/ TypeInit();
int /*<<< orphan*/ VariableInit();
void PicocInitialise(int StackSize) {
  BasicIOInit();
  HeapInit(StackSize);
  TableInit();
  VariableInit();
  LexInit();
  TypeInit();
  IncludeInit();
  LibraryInit();
  PlatformLibraryInit();
}


x86 assembly (clang, -O0):
<PicocInitialise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1080 <BasicIOInit@plt>
mov    -0x4(%rbp),%edi
call   1090 <HeapInit@plt>
mov    $0x0,%al
call   1070 <TableInit@plt>
mov    $0x0,%al
call   1050 <VariableInit@plt>
mov    $0x0,%al
call   10b0 <LexInit@plt>
mov    $0x0,%al
call   10a0 <TypeInit@plt>
mov    $0x0,%al
call   1060 <IncludeInit@plt>
mov    $0x0,%al
call   1040 <LibraryInit@plt>
mov    $0x0,%al
call   1030 <PlatformLibraryInit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PicocInitialise>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1080 <BasicIOInit@plt>
mov    %ebx,%edi
call   1090 <HeapInit@plt>
xor    %eax,%eax
call   1070 <TableInit@plt>
xor    %eax,%eax
call   1050 <VariableInit@plt>
xor    %eax,%eax
call   10b0 <LexInit@plt>
xor    %eax,%eax
call   10a0 <TypeInit@plt>
xor    %eax,%eax
call   1060 <IncludeInit@plt>
xor    %eax,%eax
call   1040 <LibraryInit@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <PlatformLibraryInit@plt>

LLVM IR (-O0):
define void @PicocInitialise(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @BasicIOInit()
%4 = load i32, i32* %2
%5 = call i32 @HeapInit(i32 %4)
%6 = call i32 (...) @TableInit()
%7 = call i32 (...) @VariableInit()
%8 = call i32 (...) @LexInit()
%9 = call i32 (...) @TypeInit()
%10 = call i32 (...) @IncludeInit()
%11 = call i32 (...) @LibraryInit()
%12 = call i32 (...) @PlatformLibraryInit()
ret void
}

LLVM IR (-O2):
define void @PicocInitialise(i32 %0) {
%2 = tail call i32 (...) @BasicIOInit()
%3 = tail call i32 @HeapInit(i32 %0)
%4 = tail call i32 (...) @TableInit()
%5 = tail call i32 (...) @VariableInit()
%6 = tail call i32 (...) @LexInit()
%7 = tail call i32 (...) @TypeInit()
%8 = tail call i32 (...) @IncludeInit()
%9 = tail call i32 (...) @LibraryInit()
%10 = tail call i32 (...) @PlatformLibraryInit()
ret void
}
void ptrace_sandbox_permit_rename(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_rename(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ lerp(double, float, float);
float sqr(scalar_t__);
float fresnel(float fNDotV, float fresnelEffect) {
  return sqr(1.0 - lerp(0.0, fNDotV, fresnelEffect));
}


x86 assembly (clang, -O0):
<fresnel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm2
xorps  %xmm0,%xmm0
call   1040 <lerp@plt>
cvtsi2sd %rax,%xmm1
movsd  0xeaf(%rip),%xmm0
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <sqr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fresnel>:
push   %rax
movaps %xmm1,%xmm2
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
call   1040 <lerp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0xec1(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rdi
pop    %rax
jmp    1030 <sqr@plt>

LLVM IR (-O0):
define float @fresnel(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 = load float, float* %4
%7 = call i64 @lerp(double 0.000000e+00, float %5, float %6)
%8 = sitofp i64 %7 to double
%9 = fsub double 1.000000e+00, %8
%10 = fptosi double %9 to i64
%11 = call float @sqr(i64 %10)
ret float %11
}

LLVM IR (-O2):
define float @fresnel(float %0, float %1) {
%3 = tail call i64 @lerp(double 0.000000e+00, float %0, float %1)
%4 = sitofp i64 %3 to double
%5 = fsub double 1.000000e+00, %4
%6 = fptosi double %5 to i64
%7 = tail call float @sqr(i64 %6)
ret float %7
}
double logic_if(double a, double b, double c) { return a ? b : c; }


x86 assembly (clang, -O0):
<logic_if>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1130 <logic_if+0x30>
jp     1130 <logic_if+0x30>
jmp    113f <logic_if+0x3f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1149 <logic_if+0x49>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logic_if>:
xorpd  %xmm3,%xmm3
cmpneqsd %xmm3,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @logic_if(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fcmp une double %7, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load double, double* %5
br label %13
11: ; preds = %3
%12 = load double, double* %6
br label %13
13: ; preds = %11, %9
%14 = phi double [ %10, %9 ], [ %12, %11 ]
ret double %14
}

LLVM IR (-O2):
define double @logic_if(double %0, double %1, double %2) {
%4 = fcmp une double %0, 0.000000e+00
%5 = select i1 %4, double %1, double %2
ret double %5
}
/* Variables and functions */
double monotonic_time();
double monotonic_time_elapsed(double start_time) {
  return monotonic_time() - start_time;
}


x86 assembly (clang, -O0):
<monotonic_time_elapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <monotonic_time@plt>
subsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_time_elapsed>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <monotonic_time@plt>
subsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @monotonic_time_elapsed(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @monotonic_time()
%4 = load double, double* %2
%5 = fsub double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @monotonic_time_elapsed(double %0) {
%2 = tail call double (...) @monotonic_time()
%3 = fsub double %2, %0
ret double %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void mDelay(uint32_t i) {
  uint32_t j = 0;
  for (; i > 0; i--) {
    for (j = 0; j < 12000; j++)
      ;
  }
}


x86 assembly (clang, -O0):
<mDelay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    115d <mDelay+0x5d>
movq   $0x0,-0x10(%rbp)
cmpq   $0x2ee0,-0x10(%rbp)
jge    1147 <mDelay+0x47>
jmp    1136 <mDelay+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1123 <mDelay+0x23>
jmp    114c <mDelay+0x4c>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <mDelay+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @mDelay(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern const char *__progname;
  fprintf(stderr, "Usage: %s [-ak]\n", __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Usage: %s [-ak]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Usage: %s [-ak]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ DMA3_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void DMA3_IRQHandler(void) {
  DMA3_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA3_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @DMA3_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA3_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @DMA3_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int getSize(float *);
int /*<<< orphan*/ printf(char *, int, int);
void fig07_16() {
  float array[20];
  printf("The number of bytes in the array is %u."
         "\nThe number of bytes returned by getSize is %u.\n",
         sizeof(array), getSize(array));
}


x86 assembly (clang, -O0):
<fig07_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
call   1040 <getSize@plt>
mov    %eax,%edx
lea    0xec6(%rip),%rdi
mov    $0x50,%esi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig07_16>:
sub    $0x58,%rsp
mov    %rsp,%rdi
call   1040 <getSize@plt>
lea    0xecd(%rip),%rdi
mov    $0x50,%esi
mov    %eax,%edx
call   1030 <printf@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [88 x i8] c"The number of bytes in the array is %u.\0AThe number of bytes returned by getSize is %u.\0A\00"
define void @fig07_16() {
%1 = alloca [20 x float]
%2 = getelementptr inbounds [20 x float], [20 x float]* %1, i64 0, i64 0
%3 = call i32 @getSize(float* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i32 80, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [88 x i8] c"The number of bytes in the array is %u.\0AThe number of bytes returned by getSize is %u.\0A\00"
define void @fig07_16() {
%1 = alloca [20 x float]
%2 = bitcast [20 x float]* %1 to i8*
%3 = getelementptr inbounds [20 x float], [20 x float]* %1, i64 0, i64 0
%4 = call i32 @getSize(float* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([88 x i8], [88 x i8]* @.str, i64 0, i64 0), i32 80, i32 %4)
ret void
}
int fstat(int fd, struct stat *buf) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 0
}
double convertCToFDegree(double cDegree) { return 9.0 * cDegree / 5.0 + 32.0; }


x86 assembly (clang, -O0):
<convertCToFDegree>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeff(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertCToFDegree>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @convertCToFDegree(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 9.000000e+00, %3
%5 = fdiv double %4, 5.000000e+00
%6 = fadd double %5, 3.200000e+01
ret double %6
}

LLVM IR (-O2):
define double @convertCToFDegree(double %0) {
%2 = fmul double %0, 9.000000e+00
%3 = fdiv double %2, 5.000000e+00
%4 = fadd double %3, 3.200000e+01
ret double %4
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long millis(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec) * 1000L + (tv.tv_usec) / 1000L;
}


x86 assembly (clang, -O0):
<millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millis>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x10(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @millis() {
%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 i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sdiv i64 %7, 1000
%9 = add nsw i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @millis() {
%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 i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 1000
%10 = add nsw i64 %9, %6
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ alloc(int);
void *thread_task(void *arg) {
  int i;
  for (i = 0; i < 10; i++) {
    alloc(i + 1);
  }
}


x86 assembly (clang, -O0):
<thread_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1146 <thread_task+0x36>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1030 <alloc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <thread_task+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_task>:
push   %rax
mov    $0x1,%edi
call   1030 <alloc@plt>
mov    $0x2,%edi
call   1030 <alloc@plt>
mov    $0x3,%edi
call   1030 <alloc@plt>
mov    $0x4,%edi
call   1030 <alloc@plt>
mov    $0x5,%edi
call   1030 <alloc@plt>
mov    $0x6,%edi
call   1030 <alloc@plt>
mov    $0x7,%edi
call   1030 <alloc@plt>
mov    $0x8,%edi
call   1030 <alloc@plt>
mov    $0x9,%edi
call   1030 <alloc@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <alloc@plt>

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

LLVM IR (-O2):
define noalias i8* @thread_task(i8* nocapture readnone %0) {
%2 = tail call i32 @alloc(i32 1)
%3 = tail call i32 @alloc(i32 2)
%4 = tail call i32 @alloc(i32 3)
%5 = tail call i32 @alloc(i32 4)
%6 = tail call i32 @alloc(i32 5)
%7 = tail call i32 @alloc(i32 6)
%8 = tail call i32 @alloc(i32 7)
%9 = tail call i32 @alloc(i32 8)
%10 = tail call i32 @alloc(i32 9)
%11 = tail call i32 @alloc(i32 10)
ret i8* undef
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test14(void) { return L'\n'; }


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

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

LLVM IR (-O0):
define i32 @test14() {
ret i32 10
}

LLVM IR (-O2):
define i32 @test14() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ testLargeInt();
int /*<<< orphan*/ testNegativeDouble();
int /*<<< orphan*/ testNegativeInt();
int /*<<< orphan*/ testNegativeLargeInt();
int /*<<< orphan*/ testNormalDouble();
int /*<<< orphan*/ testNormalInt();
int main(int argc, char *argv[]) {
  testNormalInt();
  testLargeInt();
  testNegativeInt();
  testNegativeLargeInt();
  testNormalDouble();
  testNegativeDouble();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <testNormalInt@plt>
mov    $0x0,%al
call   1080 <testLargeInt@plt>
mov    $0x0,%al
call   1030 <testNegativeInt@plt>
mov    $0x0,%al
call   1070 <testNegativeLargeInt@plt>
mov    $0x0,%al
call   1060 <testNormalDouble@plt>
mov    $0x0,%al
call   1050 <testNegativeDouble@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <testNormalInt@plt>
xor    %eax,%eax
call   1080 <testLargeInt@plt>
xor    %eax,%eax
call   1030 <testNegativeInt@plt>
xor    %eax,%eax
call   1070 <testNegativeLargeInt@plt>
xor    %eax,%eax
call   1060 <testNormalDouble@plt>
xor    %eax,%eax
call   1050 <testNegativeDouble@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testNormalInt()
%6 = call i32 (...) @testLargeInt()
%7 = call i32 (...) @testNegativeInt()
%8 = call i32 (...) @testNegativeLargeInt()
%9 = call i32 (...) @testNormalDouble()
%10 = call i32 (...) @testNegativeDouble()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testNormalInt()
%4 = tail call i32 (...) @testLargeInt()
%5 = tail call i32 (...) @testNegativeInt()
%6 = tail call i32 (...) @testNegativeLargeInt()
%7 = tail call i32 (...) @testNormalDouble()
%8 = tail call i32 (...) @testNegativeDouble()
ret i32 0
}
void startAppendOnly(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               128, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<startAppendOnly>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x80,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<startAppendOnly>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x80,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.startAppendOnly = [16 x i8] c"startAppendOnly\00"
define void @startAppendOnly() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.startAppendOnly, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.startAppendOnly = [16 x i8] c"startAppendOnly\00"
define void @startAppendOnly() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 128, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.startAppendOnly, i64 0, i64 0))
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, unsigned short);
void RNDResponseSink_RenderingControl_GetColorTemperature(
    struct UPnPService *Service, int ErrorCode, void *User,
    unsigned short CurrentColorTemperature) {
  printf("RND Invoke Response: "
         "RenderingControl/GetColorTemperature[ErrorCode:%d](%u)\r\n",
         ErrorCode, CurrentColorTemperature);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_GetColorTemperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ax,-0x1a(%rbp)
mov    -0xc(%rbp),%esi
lea    0xecc(%rip),%rdi
movzwl -0x1a(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/GetColorTemperature[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetColorTemperature(%struct.UPnPService* %0, i32 %1, i8* %2, i16 zeroext %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i16
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i16 %3, i16* %8
%9 = load i32, i32* %6
%10 = load i16, i16* %8
%11 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %9, i16 zeroext %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [78 x i8] c"RND Invoke Response: RenderingControl/GetColorTemperature[ErrorCode:%d](%u)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_GetColorTemperature(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i16 zeroext %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), i32 %1, i16 zeroext %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void func(void *ptr, int size) {
  if (size == 4) {
    *((int *)ptr) = 123;
  } else if (size > 8) {
    strcpy((char *)ptr, "ABCDE");
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    1138 <func+0x28>
mov    -0x8(%rbp),%rax
movl   $0x7b,(%rax)
jmp    1157 <func+0x47>
cmpl   $0x8,-0xc(%rbp)
jle    1152 <func+0x42>
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1157 <func+0x47>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
cmp    $0x4,%esi
jne    111c <func+0xc>
movl   $0x7b,(%rdi)
ret
cmp    $0x9,%esi
jl     112d <func+0x1d>
lea    0xed8(%rip),%rsi
jmp    1030 <strcpy@plt>
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ABCDE\00"
define void @func(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 = icmp eq i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
store i32 123, i32* %9
br label %17
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 8
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %13, %10
br label %17
17: ; preds = %16, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ABCDE\00"
define void @func(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 4
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = bitcast i8* %0 to i32*
store i32 123, i32* %5
br label %10
6: ; preds = %2
%7 = icmp sgt i32 %1, 8
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %8, %4
ret void
}
/* Variables and functions */
int strlen(char s[]) {
  int i = 0;
  while (s[i] != '\0')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <strlen+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
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 i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int rand();
unsigned int rand_range(int start, int stop) {
  return (rand() % (stop - 1 - start)) + start;
}


x86 assembly (clang, -O0):
<rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
mov    %ebp,%ecx
not    %ecx
add    %ebx,%ecx
cltd
idiv   %ecx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rand_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = xor i32 %0, -1
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
int test_imm_45int16_reg(short val) {
  return ((val) & (-0x45 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_45int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffbb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_45int16_reg>:
test   $0xffbb,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_45int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -69
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_45int16_reg(i16 signext %0) {
%2 = and i16 %0, -69
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void g_type_create_instance() {}


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

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

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

LLVM IR (-O2):
define void @g_type_create_instance() {
ret void
}
__attribute__((weak)) void WDT_IrqHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define weak void @WDT_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int nogr_key_from_name(const char *str) {
  int k = 0, shf = 0;
  while (*str) {
    k |= *str << shf;
    shf += 8;
    str++;
  }
  return k;
}


x86 assembly (clang, -O0):
<nogr_key_from_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <nogr_key_from_name+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1116 <nogr_key_from_name+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nogr_key_from_name>:
mov    (%rdi),%dl
test   %dl,%dl
je     1126 <nogr_key_from_name+0x26>
add    $0x1,%rdi
xor    %ecx,%ecx
xor    %eax,%eax
xchg   %ax,%ax
movsbl %dl,%edx
shl    %cl,%edx
or     %edx,%eax
add    $0x8,%ecx
movzbl (%rdi),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1110 <nogr_key_from_name+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @nogr_key_from_name(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = phi i8* [ %13, %4 ], [ %0, %1 ]
%9 = sext i8 %5 to i32
%10 = shl i32 %9, %6
%11 = or i32 %10, %7
%12 = add nuw nsw i32 %6, 8
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
int wrapper(int, char const *, char *const *, int /*<<< orphan*/ *);
int execvp(const char *__path, char *const __argv[]) {
  return wrapper(2, __path, __argv, NULL);
}


x86 assembly (clang, -O0):
<execvp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <wrapper@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execvp>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2,%edi
xor    %ecx,%ecx
jmp    1030 <wrapper@plt>

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

LLVM IR (-O2):
define i32 @execvp(i8* %0, i8** %1) {
%3 = tail call i32 @wrapper(i32 2, i8* %0, i8** %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_97C241(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_97C241() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}