xunge/DecIR huggingface dataset:
void mstrncpy(char *s, char *t, int n) {
  int i = 0;
  while ((*s++ = *t++) && ++i < n) {
    ;
  }
  *s = '\0';
}


x86 assembly (clang, -O0):
<mstrncpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     115b <mstrncpy+0x5b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmp    -0x14(%rbp),%eax
setl   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116b <mstrncpy+0x6b>
jmp    1170 <mstrncpy+0x70>
jmp    1116 <mstrncpy+0x16>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrncpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
je     1123 <mstrncpy+0x23>
cmp    %edx,%eax
jl     1110 <mstrncpy+0x10>
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @mstrncpy(i8* nocapture writeonly %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i8* [ %1, %3 ], [ %11, %4 ]
%6 = phi i8* [ %0, %3 ], [ %9, %4 ]
%7 = phi i32 [ 0, %3 ], [ %12, %4 ]
%8 = load i8, i8* %5
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 %8, i8* %6
%10 = icmp ne i8 %8, 0
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = add nuw nsw i32 %7, 1
%13 = icmp slt i32 %12, %2
%14 = select i1 %10, i1 %13, i1 false
br i1 %14, label %4, label %15
15: ; preds = %4
store i8 0, i8* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ throw(char *);
void set_socket_flags(int socket_fd, int flags) {
  if ((flags = fcntl(socket_fd, F_SETFL, flags)) == -1) {
    throw("Error setting flags");
  }
}


x86 assembly (clang, -O0):
<set_socket_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    115a <set_socket_flags+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <throw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_socket_flags>:
push   %rax
mov    %esi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     1138 <set_socket_flags+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <throw@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@.str = [20 x i8] c"Error setting flags\00"
define void @set_socket_flags(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* @F_SETFL
%7 = load i32, i32* %4
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @throw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@.str = [20 x i8] c"Error setting flags\00"
define void @set_socket_flags(i32 %0, i32 %1) {
%3 = load i32, i32* @F_SETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @throw(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
extern __attribute__((__gnu___)) long double _Complex __attribute__((__const__))
conjl(long double _Complex _Z) {
  return __extension__ ~_Z;
}


x86 assembly (clang, -O0):
<conjl>:
push   %rbp
mov    %rsp,%rbp
lea    0x10(%rbp),%rax
fldt   (%rax)
fldt   0x10(%rax)
fchs
fxch   %st(1)
fstpt  -0x20(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<conjl>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fchs
fxch   %st(1)
ret

LLVM IR (-O0):
define { x86_fp80, x86_fp80 } @conjl({ x86_fp80, x86_fp80 }* byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = alloca { x86_fp80, x86_fp80 }
%3 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 0
%4 = load x86_fp80, x86_fp80* %3
%5 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i32 0, i32 1
%6 = load x86_fp80, x86_fp80* %5
%7 = fneg x86_fp80 %6
%8 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 0
%9 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2, i32 0, i32 1
store x86_fp80 %4, x86_fp80* %8
store x86_fp80 %7, x86_fp80* %9
%10 = load { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %2
ret { x86_fp80, x86_fp80 } %10
}

LLVM IR (-O2):
define { x86_fp80, x86_fp80 } @conjl({ x86_fp80, x86_fp80 }* nocapture byval({ x86_fp80, x86_fp80 }) align 16 %0) {
%2 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 0
%3 = load x86_fp80, x86_fp80* %2
%4 = getelementptr inbounds { x86_fp80, x86_fp80 }, { x86_fp80, x86_fp80 }* %0, i64 0, i32 1
%5 = load x86_fp80, x86_fp80* %4
%6 = fneg x86_fp80 %5
%7 = insertvalue { x86_fp80, x86_fp80 } poison, x86_fp80 %3, 0
%8 = insertvalue { x86_fp80, x86_fp80 } %7, x86_fp80 %6, 1
ret { x86_fp80, x86_fp80 } %8
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int write_multprec_start_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(495, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<write_multprec_start_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1ef,%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):
<write_multprec_start_solutions>:
mov    $0x1ef,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @write_multprec_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 495, 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 @write_multprec_start_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 495, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
unsigned int _cpuFlags() {
  unsigned int flags = 0;
  return (flags);
}


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

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

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

LLVM IR (-O2):
define i32 @_cpuFlags() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void release(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<release>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @release(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int getsockname(int, struct sockaddr *, int *);
int ntohs(int /*<<< orphan*/);
int udp_socket_get_port(int sock) {
  struct sockaddr_in addr;
  socklen_t addr_len = sizeof(addr);
  int res = getsockname(sock, (struct sockaddr *)&addr, &addr_len);
  if (res < 0)
    return -1;
  return ntohs(addr.sin_port);
}


x86 assembly (clang, -O0):
<udp_socket_get_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <getsockname@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    115b <udp_socket_get_port+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1166 <udp_socket_get_port+0x46>
mov    -0x10(%rbp),%edi
call   1030 <ntohs@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp_socket_get_port>:
push   %rax
movl   $0x4,0x4(%rsp)
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <getsockname@plt>
test   %eax,%eax
js     1144 <udp_socket_get_port+0x24>
mov    (%rsp),%edi
call   1030 <ntohs@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @udp_socket_get_port(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 4, i32* %5
%7 = load i32, i32* %3
%8 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%9 = call i32 @getsockname(i32 %7, %struct.sockaddr* %8, i32* %5)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %17
13: ; preds = %1
%14 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%15 = load i32, i32* %14
%16 = call i32 @ntohs(i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %13, %12
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @udp_socket_get_port(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i32 @getsockname(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp slt i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %1
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @ntohs(i32 %11)
br label %13
13: ; preds = %1, %9
%14 = phi i32 [ %12, %9 ], [ -1, %1 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: travsal -n [number of cities] -w [grid width] -h [grid "
         "height]\n       -i [initial temperature] -f [final temperature] -t "
         "[cooling timescale]\n");
}


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

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

LLVM IR (-O0):
@.str = [149 x i8] c"Usage: travsal -n [number of cities] -w [grid width] -h [grid height]\0A -i [initial temperature] -f [final temperature] -t [cooling timescale]\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [148 x i8] c"Usage: travsal -n [number of cities] -w [grid width] -h [grid height]\0A -i [initial temperature] -f [final temperature] -t [cooling timescale]\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([148 x i8], [148 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gluLookAt(float, float, float, float, float, float, float,
                             float, float);
void s2LookAt(float eyeX, float eyeY, float eyeZ, float lookAtX, float lookAtY,
              float lookAtZ, float upX, float upY, float upZ) {
  gluLookAt(eyeX, eyeY, eyeZ, lookAtX, lookAtY, lookAtZ, upX, upY, upZ);
}


x86 assembly (clang, -O0):
<s2LookAt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  0x10(%rbp),%xmm8
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  %xmm6,-0x1c(%rbp)
movss  %xmm7,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
movss  -0x1c(%rbp),%xmm6
movss  -0x20(%rbp),%xmm7
movss  0x10(%rbp),%xmm8
movss  %xmm8,(%rsp)
call   1030 <gluLookAt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2LookAt>:
jmp    1030 <gluLookAt@plt>

LLVM IR (-O0):
define void @s2LookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store float %0, float* %10
store float %1, float* %11
store float %2, float* %12
store float %3, float* %13
store float %4, float* %14
store float %5, float* %15
store float %6, float* %16
store float %7, float* %17
store float %8, float* %18
%19 = load float, float* %10
%20 = load float, float* %11
%21 = load float, float* %12
%22 = load float, float* %13
%23 = load float, float* %14
%24 = load float, float* %15
%25 = load float, float* %16
%26 = load float, float* %17
%27 = load float, float* %18
%28 = call i32 @gluLookAt(float %19, float %20, float %21, float %22, float %23, float %24, float %25, float %26, float %27)
ret void
}

LLVM IR (-O2):
define void @s2LookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8) {
%10 = tail call i32 @gluLookAt(float %0, float %1, float %2, float %3, float %4, float %5, float %6, float %7, float %8)
ret void
}
int NotWithinRange(int base, int extent) {
  if (extent > base && base + 5 >= extent) {
    return 0;
  }
  if (extent < base && base - 5 <= extent) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<NotWithinRange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1131 <NotWithinRange+0x31>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
cmp    -0xc(%rbp),%eax
jl     1131 <NotWithinRange+0x31>
movl   $0x0,-0x4(%rbp)
jmp    115f <NotWithinRange+0x5f>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <NotWithinRange+0x58>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
cmp    -0xc(%rbp),%eax
jg     1158 <NotWithinRange+0x58>
movl   $0x0,-0x4(%rbp)
jmp    115f <NotWithinRange+0x5f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NotWithinRange>:
cmp    %edi,%esi
jle    110e <NotWithinRange+0xe>
lea    0x5(%rdi),%ecx
xor    %eax,%eax
cmp    %esi,%ecx
jl     110e <NotWithinRange+0xe>
ret
cmp    %edi,%esi
setge  %al
add    $0xfffffffb,%edi
cmp    %esi,%edi
setg   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @NotWithinRange(i32 %0, i32 %1) {
%3 = icmp sle i32 %1, %0
%4 = add nsw i32 %0, 5
%5 = icmp slt i32 %4, %1
%6 = select i1 %3, i1 true, i1 %5
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = icmp sge i32 %1, %0
%9 = add nsw i32 %0, -5
%10 = icmp sgt i32 %9, %1
%11 = select i1 %8, i1 true, i1 %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int /*<<< orphan*/ tolower(char);
wint_t towlower(wint_t c) {
  if (c > 0xff) {
    return c;
  }
  return (wint_t)tolower((char)c);
}


x86 assembly (clang, -O0):
<towlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jle    1133 <towlower+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <towlower+0x31>
mov    -0x8(%rbp),%eax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<towlower>:
cmp    $0xff,%edi
jle    111b <towlower+0xb>
mov    %edi,%eax
ret
movsbl %dil,%edi
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define i32 @towlower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 255
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* %3
store i32 %7, i32* %2
br label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = trunc i32 %9 to i8
%11 = call i32 @tolower(i8 signext %10)
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @towlower(i32 %0) {
%2 = icmp sgt i32 %0, 255
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = tail call i32 @tolower(i8 signext %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ isupper(unsigned char);
int tolower(unsigned char);
unsigned char clower(int c) {
  return (unsigned char)((isupper((unsigned char)c)) ? tolower((unsigned char)c)
                                                     : c);
}


x86 assembly (clang, -O0):
<clower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1153 <clower+0x33>
mov    -0x4(%rbp),%eax
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
jmp    1159 <clower+0x39>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clower>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
movzbl %bl,%ebp
mov    %ebp,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     113d <clower+0x1d>
mov    %ebp,%edi
call   1030 <tolower@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i8 @clower(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i64 @isupper(i8 zeroext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @tolower(i8 zeroext %2)
%7 = trunc i32 %6 to i8
br label %8
8: ; preds = %1, %5
%9 = phi i8 [ %2, %1 ], [ %7, %5 ]
ret i8 %9
}
/* Variables and functions */
scalar_t__ realloc(char *, int);
int strlen(char *);
char *str_cat_c(char *s, char c) {
  s = (char *)realloc(s, sizeof(char) * (strlen(s) + 2));
  while (*s)
    ++s;
  *s = c;
  *(s + 1) = 0;
  return s;
}


x86 assembly (clang, -O0):
<str_cat_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
add    $0x2,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1179 <str_cat_c+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115b <str_cat_c+0x3b>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat_c>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <strlen@plt>
lea    0x2(%rax),%esi
mov    %rbx,%rdi
call   1040 <realloc@plt>
add    $0xffffffffffffffff,%rax
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
jne    1140 <str_cat_c+0x20>
mov    %bpl,(%rax)
movb   $0x0,0x1(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @str_cat_c(i8* %0, i8 signext %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** %3
%7 = call i32 @strlen(i8* %6)
%8 = add nsw i32 %7, 2
%9 = sext i32 %8 to i64
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @realloc(i8* %5, i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
br label %14
14: ; preds = %18, %2
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %14
21: ; preds = %14
%22 = load i8, i8* %4
%23 = load i8*, i8** %3
store i8 %22, i8* %23
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 1
store i8 0, i8* %25
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @str_cat_c(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 2
%5 = tail call i64 @realloc(i8* %0, i32 %4)
%6 = inttoptr i64 %5 to i8*
br label %7
7: ; preds = %7, %2
%8 = phi i8* [ %6, %2 ], [ %11, %7 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %10, label %12, label %7
12: ; preds = %7
store i8 %1, i8* %8
store i8 0, i8* %11
ret i8* %8
}
void test_invalid_clause() {
  int i;
#pragma omp parallel
#pragma omp master taskloop foo bar
  for (i = 0; i < 16; ++i)
    ;
#pragma omp master taskloop nogroup nogroup
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    114c <test_invalid_clause+0x4c>
jmp    113e <test_invalid_clause+0x3e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <test_invalid_clause+0x2f>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_invalid_clause() {
%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, 16
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
store i32 0, i32* %1
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 16
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %10
17: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void w_quick_sort_int_free(void *a) { free(a); }


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

x86 assembly (clang, -O2):
<w_quick_sort_int_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @w_quick_sort_int_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int strcmp(const char *a, const char *b) {
  while ((*a != '\0') && (*a == *b)) {
    a++;
    b++;
  }
  return (*(unsigned char *)a - *(unsigned char *)b);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void test_xor() {
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c",
          23, 10, 15 ^ 5);
  ;
}


x86 assembly (clang, -O0):
<test_xor>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x17,%esi
mov    $0xa,%ecx
mov    %ecx,%edx
call   1030 <fexpect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xor>:
lea    0xee9(%rip),%rdi
mov    $0x17,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c\00"
define void @test_xor() {
%1 = call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 23, i32 10, i32 10)
ret void
}

LLVM IR (-O2):
@.str = [128 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/bitop.c\00"
define void @test_xor() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @.str, i64 0, i64 0), i32 23, i32 10, i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main(void) { abort(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int TestBit(int, int /*<<< orphan*/);
int16_t ROL(int16_t n) {
  int16_t mask = TestBit(n, 0);
  return (n << 1) | mask;
}


x86 assembly (clang, -O0):
<ROL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <TestBit@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ROL>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <TestBit@plt>
add    %ebx,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ROL(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @TestBit(i32 %4, i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = shl i32 %6, 1
%8 = load i32, i32* %3
%9 = or i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ROL(i32 %0) {
%2 = tail call i32 @TestBit(i32 %0, i32 0)
%3 = shl i32 %0, 1
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void assert_file_exist(char *file) {
  if (access(file, F_OK)) {
    fprintf(stderr, "ERROR: File %s does not exist.  Exiting\n", file);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_file_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
je     117b <assert_file_exist+0x4b>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_file_exist>:
push   %rbx
mov    %rdi,%rbx
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
test   %rax,%rax
jne    1149 <assert_file_exist+0x19>
pop    %rbx
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@F_OK = global i32 0
@stderr = global i32 0
@.str = [41 x i8] c"ERROR: File %s does not exist. Exiting\0A\00"
define void @assert_file_exist(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @F_OK
%5 = call i64 @access(i8* %3, i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@F_OK = global i32 0
@stderr = global i32 0
@.str = [41 x i8] c"ERROR: File %s does not exist. Exiting\0A\00"
define void @assert_file_exist(i8* %0) {
%2 = load i32, i32* @F_OK
%3 = tail call i64 @access(i8* %0, i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}
/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/);
scalar_t__ isspace(int);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
void skipspaces() {
  int c = EOF;
  while (isspace(c = getc(stdin))) {
  }
  if (c != EOF) {
    ungetc(c, stdin);
  }
}


x86 assembly (clang, -O0):
<skipspaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1050 <getc@plt>
mov    %eax,%edi
mov    %edi,-0x4(%rbp)
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     116b <skipspaces+0x3b>
jmp    1144 <skipspaces+0x14>
mov    -0x4(%rbp),%eax
mov    0x2e6b(%rip),%rcx
cmp    (%rcx),%eax
je     118e <skipspaces+0x5e>
mov    -0x4(%rbp),%edi
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipspaces>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edi
call   1050 <getc@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <skipspaces+0x10>
mov    0x2e83(%rip),%rax
cmp    (%rax),%ebx
jne    1169 <skipspaces+0x39>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    (%r14),%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
@EOF = global i32 0
@stdin = global i32 0
define void @skipspaces() {
%1 = alloca i32
%2 = load i32, i32* @EOF
store i32 %2, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* @stdin
%5 = call i32 @getc(i32 %4)
store i32 %5, i32* %1
%6 = call i64 @isspace(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %1
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i32, i32* %1
%15 = load i32, i32* @stdin
%16 = call i32 @ungetc(i32 %14, i32 %15)
br label %17
17: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
define void @skipspaces() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @getc(i32 %2)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %3, %7
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* @stdin
%11 = tail call i32 @ungetc(i32 %3, i32 %10)
br label %12
12: ; preds = %9, %6
ret void
}
/* Type definitions */
struct tbox {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ l_adjust_values(struct tbox *);
void tbox_term_resize(struct tbox *tb) { l_adjust_values(tb); }


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

x86 assembly (clang, -O2):
<tbox_term_resize>:
jmp    1030 <l_adjust_values@plt>

LLVM IR (-O0):
%struct.tbox = type { i32 }
define void @tbox_term_resize(%struct.tbox* %0) {
%2 = alloca %struct.tbox*
store %struct.tbox* %0, %struct.tbox** %2
%3 = load %struct.tbox*, %struct.tbox** %2
%4 = call i32 @l_adjust_values(%struct.tbox* %3)
ret void
}

LLVM IR (-O2):
%struct.tbox = type { i32 }
define void @tbox_term_resize(%struct.tbox* %0) {
%2 = tail call i32 @l_adjust_values(%struct.tbox* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(long long);
void should_fail() {
  long long x = 20;
  f(x);
}


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

x86 assembly (clang, -O2):
<should_fail>:
mov    $0x14,%edi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @should_fail() {
%1 = alloca i64
store i64 20, i64* %1
%2 = load i64, i64* %1
%3 = call i32 @f(i64 %2)
ret void
}

LLVM IR (-O2):
define void @should_fail() {
%1 = tail call i32 @f(i64 20)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rightrox(unsigned int, int);
int main() {
  unsigned x = 111;
  int n = 3;
  printf("%u\n", rightrox(x, n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @rightrox(i32 111, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int array_index_of(const void *array, const size_t length, const int number,
                   const char direction) {
  return -1;
}


x86 assembly (clang, -O0):
<array_index_of>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @array_index_of(i8* %0, i64 %1, i32 %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @array_index_of(i8* nocapture readnone %0, i64 %1, i32 %2, i8 signext %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ glutPostRedisplay();
void onIdle(void) { glutPostRedisplay(); }


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

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

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

LLVM IR (-O2):
define void @onIdle() {
%1 = tail call i32 (...) @glutPostRedisplay()
ret void
}
unsigned int cast_short_uint(short int x) { return (unsigned int)x; }


x86 assembly (clang, -O0):
<cast_short_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cast_short_uint(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @cast_short_uint(i16 signext %0) {
%2 = sext i16 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int registers_read_byte(int);
int /*<<< orphan*/ registers_write_byte(int, int);
void pwm_enable(void) {
  uint8_t flags_lo = registers_read_byte(0x05);
  registers_write_byte(0x05, flags_lo | (1 << 0x00));
}


x86 assembly (clang, -O0):
<pwm_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x5,%edi
call   1040 <registers_read_byte@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
or     $0x1,%esi
mov    $0x5,%edi
call   1030 <registers_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pwm_enable>:
push   %rax
mov    $0x5,%edi
call   1040 <registers_read_byte@plt>
or     $0x1,%eax
mov    $0x5,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <registers_write_byte@plt>

LLVM IR (-O0):
define void @pwm_enable() {
%1 = alloca i32
%2 = call i32 @registers_read_byte(i32 5)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 1
%5 = call i32 @registers_write_byte(i32 5, i32 %4)
ret void
}

LLVM IR (-O2):
define void @pwm_enable() {
%1 = tail call i32 @registers_read_byte(i32 5)
%2 = or i32 %1, 1
%3 = tail call i32 @registers_write_byte(i32 5, i32 %2)
ret void
}
int omap_pm_apply_min_bus_tput_helper(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap_pm_apply_min_bus_tput_helper() {
ret i32 0
}
int palindrome(const char *str, int len) {
  if (len < 2)
    return 1;
  if (*str != *(str + len - 1))
    return 0;
  return palindrome(str + 1, len - 2);
}


x86 assembly (clang, -O0):
<palindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1135 <palindrome+0x25>
movl   $0x1,-0x4(%rbp)
jmp    1173 <palindrome+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl -0x1(%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     115d <palindrome+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1173 <palindrome+0x63>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x14(%rbp),%esi
sub    $0x2,%esi
call   1030 <palindrome@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<palindrome>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1129 <palindrome+0x29>
nopw   0x0(%rax,%rax,1)
mov    %esi,%ecx
movzbl (%rdi),%edx
cmp    -0x1(%rdi,%rcx,1),%dl
jne    112a <palindrome+0x2a>
add    $0x1,%rdi
lea    -0x2(%rsi),%ecx
cmp    $0x3,%esi
mov    %ecx,%esi
jg     1110 <palindrome+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @palindrome(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %17, label %4
4: ; preds = %2, %13
%5 = phi i32 [ %15, %13 ], [ %1, %2 ]
%6 = phi i8* [ %14, %13 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = zext i32 %5 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = getelementptr inbounds i8, i8* %9, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %7, %11
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %6, i64 1
%15 = add nsw i32 %5, -2
%16 = icmp slt i32 %5, 4
br i1 %16, label %17, label %4
17: ; preds = %13, %4, %2
%18 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 1, %13 ]
ret i32 %18
}
void ASN1_PRINTABLESTRING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_PRINTABLESTRING_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x2b() {
  Assert_real((isxdigit(43) == 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_isxdigit.c",
              220, ("isxdigit should be 0 for +"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0x2b>:
push   %rax
mov    $0x2b,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xdc,%edx
pop    %rax
jmp    1040 <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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for +\00"
define void @t_isxdigit_0x2b() {
%1 = call i64 @isxdigit(i32 43)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 220, 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_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for +\00"
define void @t_isxdigit_0x2b() {
%1 = tail call i64 @isxdigit(i32 43)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 220, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ieee80211_debugfs_key_add_beacon_default(
    struct ieee80211_sub_if_data *sdata) {}


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

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

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

LLVM IR (-O2):
%struct.ieee80211_sub_if_data = type opaque
define void @ieee80211_debugfs_key_add_beacon_default(%struct.ieee80211_sub_if_data* nocapture %0) {
ret void
}