xunge/DecIR huggingface dataset:
/* Variables and functions */
int BGBDT_MM_QHashName(char *);
int BGBDT_MapObj_HashNameSig(char *name, char *sig, char *flsig) {
  int hi;
  hi = BGBDT_MM_QHashName(name);
  return (hi);
}


x86 assembly (clang, -O0):
<BGBDT_MapObj_HashNameSig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <BGBDT_MM_QHashName@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BGBDT_MapObj_HashNameSig>:
jmp    1030 <BGBDT_MM_QHashName@plt>

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

LLVM IR (-O2):
define i32 @BGBDT_MapObj_HashNameSig(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @BGBDT_MM_QHashName(i8* %0)
ret i32 %4
}
OP(fd, b8) {
  illegal_1();
  op_b8();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_b8@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <op_b8@plt>

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b8()
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int get16be(struct buffer *);
uint32_t get32be(struct buffer *input) {
  uint32_t ret;
  ret = get16be(input) << 16;
  ret |= get16be(input);
  return ret;
}


x86 assembly (clang, -O0):
<get32be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get16be@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get16be@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32be>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get16be@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
mov    %rbx,%rdi
call   1030 <get16be@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @get32be(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
%3 = alloca i32
store %struct.buffer* %0, %struct.buffer** %2
%4 = load %struct.buffer*, %struct.buffer** %2
%5 = call i32 @get16be(%struct.buffer* %4)
%6 = shl i32 %5, 16
store i32 %6, i32* %3
%7 = load %struct.buffer*, %struct.buffer** %2
%8 = call i32 @get16be(%struct.buffer* %7)
%9 = load i32, i32* %3
%10 = or i32 %9, %8
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @get32be(%struct.buffer* %0) {
%2 = tail call i32 @get16be(%struct.buffer* %0)
%3 = shl i32 %2, 16
%4 = tail call i32 @get16be(%struct.buffer* %0)
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
char *strncat(char *restrict dest, const char *restrict src, size_t n) {
  return dest;
}


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

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

LLVM IR (-O0):
define i8* @strncat(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
ret i8* %7
}

LLVM IR (-O2):
define i8* @strncat(i8* noalias readnone returned %0, i8* noalias nocapture readnone %1, i64 %2) {
ret i8* %0
}
unsigned int djb2_hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = (unsigned char)*str++))
    hash = ((hash << 5) + hash) + c;
  return hash % 2357207;
}


x86 assembly (clang, -O0):
<djb2_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <djb2_hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <djb2_hash+0x10>
mov    -0x10(%rbp),%rax
mov    $0x23f7d7,%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2_hash>:
mov    (%rdi),%al
test   %al,%al
je     114a <djb2_hash+0x4a>
add    $0x1,%rdi
mov    $0x1505,%ecx
nop
mov    %rcx,%rdx
shl    $0x5,%rdx
add    %rcx,%rdx
movzbl %al,%ecx
add    %rdx,%rcx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <djb2_hash+0x10>
movabs $0x38f0764896d7bf4b,%rdx
76 f0 38
mov    %rcx,%rax
mul    %rdx
shr    $0x13,%rdx
imul   $0x23f7d7,%edx,%eax
sub    %eax,%ecx
mov    %ecx,%eax
ret
mov    $0x1505,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @djb2_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i64 %11, 2357207
%16 = trunc i64 %15 to i32
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 5381, %1 ], [ %16, %14 ]
ret i32 %18
}
signed char signedchar_ignoring_shortint(signed char x, short int y) {
  return x;
}


