xunge/DecIR huggingface dataset:
/* Variables and functions */
double calculate_angle(int /*<<< orphan*/, int);
int test_invalid_minute() { return -1.0 == calculate_angle(0, 60); }


x86 assembly (clang, -O0):
<test_invalid_minute>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3c,%esi
call   1030 <calculate_angle@plt>
movaps %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_invalid_minute>:
push   %rax
xor    %edi,%edi
mov    $0x3c,%esi
call   1030 <calculate_angle@plt>
cmpeqsd 0xeda(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_invalid_minute() {
%1 = call double @calculate_angle(i32 0, i32 60)
%2 = fcmp oeq double -1.000000e+00, %1
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @test_invalid_minute() {
%1 = tail call double @calculate_angle(i32 0, i32 60)
%2 = fcmp oeq double %1, -1.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
char *timestr(struct timeval a, char *buf) {
  sprintf(buf, "%dsec, %3dms", a.tv_sec, a.tv_usec / 1000);
  return buf;
}


x86 assembly (clang, -O0):
<timestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xebf(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestr>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rdi,%rax
sar    $0x20,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
sar    $0x26,%rcx
add    %eax,%ecx
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [13 x i8] c"%dsec, %3dms\00"
define i8* @timestr(i64 %0, i8* %1) {
%3 = alloca %struct.timeval
%4 = alloca i8*
%5 = bitcast %struct.timeval* %3 to i64*
store i64 %0, i64* %5
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
%13 = load i8*, i8** %4
ret i8* %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"%dsec, %3dms\00"
define i8* @timestr(i64 %0, i8* returned writeonly %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = sdiv i32 %5, 1000
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %6)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ main();
void caller() { main(); }


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

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

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

LLVM IR (-O2):
define void @caller() {
%1 = tail call i32 (...) @main()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int do_other(int fd, char *param) {
  send(fd, "500 unknown command\r\n", strlen("500 unknown command\r\n"), 0);
  return 0;
}


x86 assembly (clang, -O0):
<do_other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    0xec4(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xeb3(%rip),%rsi
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_other>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [22 x i8] c"500 unknown command\0D\0A\00"
define i32 @do_other(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @strlen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @send(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6, i32 0)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"500 unknown command\0D\0A\00"
define i32 @do_other(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @send(i32 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void helpmsg() {
  fprintf(stderr, "\n Usage: mkaenc -i <inputfile> [options]\n");
  fprintf(stderr, "\n To display all the options: mkaenc -h\n");
}


x86 assembly (clang, -O0):
<helpmsg>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xef1(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpmsg>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xefb(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"\0A Usage: mkaenc -i <inputfile> [options]\0A\00"
@.str.1 = [41 x i8] c"\0A To display all the options: mkaenc -h\0A\00"
define void @helpmsg() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"\0A Usage: mkaenc -i <inputfile> [options]\0A\00"
@.str.1 = [41 x i8] c"\0A To display all the options: mkaenc -h\0A\00"
define void @helpmsg() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double calc_Nm_H(double Hw, double Ha) {
  if (Ha - Hw <= 0)
    return Hw;
  else
    return Hw / (1 + Ha - Hw);
}


x86 assembly (clang, -O0):
<calc_Nm_H>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jb     1134 <calc_Nm_H+0x34>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1154 <calc_Nm_H+0x54>
movsd  -0x10(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_Nm_H>:
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm2,%xmm3
jae    1122 <calc_Nm_H+0x22>
addsd  0xee6(%rip),%xmm1
subsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_Nm_H(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = fcmp ole double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load double, double* %4
store double %11, double* %3
br label %19
12: ; preds = %2
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fadd double 1.000000e+00, %14
%16 = load double, double* %4
%17 = fsub double %15, %16
%18 = fdiv double %13, %17
store double %18, double* %3
br label %19
19: ; preds = %12, %10
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @calc_Nm_H(double %0, double %1) {
%3 = fsub double %1, %0
%4 = fcmp ugt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = fadd double %1, 1.000000e+00
%7 = fsub double %6, %0
%8 = fdiv double %0, %7
br label %9
9: ; preds = %2, %5
%10 = phi double [ %8, %5 ], [ %0, %2 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int abort_gzip(void) {
  { exit(0); }
}


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

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

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

LLVM IR (-O2):
define i32 @abort_gzip() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int recv(int, void *, unsigned int, int /*<<< orphan*/);
int NetRead(int sock_client, void *buffer, unsigned int buf_len) {
  if (sock_client < 0)
    return sock_client;
  return recv(sock_client, buffer, buf_len, 0);
}


x86 assembly (clang, -O0):
<NetRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1137 <NetRead+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <NetRead+0x3b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NetRead>:
test   %edi,%edi
js     111b <NetRead+0xb>
xor    %ecx,%ecx
jmp    1030 <recv@plt>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @NetRead(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @recv(i32 %0, i8* %1, i32 %2, i32 0)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ %0, %3 ]
ret i32 %8
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ bit_reverse(int);
int getchar();
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
int main(void) {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(bit_reverse(c));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e98(%rip),%rcx
cmp    (%rcx),%eax
je     116c <main+0x3c>
mov    -0x8(%rbp),%edi
call   1040 <bit_reverse@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea9(%rip),%rbx
cmp    (%rbx),%eax
je     1169 <main+0x39>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1040 <bit_reverse@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%rbx),%eax
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @bit_reverse(i32 %5)
%7 = tail call i32 @putchar(i32 %6)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ flip2(unsigned short const *, unsigned short *, int);
int read(int, short *, int);
int read_int2_array(int f, short *iarray, int n) {
  int nread = read(f, iarray, n * 2);
  if (nread <= 0)
    return 0;
  flip2((const unsigned short *)iarray, (unsigned short *)iarray, nread / 2);
  return nread / 2;
}


x86 assembly (clang, -O0):
<read_int2_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     115d <read_int2_array+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1185 <read_int2_array+0x65>
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
call   1040 <flip2@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int2_array>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
add    %edx,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1144 <read_int2_array+0x24>
mov    %eax,%ebp
shr    %ebp
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <flip2@plt>
jmp    1146 <read_int2_array+0x26>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_int2_array(i32 %0, i16* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i16* %1, i16** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i16*, i16** %6
%11 = load i32, i32* %7
%12 = mul nsw i32 %11, 2
%13 = call i32 @read(i32 %9, i16* %10, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 0, i32* %4
br label %25
17: ; preds = %3
%18 = load i16*, i16** %6
%19 = load i16*, i16** %6
%20 = load i32, i32* %8
%21 = sdiv i32 %20, 2
%22 = call i32 @flip2(i16* %18, i16* %19, i32 %21)
%23 = load i32, i32* %8
%24 = sdiv i32 %23, 2
store i32 %24, i32* %4
br label %25
25: ; preds = %17, %16
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @read_int2_array(i32 %0, i16* %1, i32 %2) {
%4 = shl nsw i32 %2, 1
%5 = tail call i32 @read(i32 %0, i16* %1, i32 %4)
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = lshr i32 %5, 1
%9 = tail call i32 @flip2(i16* %1, i16* %1, i32 %8)
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ %8, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ texConv_AI88_ARGB4444(unsigned char *, unsigned char *, int);
void TexConv_AI88_ARGB4444(unsigned char *src, unsigned char *dst, int width,
                           int height) {
  int size = (width * height) >> 1;
  texConv_AI88_ARGB4444(src, dst, size);
}


x86 assembly (clang, -O0):
<TexConv_AI88_ARGB4444>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <texConv_AI88_ARGB4444@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TexConv_AI88_ARGB4444>:
imul   %ecx,%edx
sar    %edx
jmp    1030 <texConv_AI88_ARGB4444@plt>

LLVM IR (-O0):
define void @TexConv_AI88_ARGB4444(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = mul nsw i32 %10, %11
%13 = ashr i32 %12, 1
store i32 %13, i32* %9
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = load i32, i32* %9
%17 = call i32 @texConv_AI88_ARGB4444(i8* %14, i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @TexConv_AI88_ARGB4444(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %3, %2
%6 = ashr i32 %5, 1
%7 = tail call i32 @texConv_AI88_ARGB4444(i8* %0, i8* %1, i32 %6)
ret void
}
/* Variables and functions */
int fabs(double);
double tanh(double);
double svf_shape(double x) {
  x += 0.25;
  return fabs(x) < 1e-12 ? 1.0 : tanh(x) / x;
}


x86 assembly (clang, -O0):
<svf_shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xed3(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xeab(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1171 <svf_shape+0x51>
movsd  0xea9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1185 <svf_shape+0x65>
movsd  -0x8(%rbp),%xmm0
call   1030 <tanh@plt>
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svf_shape>:
push   %rax
addsd  0xed7(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1040 <fabs@plt>
test   %eax,%eax
jle    1148 <svf_shape+0x28>
movsd  (%rsp),%xmm0
call   1030 <tanh@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xeb8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @svf_shape(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 2.500000e-01
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 @fabs(double %5)
%7 = sitofp i32 %6 to double
%8 = fcmp olt double %7, 0x3D719799812DEA11
br i1 %8, label %9, label %10
9: ; preds = %1
br label %15
10: ; preds = %1
%11 = load double, double* %2
%12 = call double @tanh(double %11)
%13 = load double, double* %2
%14 = fdiv double %12, %13
br label %15
15: ; preds = %10, %9
%16 = phi double [ 1.000000e+00, %9 ], [ %14, %10 ]
ret double %16
}

LLVM IR (-O2):
define double @svf_shape(double %0) {
%2 = fadd double %0, 2.500000e-01
%3 = tail call i32 @fabs(double %2)
%4 = icmp slt i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call double @tanh(double %2)
%7 = fdiv double %6, %2
br label %8
8: ; preds = %1, %5
%9 = phi double [ %7, %5 ], [ 1.000000e+00, %1 ]
ret double %9
}
/* Type definitions */
struct module {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ examples_init(char const *);
int /*<<< orphan*/ module_prepare_empty_mocks(struct module **);
void examples_init_NCC_EMPTY(const char *name, struct module **mod) {
  examples_init(name);
  module_prepare_empty_mocks(mod);
}


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

x86 assembly (clang, -O2):
<examples_init_NCC_EMPTY>:
push   %rbx
mov    %rsi,%rbx
call   1040 <examples_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <module_prepare_empty_mocks@plt>

LLVM IR (-O0):
%struct.module = type { i32 }
define void @examples_init_NCC_EMPTY(i8* %0, %struct.module** %1) {
%3 = alloca i8*
%4 = alloca %struct.module**
store i8* %0, i8** %3
store %struct.module** %1, %struct.module*** %4
%5 = load i8*, i8** %3
%6 = call i32 @examples_init(i8* %5)
%7 = load %struct.module**, %struct.module*** %4
%8 = call i32 @module_prepare_empty_mocks(%struct.module** %7)
ret void
}

LLVM IR (-O2):
%struct.module = type { i32 }
define void @examples_init_NCC_EMPTY(i8* %0, %struct.module** %1) {
%3 = tail call i32 @examples_init(i8* %0)
%4 = tail call i32 @module_prepare_empty_mocks(%struct.module** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c;
  double d;
  scanf("%d%d%d", &a, &b, &c);
  d = (double)(a + b + c) / 3;
  printf("%.3lf", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xedd(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xea9(%rip),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [6 x i8] c"%.3lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 3.000000e+00
store double %13, double* %5
%14 = load double, double* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [6 x i8] c"%.3lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 3.000000e+00
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %14)
ret i32 0
}
/* Variables and functions */
char *FindStringCfgValue(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int GetStringCfgValue(char *str, char *dest, int len) {
  char *valstr;
  if ((valstr = FindStringCfgValue(str)) == NULL) {
    return 0;
  }
  strncpy(dest, valstr, len);
  dest[len] = '\0';
  return 1;
}


x86 assembly (clang, -O0):
<GetStringCfgValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <FindStringCfgValue@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1156 <GetStringCfgValue+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1179 <GetStringCfgValue+0x59>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetStringCfgValue>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <FindStringCfgValue@plt>
test   %rax,%rax
je     114d <GetStringCfgValue+0x2d>
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %ebp,%edx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rbx,%rax,1)
mov    $0x1,%eax
jmp    114f <GetStringCfgValue+0x2f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @GetStringCfgValue(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%9 = load i8*, i8** %5
%10 = call i8* @FindStringCfgValue(i8* %9)
store i8* %10, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 0, i32* %4
br label %22
13: ; preds = %3
%14 = load i8*, i8** %6
%15 = load i8*, i8** %8
%16 = load i32, i32* %7
%17 = call i32 @strncpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 0, i8* %21
store i32 1, i32* %4
br label %22
22: ; preds = %13, %12
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @GetStringCfgValue(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @FindStringCfgValue(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i32 @strncpy(i8* %1, i8* %4, i32 %2)
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %1, i64 %8
store i8 0, i8* %9
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ panic(char *, ...);
__attribute__((visibility("hidden"))) void *xmalloc(size_t size) {
  void *ptr;
  if (size == 0)
    panic("xmalloc: zero size\n");
  ptr = malloc(size);
  if (ptr == NULL)
    panic("xmalloc: out of memory (allocating %zu bytes)\n", size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1145 <xmalloc+0x25>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <panic@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116f <xmalloc+0x4f>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <panic@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
jne    113a <xmalloc+0x1a>
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <panic@plt>
mov    %r14,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    115b <xmalloc+0x3b>
lea    0xec3(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <panic@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"xmalloc: zero size\0A\00"
@.str.1 = [47 x i8] c"xmalloc: out of memory (allocating %zu bytes)\0A\00"
define hidden i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, ...) @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i64, i64* %2
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i64, i64* %2
%15 = call i32 (i8*, ...) @panic(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %13, %8
%17 = load i8*, i8** %3
ret i8* %17
}

LLVM IR (-O2):
@.str = [20 x i8] c"xmalloc: zero size\0A\00"
@.str.1 = [47 x i8] c"xmalloc: out of memory (allocating %zu bytes)\0A\00"
define hidden noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @panic(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
%6 = tail call i8* @malloc(i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (i8*, ...) @panic(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i64 %0)
br label %10
10: ; preds = %8, %5
ret i8* %6
}
/* Variables and functions */
int posix_madvise(void *addr, size_t len, int advice) { return 0; }


x86 assembly (clang, -O0):
<posix_madvise>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @posix_madvise(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int count_processes();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int numProcesses = 0;
  numProcesses = count_processes();
  printf("Counted Processes: %d\n", numProcesses);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"Counted Processes: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @count_processes()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int uart_kbhit(void) { return (*(volatile unsigned int *)(0x20000020)) & 0x01; }


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

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

LLVM IR (-O0):
define i32 @uart_kbhit() {
%1 = load volatile i32, i32* inttoptr (i64 536870944 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @uart_kbhit() {
%1 = load volatile i32, i32* inttoptr (i64 536870944 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}
int test_imm_69int64_midword_reg(long long val) {
  return ((val >> 16) & (0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x69,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_69int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 105
%6 = icmp ne i64 %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_69int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6881280
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xcc() {
  Assert_real((isalpha(204) == 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_isalpha.c",
              1025, ("isalpha should be 0 for 0xcc"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xcc>:
push   %rax
mov    $0xcc,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x401,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcc\00"
define void @t_isalpha_0xcc() {
%1 = call i64 @isalpha(i32 204)
%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 1025, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcc\00"
define void @t_isalpha_0xcc() {
%1 = tail call i64 @isalpha(i32 204)
%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 1025, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int shim_enosys(int /*<<< orphan*/, char const *, unsigned int);
int shim_memfd_create(const char *name, unsigned int flags) {
  return shim_enosys(0, name, flags);
}


x86 assembly (clang, -O0):
<shim_memfd_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_memfd_create>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

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

LLVM IR (-O2):
define i32 @shim_memfd_create(i8* %0, i32 %1) {
%3 = tail call i32 @shim_enosys(i32 0, i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ushort;
struct sembuf {
  int sem_op;
  int /*<<< orphan*/ sem_flg;
  int /*<<< orphan*/ sem_num;
};

/* Variables and functions */
int /*<<< orphan*/ SEM_UNDO;
int /*<<< orphan*/ semop(int, struct sembuf *, int);
void v_operate(int semid, ushort semnum) {
  struct sembuf thesops;
  thesops.sem_num = semnum;
  thesops.sem_op = 1;
  thesops.sem_flg = SEM_UNDO;
  semop(semid, &thesops, 1);
}


x86 assembly (clang, -O0):
<v_operate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_operate>:
sub    $0x18,%rsp
mov    %esi,0x10(%rsp)
movl   $0x1,0x8(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @v_operate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sembuf
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 2
store i32 %6, i32* %7
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 0
store i32 1, i32* %8
%9 = load i32, i32* @SEM_UNDO
%10 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %5, i32 0, i32 1
store i32 %9, i32* %10
%11 = load i32, i32* %3
%12 = call i32 @semop(i32 %11, %struct.sembuf* %5, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@SEM_UNDO = global i32 0
define void @v_operate(i32 %0, i32 %1) {
%3 = alloca %struct.sembuf
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 2
store i32 %1, i32* %5
%6 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 0
store i32 1, i32* %6
%7 = load i32, i32* @SEM_UNDO
%8 = getelementptr inbounds %struct.sembuf, %struct.sembuf* %3, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @semop(i32 %0, %struct.sembuf* %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_dec_bc(void) { op_write1(0x0b); }


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

x86 assembly (clang, -O2):
<op_enc_dec_bc>:
mov    $0xb,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_dec_bc() {
%1 = call i32 @op_write1(i32 11)
ret void
}

LLVM IR (-O2):
define void @op_enc_dec_bc() {
%1 = tail call i32 @op_write1(i32 11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_KEEPALIVE;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int tcp_keepalive(int fd, int val) {
  if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &val, sizeof(val)) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tcp_keepalive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1157 <tcp_keepalive+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <tcp_keepalive+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_keepalive>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @tcp_keepalive(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* %4
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_KEEPALIVE
%9 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, i32* %5, i32 4)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 -1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_KEEPALIVE = global i32 0
define i32 @tcp_keepalive(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_KEEPALIVE
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %3, i32 4)
%7 = icmp eq i32 %6, -1
%8 = sext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int get_key(int /*<<< orphan*/ *, int, int, int, unsigned char *);
int get_RSA2048_P(FILE *fp, int *key_off, int *key_name_off,
                  unsigned char *RSA2048_P) {
  return get_key(fp, key_off[3] + 5, key_name_off[4], 128, RSA2048_P);
}


x86 assembly (clang, -O0):
<get_RSA2048_P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%esi
add    $0x5,%esi
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edx
mov    -0x20(%rbp),%r8
mov    $0x80,%ecx
call   1030 <get_key@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_RSA2048_P>:
mov    %rcx,%r8
mov    0xc(%rsi),%esi
add    $0x5,%esi
mov    0x10(%rdx),%edx
mov    $0x80,%ecx
jmp    1030 <get_key@plt>

LLVM IR (-O0):
define i32 @get_RSA2048_P(i32* %0, i32* %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 3
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 5
%14 = load i32*, i32** %7
%15 = getelementptr inbounds i32, i32* %14, i64 4
%16 = load i32, i32* %15
%17 = load i8*, i8** %8
%18 = call i32 @get_key(i32* %9, i32 %13, i32 %16, i32 128, i8* %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_RSA2048_P(i32* %0, i32* nocapture %1, i32* nocapture %2, i8* %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 3
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 5
%8 = getelementptr inbounds i32, i32* %2, i64 4
%9 = load i32, i32* %8
%10 = tail call i32 @get_key(i32* %0, i32 %7, i32 %9, i32 128, i8* %3)
ret i32 %10
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int ds1672_set_mmss(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ to_i2c_client(struct device *);
int ds1672_rtc_set_mmss(struct device *dev, unsigned long secs) {
  return ds1672_set_mmss(to_i2c_client(dev), secs);
}


x86 assembly (clang, -O0):
<ds1672_rtc_set_mmss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <to_i2c_client@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <ds1672_set_mmss@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1672_rtc_set_mmss>:
push   %rbx
mov    %rsi,%rbx
call   1040 <to_i2c_client@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <ds1672_set_mmss@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
define i32 @ds1672_rtc_set_mmss(%struct.device* %0, i64 %1) {
%3 = alloca %struct.device*
%4 = alloca i64
store %struct.device* %0, %struct.device** %3
store i64 %1, i64* %4
%5 = load %struct.device*, %struct.device** %3
%6 = call i32 @to_i2c_client(%struct.device* %5)
%7 = load i64, i64* %4
%8 = call i32 @ds1672_set_mmss(i32 %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @ds1672_rtc_set_mmss(%struct.device* %0, i64 %1) {
%3 = tail call i32 @to_i2c_client(%struct.device* %0)
%4 = tail call i32 @ds1672_set_mmss(i32 %3, i64 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mes(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int num;
  printf("Digite um número de 1 a 12: ");
  scanf("%d", &num);
  mes(num);
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <mes@plt>
lea    0xea7(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <mes@plt>
lea    0xeb3(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Digite um n\C3\BAmero de 1 a 12: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @mes(i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Digite um n\C3\BAmero de 1 a 12: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @mes(i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void putLDCharLM(void) { printf("\x01B(0\x074\x01B(B"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"\1B(0t\1B(B\00"
define void @putLDCharLM() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char nome[100];
  printf("Digite seu nome completo:\n");
  gets(nome);
  printf("\nO nome digitado foi: %s\n", nome);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x70(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Digite seu nome completo:\0A\00"
@.str.1 = [26 x i8] c"\0AO nome digitado foi: %s\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"\0AO nome digitado foi: %s\0A\00"
@str = [26 x i8] c"Digite seu nome completo:\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}