xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int WEOF;
wint_t btowc(int c) { return (c >= 0 && c < 128) ? c : WEOF; }


x86 assembly (clang, -O0):
<btowc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1129 <btowc+0x29>
cmpl   $0x80,-0x4(%rbp)
jge    1129 <btowc+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <btowc+0x35>
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<btowc>:
mov    %edi,%eax
cmp    $0x80,%edi
jb     1113 <btowc+0x13>
mov    0x2ecf(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@WEOF = global i32 0
define i32 @btowc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i32, i32* %2
br label %12
10: ; preds = %5, %1
%11 = load i32, i32* @WEOF
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
@WEOF = global i32 0
define i32 @btowc(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = load i32, i32* @WEOF
%4 = select i1 %2, i32 %0, i32 %3
ret i32 %4
}
/* Variables and functions */
int check(char *);
int /*<<< orphan*/ printf(char *);
int main(int ac, char **av) {
  int ret;
  if (ac != 2)
    return -1;
  ret = check(av[1]);
  if (ret == 0xad6d)
    printf("Win\n");
  else
    printf("fail\n");
  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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    118d <main+0x6d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <check@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xad6d,-0x14(%rbp)
jne    117a <main+0x5a>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    1186 <main+0x66>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
jne    1156 <main+0x36>
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <check@plt>
cmp    $0xad6d,%eax
lea    0xec5(%rip),%rax
lea    0xeb9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Win\0A\00"
@.str.1 = [6 x i8] c"fail\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
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %22
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @check(i8* %13)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 44397
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %10
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %9
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@str = [5 x i8] c"fail\00"
@str.2 = [4 x i8] c"Win\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @check(i8* %6)
%8 = icmp eq i32 %7, 44397
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0)
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %4, %2
%12 = phi i32 [ -1, %2 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void welcome(char *nick) {
  printf("		%s \n\n", nick);
  printf("  **********************************\n  "
         " |\t\t\t\t  |\n  "
         " !\tC PIPE CHATTING CODE      |\n  "
         " |\t\t\t\t  !\n  "
         " \\______________________________/ \n");
  printf("\t\t\tq to quit");
  printf("\n\n");
}


x86 assembly (clang, -O0):
<welcome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<welcome>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\09\09%s \0A\0A\00"
@.str.1 = [132 x i8] c" **********************************\0A |\09\09\09\09 |\0A !\09C PIPE CHATTING CODE |\0A |\09\09\09\09 !\0A \\______________________________/ \0A\00"
@.str.2 = [13 x i8] c"\09\09\09q to quit\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @welcome(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\09\09%s \0A\0A\00"
@.str.2 = [13 x i8] c"\09\09\09q to quit\00"
@str = [131 x i8] c" **********************************\0A |\09\09\09\09 |\0A !\09C PIPE CHATTING CODE |\0A |\09\09\09\09 !\0A \\______________________________/ \00"
@str.4 = [2 x i8] c"\0A\00"
define void @welcome(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([131 x i8], [131 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
ret void
}
float inch2mm(float inch) { return inch * 25.4f; }


x86 assembly (clang, -O0):
<inch2mm>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inch2mm>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @inch2mm(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x4039666660000000
ret float %4
}

LLVM IR (-O2):
define float @inch2mm(float %0) {
%2 = fmul float %0, 0x4039666660000000
ret float %2
}
int isNum(char c) {
  int ascii = (int)c;
  ascii -= (int)'0';
  if (ascii >= 0 && ascii <= 9) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isNum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     113a <isNum+0x3a>
cmpl   $0x9,-0xc(%rbp)
jg     113a <isNum+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <isNum+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNum(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 48
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 9
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 1, i32* %2
br label %16
15: ; preds = %11, %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @isNum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct ip {
  int /*<<< orphan*/ ip_off;
};

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
void set_ip_frag_off(struct ip *self) { self->ip_off = htons(0); }


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

x86 assembly (clang, -O2):
<set_ip_frag_off>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.ip = type { i32 }
define void @set_ip_frag_off(%struct.ip* %0) {
%2 = alloca %struct.ip*
store %struct.ip* %0, %struct.ip** %2
%3 = call i32 @htons(i32 0)
%4 = load %struct.ip*, %struct.ip** %2
%5 = getelementptr inbounds %struct.ip, %struct.ip* %4, i32 0, i32 0
store i32 %3, i32* %5
ret void
}

LLVM IR (-O2):
%struct.ip = type { i32 }
define void @set_ip_frag_off(%struct.ip* nocapture writeonly %0) {
%2 = tail call i32 @htons(i32 0)
%3 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0
store i32 %2, i32* %3
ret void
}
void main() {
  int i, j;
  struct lines {
    int *x;
    int *y;
  } * l1;
  struct lines l;
  int x = 20;
  int y = 20;
  l1 = &l;
  l.x = &x;
  l.y = &y;
  y = 21;
  y = (l1->x);
  print(*l.y);
  print("end");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x14,-0x24(%rbp)
movl   $0x14,-0x28(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x15,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <print@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x14,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %eax,%eax
call   1030 <print@plt>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.lines = type { i32*, i32* }
@.str = [4 x i8] c"end\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.lines*
%4 = alloca %struct.lines
%5 = alloca i32
%6 = alloca i32
store i32 20, i32* %5
store i32 20, i32* %6
store %struct.lines* %4, %struct.lines** %3
%7 = getelementptr inbounds %struct.lines, %struct.lines* %4, i32 0, i32 0
store i32* %5, i32** %7
%8 = getelementptr inbounds %struct.lines, %struct.lines* %4, i32 0, i32 1
store i32* %6, i32** %8
store i32 21, i32* %6
%9 = load %struct.lines*, %struct.lines** %3
%10 = getelementptr inbounds %struct.lines, %struct.lines* %9, i32 0, i32 0
%11 = load i32*, i32** %10
%12 = ptrtoint i32* %11 to i32
store i32 %12, i32* %6
%13 = getelementptr inbounds %struct.lines, %struct.lines* %4, i32 0, i32 1
%14 = load i32*, i32** %13
%15 = load i32, i32* %14
%16 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 %15)
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.lines = type { i32*, i32* }
@.str = [4 x i8] c"end\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 20, i32* %1
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 %4)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct rq_asset_recovery_rate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ rq_asset_recovery_rate_free(struct rq_asset_recovery_rate *);
void rq_asset_recovery_rate_freefunc(void *asset_data) {
  rq_asset_recovery_rate_free((struct rq_asset_recovery_rate *)asset_data);
}


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

x86 assembly (clang, -O2):
<rq_asset_recovery_rate_freefunc>:
jmp    1030 <rq_asset_recovery_rate_free@plt>

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

LLVM IR (-O2):
%struct.rq_asset_recovery_rate = type { i32 }
define void @rq_asset_recovery_rate_freefunc(i8* %0) {
%2 = bitcast i8* %0 to %struct.rq_asset_recovery_rate*
%3 = tail call i32 @rq_asset_recovery_rate_free(%struct.rq_asset_recovery_rate* %2)
ret void
}
void llist(char *formula, char *range) {
  char *f = formula;
  char *r = range;
}


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

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

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

LLVM IR (-O2):
define void @llist(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test27_AvrPin_clear__E();
int /*<<< orphan*/ test27_AvrPin_makeOutput__E();
void test27_Blink3_targetInit__I() {
  test27_AvrPin_clear__E();
  test27_AvrPin_makeOutput__E();
}


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

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

LLVM IR (-O0):
define void @test27_Blink3_targetInit__I() {
%1 = call i32 (...) @test27_AvrPin_clear__E()
%2 = call i32 (...) @test27_AvrPin_makeOutput__E()
ret void
}

LLVM IR (-O2):
define void @test27_Blink3_targetInit__I() {
%1 = tail call i32 (...) @test27_AvrPin_clear__E()
%2 = tail call i32 (...) @test27_AvrPin_makeOutput__E()
ret void
}
/* Variables and functions */
size_t _itoa(int, char *);
void itoa(int value, char *buffer) { buffer[_itoa(value, buffer)] = 0; }


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <_itoa@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
push   %rbx
mov    %rsi,%rbx
call   1030 <_itoa@plt>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @itoa(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i64 @_itoa(i32 %6, i8* %7)
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @itoa(i32 %0, i8* %1) {
%3 = tail call i64 @_itoa(i32 %0, i8* %1)
%4 = getelementptr inbounds i8, i8* %1, i64 %3
store i8 0, i8* %4
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int bsd_syscall_getpeername(int, struct sockaddr *, int /*<<< orphan*/ *);
int uptcp_getpeername(int s, struct sockaddr *asa, socklen_t *alen) {
  return bsd_syscall_getpeername(s, asa, alen);
}


x86 assembly (clang, -O0):
<uptcp_getpeername>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <bsd_syscall_getpeername@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptcp_getpeername>:
jmp    1030 <bsd_syscall_getpeername@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @uptcp_getpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @bsd_syscall_getpeername(i32 %7, %struct.sockaddr* %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @uptcp_getpeername(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @bsd_syscall_getpeername(i32 %0, %struct.sockaddr* %1, i32* %2)
ret i32 %4
}
/* Variables and functions */
int STC31xx_Write(int, int, unsigned char *);
int STC31xx_WriteWord16(int RegAddress, int Value) {
  int res;
  unsigned char data[2];
  data[0] = Value & 0xff;
  data[1] = (Value >> 8) & 0xff;
  res = STC31xx_Write(2, RegAddress, data);
  return (res);
}


x86 assembly (clang, -O0):
<STC31xx_WriteWord16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xe(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%esi
lea    -0xe(%rbp),%rdx
mov    $0x2,%edi
call   1030 <STC31xx_Write@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC31xx_WriteWord16>:
push   %rax
mov    %edi,%eax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdx
mov    $0x2,%edi
mov    %eax,%esi
call   1030 <STC31xx_Write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC31xx_WriteWord16(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [2 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 1
store i8 %14, i8* %15
%16 = load i32, i32* %3
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
%18 = call i32 @STC31xx_Write(i32 2, i32 %16, i8* %17)
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @STC31xx_WriteWord16(i32 %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = lshr i32 %1, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @STC31xx_Write(i32 2, i32 %0, i8* %4)
ret i32 %9
}
void eneg(x) unsigned short x[];
{
  if (eisnan(x))
    return;
  x[6 - 1] ^= 0x8000;
}


x86 assembly (clang, -O0):
<eneg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <eisnan@plt>
cmp    $0x0,%eax
je     1135 <eneg+0x25>
jmp    1147 <eneg+0x37>
mov    -0x8(%rbp),%rax
movzwl 0xa(%rax),%ecx
xor    $0x8000,%ecx
mov    %cx,0xa(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eneg>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <eisnan@plt>
test   %eax,%eax
je     1121 <eneg+0x11>
pop    %rbx
ret
xorb   $0x80,0xb(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @eneg(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 (i16*, ...) bitcast (i32 (...)* @eisnan to i32 (i16*, ...)*)(i16* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %14
7: ; preds = %1
%8 = load i16*, i16** %2
%9 = getelementptr inbounds i16, i16* %8, i64 5
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = xor i32 %11, 32768
%13 = trunc i32 %12 to i16
store i16 %13, i16* %9
br label %14
14: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @eneg(i16* %0) {
%2 = tail call i32 (i16*, ...) bitcast (i32 (...)* @eisnan to i32 (i16*, ...)*)(i16* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i16, i16* %0, i64 5
%6 = load i16, i16* %5
%7 = xor i16 %6, -32768
store i16 %7, i16* %5
br label %8
8: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void f9(int a, int b) {
  if (b >= 4)
    if ((a / b) == 0x7fffffff / 2)
      link_error();
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jl     1146 <f9+0x36>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x3fffffff,%eax
jne    1141 <f9+0x31>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    1146 <f9+0x36>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f9(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sge i32 %5, 4
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
%11 = icmp eq i32 %10, 1073741823
br i1 %11, label %12, label %14
12: ; preds = %7
%13 = call i32 (...) @link_error()
br label %14
14: ; preds = %12, %7
br label %15
15: ; preds = %14, %2
ret void
}

LLVM IR (-O2):
define void @f9(i32 %0, i32 %1) {
ret void
}
unsigned int readu2(unsigned char *p) { return p[0] | p[1] << 8; }


x86 assembly (clang, -O0):
<readu2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readu2>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @readu2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @readu2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
void dichotomy(int ordered[]) { int max, mid, min; }


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

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

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

LLVM IR (-O2):
define void @dichotomy(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 1;
  short b = 2;
  char c = 3;
  assert((a ? b : c) == b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movw   $0x2,-0xa(%rbp)
movb   $0x3,-0xb(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1146 <main+0x36>
movswl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x3d>
movsbl -0xb(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
movswl -0xa(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
store i16 2, i16* %3
store i8 3, i8* %4
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
br label %13
10: ; preds = %0
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
br label %13
13: ; preds = %10, %7
%14 = phi i32 [ %9, %7 ], [ %12, %10 ]
%15 = load i16, i16* %3
%16 = sext i16 %15 to i32
%17 = icmp eq i32 %14, %16
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int CountWideChars(void const *);
char *string_from_wchar(void const *, int);
char *CreateAnsiFromWide(const void *wcharbuf) {
  return string_from_wchar(wcharbuf, CountWideChars(wcharbuf) * 2);
}


x86 assembly (clang, -O0):
<CreateAnsiFromWide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CountWideChars@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
shl    $0x1,%esi
call   1040 <string_from_wchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateAnsiFromWide>:
push   %rbx
mov    %rdi,%rbx
call   1030 <CountWideChars@plt>
lea    (%rax,%rax,1),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <string_from_wchar@plt>

LLVM IR (-O0):
define i8* @CreateAnsiFromWide(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @CountWideChars(i8* %4)
%6 = mul nsw i32 %5, 2
%7 = call i8* @string_from_wchar(i8* %3, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @CreateAnsiFromWide(i8* %0) {
%2 = tail call i32 @CountWideChars(i8* %0)
%3 = shl nsw i32 %2, 1
%4 = tail call i8* @string_from_wchar(i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *int_to_char(int n, char *s) {
  sprintf(s, "%d", n);
  return (s);
}


x86 assembly (clang, -O0):
<int_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_char>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @int_to_char(i32 %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %1
}
/* Variables and functions */
int write(int, int *, int);
int fdputc(int c, int fd) { return write(fd, &c, 1); }


x86 assembly (clang, -O0):
<fdputc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x4(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdputc>:
push   %rax
mov    %esi,%eax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fdputc(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @write(i32 %1, i32* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char *x = "hack";
  char *y = *(&x);
  printf("%p\t%p", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeed(%rip),%rdi
lea    0xee1(%rip),%rdx
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"hack\00"
@.str.1 = [6 x i8] c"%p\09%p\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SerialDataBegin();
int /*<<< orphan*/ SerialDataEnd();
int /*<<< orphan*/ SerialWriteChar(unsigned long);
void SerialSendDataByte(unsigned long data) {
  SerialDataBegin();
  SerialWriteChar(data);
  SerialDataEnd();
}


x86 assembly (clang, -O0):
<SerialSendDataByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <SerialDataBegin@plt>
mov    -0x8(%rbp),%rdi
call   1050 <SerialWriteChar@plt>
mov    $0x0,%al
call   1030 <SerialDataEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerialSendDataByte>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <SerialDataBegin@plt>
mov    %rbx,%rdi
call   1050 <SerialWriteChar@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <SerialDataEnd@plt>

LLVM IR (-O0):
define void @SerialSendDataByte(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 (...) @SerialDataBegin()
%4 = load i64, i64* %2
%5 = call i32 @SerialWriteChar(i64 %4)
%6 = call i32 (...) @SerialDataEnd()
ret void
}

LLVM IR (-O2):
define void @SerialSendDataByte(i64 %0) {
%2 = tail call i32 (...) @SerialDataBegin()
%3 = tail call i32 @SerialWriteChar(i64 %0)
%4 = tail call i32 (...) @SerialDataEnd()
ret void
}
/* Variables and functions */
int _mx_strbeginswith(char *, char const *, char **, int);
int mx_stribeginswith(char *str, const char *start, char **endptr) {
  return _mx_strbeginswith(str, start, endptr, 1);
}


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

x86 assembly (clang, -O2):
<mx_stribeginswith>:
mov    $0x1,%ecx
jmp    1030 <_mx_strbeginswith@plt>

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

LLVM IR (-O2):
define i32 @mx_stribeginswith(i8* %0, i8* %1, i8** %2) {
%4 = tail call i32 @_mx_strbeginswith(i8* %0, i8* %1, i8** %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_72() {
  Assert_real((isqrt(72) == 8),
              "/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/stdlib/isqrt.c",
              365, ("Integer square root of 72 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_72>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x16d,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_72>:
push   %rax
mov    $0x48,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x16d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 72 should be 8\00"
define void @t_sqrt_72() {
%1 = call i32 @isqrt(i32 72)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 72 should be 8\00"
define void @t_sqrt_72() {
%1 = tail call i32 @isqrt(i32 72)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 365, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int InvertLowestOne(int n) { return n & (n - 1); }


x86 assembly (clang, -O0):
<InvertLowestOne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvertLowestOne>:
lea    -0x1(%rdi),%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @InvertLowestOne(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = and i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SevenFunction();
void EightFunction() { SevenFunction(); }


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

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

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

LLVM IR (-O2):
define void @EightFunction() {
%1 = tail call i32 (...) @SevenFunction()
ret void
}
double ratio(int original, int compressed) {
  return ((double)(original - compressed) / (double)original);
}


x86 assembly (clang, -O0):
<ratio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ratio>:
cvtsi2sd %edi,%xmm1
sub    %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ratio(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
ret double %11
}

LLVM IR (-O2):
define double @ratio(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = sitofp i32 %3 to double
%5 = sitofp i32 %0 to double
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int randomized_partition(int *, int, int);
void randomized_quick_sort(int nums[], int begin, int end) {
  if (begin < end) {
    int p = randomized_partition(nums, begin, end);
    randomized_quick_sort(nums, begin, p);
    randomized_quick_sort(nums, p + 1, end);
  }
}


x86 assembly (clang, -O0):
<randomized_quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1171 <randomized_quick_sort+0x51>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <randomized_partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <randomized_quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <randomized_quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomized_quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1165 <randomized_quick_sort+0x45>
mov    %edx,%r14d
mov    %esi,%ebx
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r14d,%edx
call   1040 <randomized_partition@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <randomized_quick_sort@plt>
add    $0x1,%ebp
mov    %ebp,%ebx
cmp    %r14d,%ebp
jl     1140 <randomized_quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @randomized_quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %10
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ %1, %3 ]
%7 = tail call i32 @randomized_partition(i32* %0, i32 %6, i32 %2)
tail call void @randomized_quick_sort(i32* %0, i32 %6, i32 %7)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %8, %2
br i1 %9, label %5, label %10
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Welcome to linux world\n");
  printf("pid %d\n", getpid());
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Welcome to linux world\0A\00"
@.str.1 = [8 x i8] c"pid %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getpid()
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"pid %d\0A\00"
@str = [23 x i8] c"Welcome to linux world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 9;
  int b = 1;
  printf("pre-swap: %d %d\n", a, b);
  swap(&a, &b);
  printf("post-swap: %d %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x9,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0xec9(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <swap@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"pre-swap: %d %d\0A\00"
@.str.1 = [18 x i8] c"post-swap: %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 9, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 9, i32 1)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char nome[30];
  printf("Digite seu nome: ");
  scanf("$s", nome);
  printf("Seja bem vindo(a) a diciplina de algoritimo de Lógica de Programação "
         "II ",
         nome);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Digite seu nome: \00"
@.str.1 = [3 x i8] c"$s\00"
@.str.2 = [76 x i8] c"Seja bem vindo(a) a diciplina de algoritimo de L\C3\B3gica de Programa\C3\A7\C3\A3o II \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Digite seu nome: \00"
@.str.1 = [3 x i8] c"$s\00"
@.str.2 = [76 x i8] c"Seja bem vindo(a) a diciplina de algoritimo de L\C3\B3gica de Programa\C3\A7\C3\A3o II \00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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), i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.2, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int ax2om(double *, double *, int);
int ro2ax(double *, double *, int);
int ro2om(double *ro, double *om, int p) {
  double ax[4];
  int trash;
  trash = ro2ax(ro, ax, p);
  trash = ax2om(ax, om, p);
  return 1;
}


x86 assembly (clang, -O0):
<ro2om>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <ro2ax@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ax2om@plt>
mov    %eax,-0x44(%rbp)
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ro2om>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <ro2ax@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <ax2om@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @ro2om(double* %0, double* %1, i32 %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32
%7 = alloca [4 x double]
%8 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32 %2, i32* %6
%9 = load double*, double** %4
%10 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%11 = load i32, i32* %6
%12 = call i32 @ro2ax(double* %9, double* %10, i32 %11)
store i32 %12, i32* %8
%13 = getelementptr inbounds [4 x double], [4 x double]* %7, i64 0, i64 0
%14 = load double*, double** %5
%15 = load i32, i32* %6
%16 = call i32 @ax2om(double* %13, double* %14, i32 %15)
store i32 %16, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @ro2om(double* %0, double* %1, i32 %2) {
%4 = alloca [4 x double]
%5 = bitcast [4 x double]* %4 to i8*
%6 = getelementptr inbounds [4 x double], [4 x double]* %4, i64 0, i64 0
%7 = call i32 @ro2ax(double* %0, double* %6, i32 %2)
%8 = call i32 @ax2om(double* %6, double* %1, i32 %2)
ret i32 1
}