x86 assembly (clang, -O0):
<signedchar_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @signedchar_ignoring_shortint(i8 signext %0, i16 signext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @signedchar_ignoring_shortint(i8 returned signext %0, i16 signext %1) {
ret i8 %0
}
/* Type definitions */
struct fdrecorder {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fdrecorder_poll(struct fdrecorder *);
void fdrecorder_sigio_callback(void *data) {
  fdrecorder_poll((struct fdrecorder *)data);
}


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

x86 assembly (clang, -O2):
<fdrecorder_sigio_callback>:
jmp    1030 <fdrecorder_poll@plt>

LLVM IR (-O0):
%struct.fdrecorder = type { i32 }
define void @fdrecorder_sigio_callback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.fdrecorder*
%5 = call i32 @fdrecorder_poll(%struct.fdrecorder* %4)
ret void
}

LLVM IR (-O2):
%struct.fdrecorder = type { i32 }
define void @fdrecorder_sigio_callback(i8* %0) {
%2 = bitcast i8* %0 to %struct.fdrecorder*
%3 = tail call i32 @fdrecorder_poll(%struct.fdrecorder* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ get_result(struct chirp_client *, int /*<<< orphan*/);
int64_t chirp_client_swrite_finish(struct chirp_client *c, int64_t fd,
                                   const void *buffer, int64_t length,
                                   int64_t stride_length, int64_t stride_skip,
                                   int64_t offset, time_t stoptime) {
  return get_result(c, stoptime);
}


x86 assembly (clang, -O0):
<chirp_client_swrite_finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x18(%rbp),%esi
call   1030 <get_result@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_swrite_finish>:
mov    0x10(%rsp),%esi
jmp    1030 <get_result@plt>

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
define i32 @chirp_client_swrite_finish(%struct.chirp_client* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca %struct.chirp_client*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store %struct.chirp_client* %0, %struct.chirp_client** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load %struct.chirp_client*, %struct.chirp_client** %9
%18 = load i32, i32* %16
%19 = call i32 @get_result(%struct.chirp_client* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
define i32 @chirp_client_swrite_finish(%struct.chirp_client* %0, i32 %1, i8* nocapture readnone %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i32 @get_result(%struct.chirp_client* %0, i32 %7)
ret i32 %9
}
unsigned int strhash(const char *str) {
  unsigned int c, hash = ((unsigned int)0x811c9dc5);
  while ((c = (unsigned char)*str++))
    hash = (hash * ((unsigned int)0x01000193)) ^ c;
  return hash;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x811c9dc5,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     113f <strhash+0x3f>
imul   $0x1000193,-0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    110f <strhash+0xf>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1127 <strhash+0x27>
add    $0x1,%rdi
mov    $0x811c9dc5,%eax
nop
movzbl %cl,%ecx
imul   $0x1000193,%eax,%eax
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
mov    $0x811c9dc5,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ -2128831035, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = mul i32 %6, 16777619
%11 = xor i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ -2128831035, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long window;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xreparent.window = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xreparent_window(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XCreateWindowEvent;

/* Variables and functions */
int get_XCreateWindowEvent_type(void *_p) {
  return (int)((XCreateWindowEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCreateWindowEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCreateWindowEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void metal_cache_flush(void *addr, unsigned int len) {
  (void)addr;
  (void)len;
  return;
}


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

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

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

LLVM IR (-O2):
define void @metal_cache_flush(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void ipc(void) {
  printf("File: %s Line: %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/hoastyle/Makefile-Tutorial/refs/heads/"
         "master/src/ipc/ipc.c",
         5);
}


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

x86 assembly (clang, -O2):
<ipc>:
lea    0xee9(%rip),%rdi
lea    0xef5(%rip),%rsi
mov    $0x5,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"File: %s Line: %d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hoastyle/Makefile-Tutorial/refs/heads/master/src/ipc/ipc.c\00"
define void @ipc() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"File: %s Line: %d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/hoastyle/Makefile-Tutorial/refs/heads/master/src/ipc/ipc.c\00"
define void @ipc() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
char *fgets_or_exit(char *buffer, int size, FILE *stream) {
  if (fgets(buffer, size, stream) == NULL) {
    exit(0);
  } else {
    return buffer;
  }
}


x86 assembly (clang, -O0):
<fgets_or_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <fgets@plt>
cmp    $0x0,%rax
jne    1154 <fgets_or_exit+0x34>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgets_or_exit>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fgets@plt>
test   %rax,%rax
je     1133 <fgets_or_exit+0x13>
mov    %rbx,%rax
pop    %rbx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i8* @fgets_or_exit(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32* @fgets(i8* %7, i32 %8, i32* %9)
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @exit(i32 0)
unreachable
14: ; preds = %3
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @fgets_or_exit(i8* returned %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32* @fgets(i8* %0, i32 %1, i32* %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 0)
unreachable
8: ; preds = %3
ret i8* %0
}
int test9(int x) { return x / -10 > 2; }


x86 assembly (clang, -O0):
<test9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xfffffff6,%ecx
cltd
idiv   %ecx
cmp    $0x2,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test9>:
xor    %eax,%eax
cmp    $0xffffffe3,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @test9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, -10
%5 = icmp sgt i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test9(i32 %0) {
%2 = icmp slt i32 %0, -29
%3 = zext i1 %2 to i32
ret i32 %3
}
extern unsigned short get_fs_word(const unsigned short *addr) {
  unsigned short _v;
  __asm__("movw %%fs:%1,%0" : "=q"(_v) : "m"(*addr));
  return _v;
}


x86 assembly (clang, -O0):
<get_fs_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%rax),%ax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs_word>:
mov    %fs:(%rdi),%ax
ret

LLVM IR (-O0):
define zeroext i16 @get_fs_word(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = call i16 asm "movw %fs:$1,$0", "=q,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @get_fs_word(i16* %0) {
%2 = tail call i16 asm "movw %fs:$1,$0", "=q,*m,~{dirflag},~{fpsr},~{flags}"(i16* elementtype(i16) %0)
ret i16 %2
}
unsigned char rotor_encipher(unsigned char n, unsigned char position,
                             const unsigned char *encode_array) {
  n = (n + position) % 26;
  n = encode_array[n];
  n = n - position;
  if (n > 25) {
    n += 26;
  }
  return n;
}


x86 assembly (clang, -O0):
<rotor_encipher>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
mov    $0x1a,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0x1(%rbp)
mov    -0x10(%rbp),%rax
movzbl -0x1(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sub    %ecx,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x19,%eax
jle    115d <rotor_encipher+0x5d>
movzbl -0x1(%rbp),%eax
add    $0x1a,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotor_encipher>:
add    %esi,%edi
imul   $0x4ec5,%edi,%eax
shr    $0x13,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rcx,%rcx,4),%ecx
add    %eax,%ecx
sub    %ecx,%edi
movzwl %di,%eax
mov    (%rdx,%rax,1),%al
sub    %sil,%al
lea    0x1a(%rax),%ecx
cmp    $0x1a,%al
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @rotor_encipher(i8 zeroext %0, i8 zeroext %1, i8* %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8*
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = srem i32 %11, 26
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = load i8*, i8** %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %4
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = sub nsw i32 %20, %22
%24 = trunc i32 %23 to i8
store i8 %24, i8* %4
%25 = load i8, i8* %4
%26 = zext i8 %25 to i32
%27 = icmp sgt i32 %26, 25
br i1 %27, label %28, label %33
28: ; preds = %3
%29 = load i8, i8* %4
%30 = zext i8 %29 to i32
%31 = add nsw i32 %30, 26
%32 = trunc i32 %31 to i8
store i8 %32, i8* %4
br label %33
33: ; preds = %28, %3
%34 = load i8, i8* %4
ret i8 %34
}

LLVM IR (-O2):
define zeroext i8 @rotor_encipher(i8 zeroext %0, i8 zeroext %1, i8* nocapture %2) {
%4 = zext i8 %0 to i16
%5 = zext i8 %1 to i16
%6 = add nuw nsw i16 %5, %4
%7 = urem i16 %6, 26
%8 = zext i16 %7 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = load i8, i8* %9
%11 = sub i8 %10, %1
%12 = icmp ugt i8 %11, 25
%13 = add i8 %11, 26
%14 = select i1 %12, i8 %13, i8 %11
ret i8 %14
}
void ARGBAddRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAddRow_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_print(char *);
int si(int argc, char *argv[]) {
  if (argc != 1) {
    console_print("usage: 'si [file]'\n");
  } else {
  }
}


x86 assembly (clang, -O0):
<si>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     113a <si+0x2a>
lea    0xed0(%rip),%rdi
call   1030 <console_print@plt>
jmp    113f <si+0x2f>
jmp    113f <si+0x2f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si>:
cmp    $0x1,%edi
je     1126 <si+0x16>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <console_print@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
@.str = [20 x i8] c"usage: 'si [file]'\0A\00"
define i32 @si(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @console_print(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %2, %4
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int sblat3_() {
  MAIN__();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sblat3_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @sblat3_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
void outport2(int port, int index, int data) {
  __asm__ volatile("movb %0,%%ah; movb %1,%%al; outw %%ax,%2"
                   :
                   : "qmi"((unsigned char)data), "qmi"((unsigned char)index),
                     "d"((unsigned short)port)
                   : "eax");
}


x86 assembly (clang, -O0):
<outport2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%edx
mov    %cl,-0xd(%rbp)
mov    %al,-0xe(%rbp)
mov    -0xd(%rbp),%ah
mov    -0xe(%rbp),%al
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @outport2(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* %6
%8 = trunc i32 %7 to i8
%9 = load i32, i32* %5
%10 = trunc i32 %9 to i8
%11 = load i32, i32* %4
%12 = trunc i32 %11 to i16
ret void
}

LLVM IR (-O2):
void XtIsSubclass() {}


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

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

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

LLVM IR (-O2):
define void @XtIsSubclass() {
ret void
}
/* Variables and functions */
scalar_t__ g_malloc(int, int /*<<< orphan*/);
int /*<<< orphan*/ g_strcpy(char *, char const *);
int g_strlen(char const *);
char *g_strdup(const char *in) {
  int len;
  char *p;
  if (in == 0) {
    return 0;
  }
  len = g_strlen(in);
  p = (char *)g_malloc(len + 1, 0);
  if (p != 0) {
    g_strcpy(p, in);
  }
  return p;
}


x86 assembly (clang, -O0):
<g_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <g_strdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1191 <g_strdup+0x61>
mov    -0x10(%rbp),%rdi
call   1040 <g_strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
xor    %esi,%esi
call   1030 <g_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1189 <g_strdup+0x59>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <g_strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_strdup>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     1160 <g_strdup+0x30>
mov    %rdi,%r14
call   1040 <g_strlen@plt>
lea    0x1(%rax),%edi
xor    %esi,%esi
call   1030 <g_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1162 <g_strdup+0x32>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <g_strcpy@plt>
jmp    1162 <g_strdup+0x32>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @g_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @g_strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = tail call i64 @g_malloc(i32 %5, i32 0)
%7 = inttoptr i64 %6 to i8*
%8 = icmp eq i64 %6, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @g_strcpy(i8* %7, i8* %0)
br label %11
11: ; preds = %3, %9, %1
%12 = phi i8* [ null, %1 ], [ %7, %9 ], [ %7, %3 ]
ret i8* %12
}
void timer_init(void) {
  if (0 == 1) {
    *(volatile unsigned *)0x0A00000C = ~0;
    *(volatile unsigned *)0x0A800008 = 0;
    *(volatile unsigned *)0x0A80000C = 0;
  } else {
    *(volatile unsigned *)0x03ff6000 = 0;
    *(volatile unsigned *)0x03ff4004 = 0x00000000;
  }
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ff6000,%eax
movl   $0x0,(%rax)
mov    $0x3ff4004,%eax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
movl   $0x0,0x3ff6000
movl   $0x0,0x3ff4004
ret

LLVM IR (-O0):
define void @timer_init() {
store volatile i32 0, i32* inttoptr (i64 67067904 to i32*)
store volatile i32 0, i32* inttoptr (i64 67059716 to i32*)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
store volatile i32 0, i32* inttoptr (i64 67067904 to i32*)
store volatile i32 0, i32* inttoptr (i64 67059716 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello\n");
  getchar();
  printf("world\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
@str.2 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int are_equal_double(const void *a, const void *b) {
  return *(double *)a == *(double *)b;
}


x86 assembly (clang, -O0):
<are_equal_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<are_equal_double>:
movsd  (%rsi),%xmm0
cmpeqsd (%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @are_equal_double(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp oeq double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @are_equal_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
char *copy_of(s)
register char *s;
{
  register char *p = (char *)malloc(strlen(s) + 1);
  if (!p)
    return 0;
  *p = 0;
  strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<copy_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <copy_of+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1189 <copy_of+0x59>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_of>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115b <copy_of+0x2b>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copy_of(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %1
store i8* null, i8** %2
br label %18
12: ; preds = %1
%13 = load i8*, i8** %4
store i8 0, i8* %13
%14 = load i8*, i8** %4
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %18
18: ; preds = %12, %11
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @copy_of(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
store i8 0, i8* %4
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isodigit(int);
void t_isodigit_0x30() {
  Assert_real((isodigit(48)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              245, ("isodigit should be 1 for 0"));
}


x86 assembly (clang, -O0):
<t_isodigit_0x30>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1040 <isodigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xf5,%edx
lea    0xf66(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0x30>:
push   %rax
mov    $0x30,%edi
call   1040 <isodigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0xf5,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 0\00"
define void @t_isodigit_0x30() {
%1 = call i32 @isodigit(i32 48)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 1 for 0\00"
define void @t_isodigit_0x30() {
%1 = tail call i32 @isodigit(i32 48)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ test(int);
int main() {
  int num = 25;
  printf("Example of \"Pass by Value\" in Functions\n\n");
  printf("num=%d\n\n", num);
  test(num);
  printf("num=%d\n\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x19,-0x8(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <test@plt>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x19,%edi
call   1050 <test@plt>
mov    %rbx,%rdi
mov    $0x19,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Example of \22Pass by Value\22 in Functions\0A\0A\00"
@.str.1 = [9 x i8] c"num=%d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 25, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @test(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"num=%d\0A\0A\00"
@str = [41 x i8] c"Example of \22Pass by Value\22 in Functions\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 25)
%3 = tail call i32 @test(i32 25)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 25)
ret i32 0
}
void unit_work(void) {
  int i;
  for (i = 0; i < 100; i++)
    ;
}


x86 assembly (clang, -O0):
<unit_work>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1128 <unit_work+0x28>
jmp    111a <unit_work+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <unit_work+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unit_work() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @unit_work() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ k_core_dump();
int /*<<< orphan*/ kmem_check_leak();
int /*<<< orphan*/ kmem_check_start();
int /*<<< orphan*/ kmem_check_stop();
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ test_echo_server();
int main() {
  mtrace();
  k_core_dump();
  kmem_check_start();
  test_echo_server();
  getchar();
  kmem_check_leak();
  getchar();
  kmem_check_stop();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1090 <mtrace@plt>
mov    $0x0,%al
call   1070 <k_core_dump@plt>
mov    $0x0,%al
call   1080 <kmem_check_start@plt>
mov    $0x0,%al
call   1050 <test_echo_server@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1030 <kmem_check_leak@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1040 <kmem_check_stop@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <mtrace@plt>
xor    %eax,%eax
call   1070 <k_core_dump@plt>
xor    %eax,%eax
call   1080 <kmem_check_start@plt>
xor    %eax,%eax
call   1050 <test_echo_server@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1030 <kmem_check_leak@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1040 <kmem_check_stop@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mtrace()
%3 = call i32 (...) @k_core_dump()
%4 = call i32 (...) @kmem_check_start()
%5 = call i32 (...) @test_echo_server()
%6 = call i32 (...) @getchar()
%7 = call i32 (...) @kmem_check_leak()
%8 = call i32 (...) @getchar()
%9 = call i32 (...) @kmem_check_stop()
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
%2 = tail call i32 (...) @k_core_dump()
%3 = tail call i32 (...) @kmem_check_start()
%4 = tail call i32 (...) @test_echo_server()
%5 = tail call i32 (...) @getchar()
%6 = tail call i32 (...) @kmem_check_leak()
%7 = tail call i32 (...) @getchar()
%8 = tail call i32 (...) @kmem_check_stop()
%9 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void caml_js_assoc_get() {
  fprintf(stderr, "Unimplemented Javascript primitive %s!\n",
          "caml_js_assoc_get");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Unimplemented Javascript primitive %s!\0A\00"
@.str.1 = [18 x i8] c"caml_js_assoc_get\00"
define void @caml_js_assoc_get() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Unimplemented Javascript primitive %s!\0A\00"
@.str.1 = [18 x i8] c"caml_js_assoc_get\00"
define void @caml_js_assoc_get() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void RTAvloIOPortGet(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvloIOPortGet() {
ret void
}
/* Type definitions */
struct _Locale_codecvt {
  int dummy;
};

/* Variables and functions */
int _WLocale_mb_cur_min(struct _Locale_codecvt *lcodecvt) { return 1; }


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

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

LLVM IR (-O0):
%struct._Locale_codecvt = type { i32 }
define i32 @_WLocale_mb_cur_min(%struct._Locale_codecvt* %0) {
%2 = alloca %struct._Locale_codecvt*
store %struct._Locale_codecvt* %0, %struct._Locale_codecvt** %2
ret i32 1
}

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i32 @_WLocale_mb_cur_min(%struct._Locale_codecvt* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ trace();
int main() { trace(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @trace()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @trace()
ret i32 0
}
int main(void) {
  int truth_value, true_value = 1, false_value = 0;
  truth_value = 0 || 1;
  truth_value = 0 && 1;
  truth_value = 1 && 0;
  truth_value = !truth_value;
  truth_value = false_value || true_value;
  truth_value = false_value && true_value;
  truth_value = true_value && false_value;
  truth_value = !truth_value;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jne    1158 <main+0x58>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x12(%rbp)
je     117c <main+0x7c>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x13(%rbp)
je     11a0 <main+0xa0>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
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 1, i32* %3
store i32 0, i32* %4
store i32 1, i32* %2
store i32 0, i32* %2
store i32 0, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %11, %0
%15 = phi i1 [ true, %0 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load i32, i32* %3
%21 = icmp ne i32 %20, 0
br label %22
22: ; preds = %19, %14
%23 = phi i1 [ false, %14 ], [ %21, %19 ]
%24 = zext i1 %23 to i32
store i32 %24, i32* %2
%25 = load i32, i32* %3
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i32, i32* %4
%29 = icmp ne i32 %28, 0
br label %30
30: ; preds = %27, %22
%31 = phi i1 [ false, %22 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
store i32 %32, i32* %2
%33 = load i32, i32* %2
%34 = icmp ne i32 %33, 0
%35 = xor i1 %34, true
%36 = zext i1 %35 to i32
store i32 %36, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *nsock_strerror(int code) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @nsock_strerror(i32 %0) {
ret i8* undef
}