xunge/DecIR huggingface dataset:
/* Type definitions */
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  scalar_t__ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int semop(int, struct sembuf *, int);
int spsem_release(int sem_id) {
  struct sembuf sem_buf;
  sem_buf.sem_num = 0;
  sem_buf.sem_op = 1;
  sem_buf.sem_flg = SEM_UNDO;
  if (semop(sem_id, &sem_buf, 1) == -1) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<spsem_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    115c <spsem_release+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <spsem_release+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spsem_release>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x1,0x8(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @spsem_release(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sembuf
store i32 %0, i32* %3
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 2
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 0
store i32 1, i32* %6
%7 = load i32, i32* @SEM_UNDO
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %4, i32 0, i32 1
store i32 %7, i32* %8
%9 = load i32, i32* %3
%10 = call i32 @semop(i32 %9, %struct.sembuf* %4, i32 1)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i64 }
@SEM_UNDO = global i32 0
define i32 @spsem_release(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 2
store i64 0, i64* %4
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 0
store i32 1, i32* %5
%6 = load i32, i32* @SEM_UNDO
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %2, i64 0, i32 1
store i32 %6, i32* %7
%8 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
%9 = icmp ne i32 %8, -1
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int16_t lte_int16_t(int16_t a, int16_t b) { return a <= b; }


x86 assembly (clang, -O0):
<lte_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lte_int16_t>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @lte_int16_t(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lte_int16_t(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int jet_strcasecmp(const char *s1, const char *s2) {
  return strcasecmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<jet_strcasecmp>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @jet_strcasecmp(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 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @jet_strcasecmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
void dlnaSetLogFileNames(const char *ErrFileName __attribute__((unused)),
                         const char *InfoFileName __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @dlnaSetLogFileNames(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int NoOp(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @NoOp() {
ret i32 0
}
__attribute__((always_)) void IOPinSet(int PortNo, int PinNo) {}


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

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

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

LLVM IR (-O2):
define void @IOPinSet(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int listen(int, int);
int mylisten(int sockfd, int backlog) { return listen(sockfd, backlog); }


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

x86 assembly (clang, -O2):
<mylisten>:
jmp    1030 <listen@plt>

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

LLVM IR (-O2):
define i32 @mylisten(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int copy_multprec_container_to_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(288, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_multprec_container_to_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x120,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_multprec_container_to_start_solutions>:
mov    $0x120,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @copy_multprec_container_to_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 288, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void *fn_ptr03(void (*pfn)(char *)) {
  pfn("fn_ptr03");
  return pfn;
}


x86 assembly (clang, -O0):
<fn_ptr03>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xeed(%rip),%rdi
call   *-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_ptr03>:
push   %rbx
mov    %rdi,%rbx
lea    0xef5(%rip),%rdi
call   *%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"fn_ptr03\00"
define i8* @fn_ptr03(void (i8*)* %0) {
%2 = alloca void (i8*)*
store void (i8*)* %0, void (i8*)** %2
%3 = load void (i8*)*, void (i8*)** %2
%4 = load void (i8*)*, void (i8*)** %2
%5 = bitcast void (i8*)* %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
@.str = [9 x i8] c"fn_ptr03\00"
define i8* @fn_ptr03(void (i8*)* %0) {
tail call void %0(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = bitcast void (i8*)* %0 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void pf() { printf("PF\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"PF\00"
define void @pf() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
struct netent *getnetent() {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<getnetent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    112b <getnetent+0x1b>

x86 assembly (clang, -O2):
<getnetent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <getnetent+0x20>

LLVM IR (-O0):
%struct.netent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getnetent = [10 x i8] c"getnetent\00"
define %struct.netent* @getnetent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.getnetent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
%struct.netent = type opaque
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.getnetent = [10 x i8] c"getnetent\00"
define %struct.netent* @getnetent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.getnetent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct timeval {
  unsigned int tv_sec;
  unsigned int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void millisleep(unsigned int milliseconds) {
  struct timeval timeval;
  timeval.tv_sec = milliseconds / 1000;
  timeval.tv_usec = (milliseconds % 1000) * 1000;
  select(0, NULL, NULL, NULL, &timeval);
}


x86 assembly (clang, -O0):
<millisleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
imul   $0x3e8,%edx,%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millisleep>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rax
shr    $0x26,%rax
mov    %eax,(%rsp)
imul   $0x3e8,%eax,%eax
sub    %eax,%edi
imul   $0x3e8,%edi,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @millisleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = urem i32 %7, 1000
%9 = mul i32 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @millisleep(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = udiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = urem i32 %0, 1000
%7 = mul nuw nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x3b() {
  Assert_real((iscntrl(59) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              300, ("iscntrl should be 0 for ;"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x3b>:
push   %rax
mov    $0x3b,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x12c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for ;\00"
define void @t_iscntrl_0x3b() {
%1 = call i64 @iscntrl(i32 59)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for ;\00"
define void @t_iscntrl_0x3b() {
%1 = tail call i64 @iscntrl(i32 59)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 300, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR79_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR79_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMR79_swap(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
%7 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMR79_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ read_long(char const *, long *);
int read_pid(const char *str, pid_t *pid) {
  long val;
  if (read_long(str, &val) != 0) {
    return -1;
  }
  *pid = (pid_t)val;
  return 0;
}


x86 assembly (clang, -O0):
<read_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <read_long@plt>
cmp    $0x0,%rax
je     1143 <read_pid+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <read_pid+0x45>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pid>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <read_long@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1139 <read_pid+0x29>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @read_pid(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @read_long(i8* %0, i64* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %3
store i64 %8, i64* %1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, char const *, int);
int plm_comm_write(int fd, const char *buf, int n) {
  int nw;
TRY:
  nw = write(fd, buf, n);
  if (nw < 0) {
    if (EINTR == errno)
      goto TRY;
  }
  return (nw);
}


x86 assembly (clang, -O0):
<plm_comm_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1162 <plm_comm_write+0x52>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
jne    115d <plm_comm_write+0x4d>
jmp    1122 <plm_comm_write+0x12>
jmp    1162 <plm_comm_write+0x52>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plm_comm_write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%r15
mov    0x2eb2(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    114a <plm_comm_write+0x3a>
mov    (%r15),%rcx
cmp    (%r12),%rcx
je     1130 <plm_comm_write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EINTR = global i64 0
@errno = global i64 0
define i32 @plm_comm_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %19, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %8
%16 = load i64, i64* @EINTR
%17 = load i64, i64* @errno
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15
br label %8
20: ; preds = %15
br label %21
21: ; preds = %20, %8
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@EINTR = global i64 0
@errno = global i64 0
define i32 @plm_comm_write(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %7, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i64, i64* @EINTR
%9 = load i64, i64* @errno
%10 = icmp eq i64 %8, %9
br i1 %10, label %4, label %11
11: ; preds = %7, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int get_epoch(time_t *epoch) {
  printf("Datum i vreme parkiranja: \n");
  time(epoch);
  puts(ctime(epoch));
  return 1;
}


x86 assembly (clang, -O0):
<get_epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <time@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ctime@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_epoch>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1040 <ctime@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Datum i vreme parkiranja: \0A\00"
define i32 @get_epoch(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = load i32*, i32** %2
%5 = call i32 @time(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @ctime(i32* %6)
%8 = call i32 @puts(i32 %7)
ret i32 1
}

LLVM IR (-O2):
@str = [27 x i8] c"Datum i vreme parkiranja: \00"
define i32 @get_epoch(i32* %0) {
%2 = tail call i32 bitcast (i32 (i32)* @puts to i32 (i8*)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @time(i32* %0)
%4 = tail call i32 @ctime(i32* %0)
%5 = tail call i32 @puts(i32 %4)
ret i32 1
}
void clrb(void *s, unsigned int i) {
  unsigned char *v = s;
  v += i >> 3;
  *v &= ~(1 << (7 - (i % 8)));
}


x86 assembly (clang, -O0):
<clrb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x3,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
mov    $0x7,%ecx
sub    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrb>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x3,%rax
not    %cl
and    $0x7,%cl
mov    $0x1,%edx
shl    %cl,%edx
not    %dl
and    %dl,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @clrb(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = lshr i32 %7, 3
%9 = load i8*, i8** %5
%10 = zext i32 %8 to i64
%11 = getelementptr inbounds i8, i8* %9, i64 %10
store i8* %11, i8** %5
%12 = load i32, i32* %4
%13 = urem i32 %12, 8
%14 = sub i32 7, %13
%15 = shl i32 1, %14
%16 = xor i32 %15, -1
%17 = load i8*, i8** %5
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, %16
%21 = trunc i32 %20 to i8
store i8 %21, i8* %17
ret void
}

LLVM IR (-O2):
define void @clrb(i8* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = and i32 %1, 7
%7 = xor i32 %6, 7
%8 = shl nuw i32 1, %7
%9 = load i8, i8* %5
%10 = trunc i32 %8 to i8
%11 = xor i8 %10, -1
%12 = and i8 %9, %11
store i8 %12, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumOfMultiples();
int main(void) {
  printf("%d\n", sumOfMultiples());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sumOfMultiples@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @sumOfMultiples()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void RTPathAppendEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTPathAppendEx() {
ret void
}
int test_imm_08uint8_reg(unsigned char val) {
  return ((val) & (-0x08 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_08uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xfffffff8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_08uint8_reg>:
cmp    $0x8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_08uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -8
%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_08uint8_reg(i8 zeroext %0) {
%2 = icmp ult i8 %0, 8
%3 = select i1 %2, i32 -40, i32 -20
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ bignum_bitwise_not(int /*<<< orphan*/);
int /*<<< orphan*/ dpeek();
int /*<<< orphan*/ drepl(int /*<<< orphan*/);
int /*<<< orphan*/ tag_bignum(int /*<<< orphan*/);
int /*<<< orphan*/ untag_object(int /*<<< orphan*/);
void primitive_bignum_not_impl(void) {
  drepl(tag_bignum(bignum_bitwise_not(untag_object(dpeek()))));
}


x86 assembly (clang, -O0):
<primitive_bignum_not_impl>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1050 <bignum_bitwise_not@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
call   1060 <drepl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<primitive_bignum_not_impl>:
push   %rax
xor    %eax,%eax
call   1030 <dpeek@plt>
mov    %eax,%edi
call   1040 <untag_object@plt>
mov    %eax,%edi
call   1050 <bignum_bitwise_not@plt>
mov    %eax,%edi
call   1070 <tag_bignum@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <drepl@plt>

LLVM IR (-O0):
define void @primitive_bignum_not_impl() {
%1 = call i32 (...) @dpeek()
%2 = call i32 @untag_object(i32 %1)
%3 = call i32 @bignum_bitwise_not(i32 %2)
%4 = call i32 @tag_bignum(i32 %3)
%5 = call i32 @drepl(i32 %4)
ret void
}

LLVM IR (-O2):
define void @primitive_bignum_not_impl() {
%1 = tail call i32 (...) @dpeek()
%2 = tail call i32 @untag_object(i32 %1)
%3 = tail call i32 @bignum_bitwise_not(i32 %2)
%4 = tail call i32 @tag_bignum(i32 %3)
%5 = tail call i32 @drepl(i32 %4)
ret void
}
void zone_span_writelock(struct zone *zone) {}


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define void @zone_span_writelock(%struct.zone* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_AVPHYS_PAGES;
size_t sysconf(int /*<<< orphan*/);
size_t gu_avphys_pages() { return sysconf(_SC_AVPHYS_PAGES); }


x86 assembly (clang, -O0):
<gu_avphys_pages>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gu_avphys_pages>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_AVPHYS_PAGES = global i32 0
define i64 @gu_avphys_pages() {
%1 = load i32, i32* @_SC_AVPHYS_PAGES
%2 = call i64 @sysconf(i32 %1)
ret i64 %2
}

LLVM IR (-O2):
@_SC_AVPHYS_PAGES = global i32 0
define i64 @gu_avphys_pages() {
%1 = load i32, i32* @_SC_AVPHYS_PAGES
%2 = tail call i64 @sysconf(i32 %1)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *const);
scalar_t__ malloc(int);
void buffer_overflow(void) {
  char *const memory = (char *)malloc(sizeof(int));
  memory[sizeof(int)] = '!';
  free(memory);
}


x86 assembly (clang, -O0):
<buffer_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x21,0x4(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_overflow>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
movb   $0x21,0x4(%rax)
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @buffer_overflow() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 4
store i8 33, i8* %5
%6 = load i8*, i8** %1
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @buffer_overflow() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 4
store i8 33, i8* %3
%4 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xd8() {
  Assert_real((isgraph(216) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              1085, ("isgraph should be 0 for 0xd8"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xd8>:
push   %rax
mov    $0xd8,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x43d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd8\00"
define void @t_isgraph_0xd8() {
%1 = call i64 @isgraph(i32 216)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xd8\00"
define void @t_isgraph_0xd8() {
%1 = tail call i64 @isgraph(i32 216)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1085, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimir_entero(void *dato) { printf("%d ", *((int *)dato)); }


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

x86 assembly (clang, -O2):
<imprimir_entero>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @imprimir_entero(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int save_binarydata_to_file_generic(char *, char const *, int, char *);
int save_binarydata_to_file(char *fileLocation, const char *dataToWrite,
                            int dataLength) {
  return save_binarydata_to_file_generic(fileLocation, dataToWrite, dataLength,
                                         "wb");
}


x86 assembly (clang, -O0):
<save_binarydata_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    0xecb(%rip),%rcx
call   1030 <save_binarydata_to_file_generic@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_binarydata_to_file>:
lea    0xee9(%rip),%rcx
jmp    1030 <save_binarydata_to_file_generic@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @save_binarydata_to_file(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @save_binarydata_to_file_generic(i8* %7, i8* %8, i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @save_binarydata_to_file(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @save_binarydata_to_file_generic(i8* %0, i8* %1, i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(unsigned int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
void fig10_07() {
  unsigned int x;
  printf("%s", "Enter a nonnegative int: \n");
  scanf("%u", &x);
  displayBits(x);
}


x86 assembly (clang, -O0):
<fig10_07>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xebd(%rip),%rsi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <displayBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig10_07>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <displayBits@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [27 x i8] c"Enter a nonnegative int: \0A\00"
@.str.2 = [3 x i8] c"%u\00"
define void @fig10_07() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @displayBits(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [27 x i8] c"Enter a nonnegative int: \0A\00"
@.str.2 = [3 x i8] c"%u\00"
define void @fig10_07() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @displayBits(i32 %5)
ret void
}
/* Variables and functions */
int ig_indirect_table_get(unsigned int, int, unsigned int, int, unsigned int *);
int ig_sa_table_get(unsigned int dev_id, unsigned int index,
                    unsigned int *pentry) {
  if ((index < 32) || (index > 63)) {
    return -1;
  }
  return ig_indirect_table_get(dev_id, 3, index, 4, pentry);
}


x86 assembly (clang, -O0):
<ig_sa_table_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x20,-0xc(%rbp)
jb     1136 <ig_sa_table_get+0x26>
cmpl   $0x3f,-0xc(%rbp)
jbe    1142 <ig_sa_table_get+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <ig_sa_table_get+0x4e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    $0x3,%esi
mov    $0x4,%ecx
call   1030 <ig_indirect_table_get@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ig_sa_table_get>:
mov    %esi,%eax
and    $0xffffffe0,%eax
cmp    $0x20,%eax
jne    112e <ig_sa_table_get+0x1e>
mov    %rdx,%r8
mov    %esi,%edx
mov    $0x3,%esi
mov    $0x4,%ecx
jmp    1030 <ig_indirect_table_get@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ig_sa_table_get(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 32
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = icmp ugt i32 %11, 63
br i1 %12, label %13, label %14
13: ; preds = %10, %3
store i32 -1, i32* %4
br label %19
14: ; preds = %10
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = load i32*, i32** %7
%18 = call i32 @ig_indirect_table_get(i32 %15, i32 3, i32 %16, i32 4, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %13
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @ig_sa_table_get(i32 %0, i32 %1, i32* %2) {
%4 = and i32 %1, -32
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ig_indirect_table_get(i32 %0, i32 3, i32 %1, i32 4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
void grcter(fd) int *fd;
{
  close(*fd);
  return;
}


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

x86 assembly (clang, -O2):
<grcter>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @grcter(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @grcter(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Type definitions */
struct cymkd_parser {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ consume(struct cymkd_parser *);
char next(struct cymkd_parser *);
void skip_empty_lines(struct cymkd_parser *parser) {
  while (next(parser) == '\n') {
    consume(parser);
  }
}


x86 assembly (clang, -O0):
<skip_empty_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <next@plt>
movsbl %al,%eax
cmp    $0xa,%eax
jne    114f <skip_empty_lines+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <consume@plt>
jmp    112c <skip_empty_lines+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_empty_lines>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <next@plt>
cmp    $0xa,%al
jne    1146 <skip_empty_lines+0x26>
mov    %rbx,%rdi
call   1040 <consume@plt>
mov    %rbx,%rdi
jmp    1130 <skip_empty_lines+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.cymkd_parser = type { i32 }
define void @skip_empty_lines(%struct.cymkd_parser* %0) {
%2 = alloca %struct.cymkd_parser*
store %struct.cymkd_parser* %0, %struct.cymkd_parser** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.cymkd_parser*, %struct.cymkd_parser** %2
%5 = call signext i8 @next(%struct.cymkd_parser* %4)
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load %struct.cymkd_parser*, %struct.cymkd_parser** %2
%10 = call i32 @consume(%struct.cymkd_parser* %9)
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.cymkd_parser = type { i32 }
define void @skip_empty_lines(%struct.cymkd_parser* %0) {
%2 = tail call signext i8 @next(%struct.cymkd_parser* %0)
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @consume(%struct.cymkd_parser* %0)
%6 = tail call signext i8 @next(%struct.cymkd_parser* %0)
%7 = icmp eq i8 %6, 10
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cpuidShowVendor();
int Vendor(int argc, char *argv[]) {
  cpuidShowVendor();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @Vendor(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @cpuidShowVendor()
ret i32 0
}

LLVM IR (-O2):
define i32 @Vendor(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cpuidShowVendor()
ret i32 0
}
int interpolate(int a, int b, int c, int d, int e) {
  int f;
  f = (c * b + d * e - e * b - a * d) / (c - a);
  return (f);
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    -0x4(%rbp),%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
mov    %edx,%r9d
mov    %edx,%eax
imul   %esi,%eax
mov    %ecx,%edx
imul   %edi,%edx
sub    %edx,%eax
sub    %esi,%ecx
imul   %r8d,%ecx
add    %ecx,%eax
sub    %edi,%r9d
cltd
idiv   %r9d
ret

LLVM IR (-O0):
define i32 @interpolate(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %8
%13 = load i32, i32* %7
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = mul nsw i32 %15, %16
%18 = add nsw i32 %14, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %7
%21 = mul nsw i32 %19, %20
%22 = sub nsw i32 %18, %21
%23 = load i32, i32* %6
%24 = load i32, i32* %9
%25 = mul nsw i32 %23, %24
%26 = sub nsw i32 %22, %25
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = sub nsw i32 %27, %28
%30 = sdiv i32 %26, %29
store i32 %30, i32* %11
%31 = load i32, i32* %11
ret i32 %31
}

LLVM IR (-O2):
define i32 @interpolate(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = mul nsw i32 %2, %1
%7 = mul nsw i32 %3, %0
%8 = sub i32 %3, %1
%9 = mul i32 %8, %4
%10 = sub i32 %6, %7
%11 = add i32 %10, %9
%12 = sub nsw i32 %2, %0
%13 = sdiv i32 %11, %12
ret i32 %13
}
int isPrime(int n) {
  int flag = 1, i = 2;
  while (i * i < n && flag) {
    if (n % i == 0) {
      flag = 0;
    } else {
      i++;
    }
  }
  if (flag == 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x10(%rbp),%ecx
imul   -0x10(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x11(%rbp)
jge    1134 <isPrime+0x34>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1144 <isPrime+0x44>
jmp    116e <isPrime+0x6e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    1160 <isPrime+0x60>
movl   $0x0,-0xc(%rbp)
jmp    1169 <isPrime+0x69>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <isPrime+0x15>
cmpl   $0x1,-0xc(%rbp)
jne    1184 <isPrime+0x84>
movl   $0x1,-0x4(%rbp)
jmp    118b <isPrime+0x8b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
mov    $0x1,%eax
cmp    $0x5,%edi
jl     1129 <isPrime+0x29>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
xor    %eax,%eax
test   %edx,%edx
setne  %al
je     1129 <isPrime+0x29>
add    %eax,%ecx
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
jl     1110 <isPrime+0x10>
ret

LLVM IR (-O0):
define i32 @isPrime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 1, i32* %4
store i32 2, i32* %5
br label %6
6: ; preds = %26, %1
%7 = load i32, i32* %5
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br label %15
15: ; preds = %12, %6
%16 = phi i1 [ false, %6 ], [ %14, %12 ]
br i1 %16, label %17, label %27
17: ; preds = %15
%18 = load i32, i32* %3
%19 = load i32, i32* %5
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 0, i32* %4
br label %26
23: ; preds = %17
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %22
br label %6
27: ; preds = %15
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %31
30: ; preds = %27
store i32 1, i32* %2
br label %32
31: ; preds = %27
store i32 0, i32* %2
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp sgt i32 %0, 4
br i1 %2, label %3, label %13
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ 2, %1 ]
%5 = srem i32 %0, %4
%6 = icmp eq i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = mul nsw i32 %9, %9
%11 = icmp sge i32 %10, %0
%12 = or i1 %6, %11
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i32 [ 1, %1 ], [ %8, %3 ]
ret i32 %14
}
/* Variables and functions */
int is_prime_(int, int);
int is_prime(int n) { return is_prime_(n, n - 1); }


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

x86 assembly (clang, -O2):
<is_prime>:
lea    -0x1(%rdi),%esi
jmp    1030 <is_prime_@plt>

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = call i32 @is_prime_(i32 %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @is_prime_(i32 %0, i32 %2)
ret i32 %3
}