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

/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void play_sound(uint32_t nFrequence) {
  uint32_t Div;
  uint8_t tmp;
  Div = 1193180 / nFrequence;
  outb(0x43, 0xb6);
  outb(0x42, (uint8_t)(Div));
  outb(0x42, (uint8_t)(Div >> 8));
  tmp = inb(0x61);
  if (tmp != (tmp | 3)) {
    outb(0x61, tmp | 3);
  }
}


x86 assembly (clang, -O0):
<play_sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1234dc,%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x8(%rbp)
mov    $0x43,%edi
mov    $0xb6,%esi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
mov    $0x42,%edi
call   1030 <outb@plt>
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
mov    $0x42,%edi
call   1030 <outb@plt>
mov    $0x61,%edi
call   1040 <inb@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
or     $0x3,%ecx
cmp    %ecx,%eax
je     1191 <play_sound+0x71>
mov    -0xc(%rbp),%esi
or     $0x3,%esi
mov    $0x61,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play_sound>:
push   %rbx
mov    $0x1234dc,%eax
xor    %edx,%edx
idiv   %edi
mov    %eax,%ebx
mov    $0x43,%edi
mov    $0xb6,%esi
call   1030 <outb@plt>
mov    $0x42,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
sar    $0x8,%ebx
mov    $0x42,%edi
mov    %ebx,%esi
call   1030 <outb@plt>
mov    $0x61,%edi
call   1040 <inb@plt>
mov    %eax,%esi
or     $0x3,%esi
cmp    %esi,%eax
jne    116b <play_sound+0x4b>
pop    %rbx
ret
mov    $0x61,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @play_sound(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 1193180, %5
store i32 %6, i32* %3
%7 = call i32 @outb(i32 67, i32 182)
%8 = load i32, i32* %3
%9 = call i32 @outb(i32 66, i32 %8)
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = call i32 @outb(i32 66, i32 %11)
%13 = call i32 @inb(i32 97)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = or i32 %15, 3
%17 = icmp ne i32 %14, %16
br i1 %17, label %18, label %22
18: ; preds = %1
%19 = load i32, i32* %4
%20 = or i32 %19, 3
%21 = call i32 @outb(i32 97, i32 %20)
br label %22
22: ; preds = %18, %1
ret void
}

LLVM IR (-O2):
define void @play_sound(i32 %0) {
%2 = sdiv i32 1193180, %0
%3 = tail call i32 @outb(i32 67, i32 182)
%4 = tail call i32 @outb(i32 66, i32 %2)
%5 = ashr i32 %2, 8
%6 = tail call i32 @outb(i32 66, i32 %5)
%7 = tail call i32 @inb(i32 97)
%8 = or i32 %7, 3
%9 = icmp eq i32 %7, %8
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 @outb(i32 97, i32 %8)
br label %12
12: ; preds = %10, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test_concur(char *);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "usage: %s <host ip>\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  test_concur(argv[1]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117a <main+0x4a>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <test_concur@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     115c <main+0x2c>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <test_concur@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s <host ip>\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @test_concur(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: %s <host ip>\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @test_concur(i8* %12)
%14 = tail call i32 @exit(i32 0)
unreachable
}
int fun907() { return 907; }


x86 assembly (clang, -O0):
<fun907>:
push   %rbp
mov    %rsp,%rbp
mov    $0x38b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun907() {
ret i32 907
}

LLVM IR (-O2):
define i32 @fun907() {
ret i32 907
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int __attribute__((no)) bar(int local_p, int **q) {
  int x = 0;
  int *j;
  int **p;
  if (local_p)
    p = &j;
  else
    p = q;
  *p = &x;
  foo();
  return x;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113d <bar+0x2d>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1145 <bar+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
lea    -0x14(%rbp),%rcx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
test   %edi,%edi
lea    0x10(%rsp),%rax
cmove  %rsi,%rax
lea    0xc(%rsp),%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
call   1030 <foo@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32** nocapture writeonly %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%6 = bitcast i32** %4 to i8*
%7 = icmp eq i32 %0, 0
%8 = select i1 %7, i32** %1, i32** %4
store i32* %3, i32** %8
%9 = call i32 (...) @foo()
%10 = load i32, i32* %3
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ puts(char *);
DIR *opendir(const char *dirname) {
  (void)dirname;
  puts("opendir: not implemented");
  return NULL;
}


x86 assembly (clang, -O0):
<opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"opendir: not implemented\00"
define i32* @opendir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32* null
}

LLVM IR (-O2):
@.str = [25 x i8] c"opendir: not implemented\00"
define noalias i32* @opendir(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32* null
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
scalar_t__ bson_find_field(char *, char *, int);
int bson_find_field_as_int64(char *buffer, char *field, int64_t *data) {
  char *tmp = (char *)bson_find_field(buffer, field, 0x12);
  if (tmp) {
    *data = ((int64_t *)tmp)[0];
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bson_find_field_as_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x12,%edx
call   1030 <bson_find_field@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     115d <bson_find_field_as_int64+0x4d>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1164 <bson_find_field_as_int64+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bson_find_field_as_int64>:
push   %rbx
mov    %rdx,%rbx
mov    $0x12,%edx
call   1030 <bson_find_field@plt>
test   %rax,%rax
je     112e <bson_find_field_as_int64+0x1e>
mov    (%rax),%eax
mov    %eax,(%rbx)
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bson_find_field_as_int64(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 = load i8*, i8** %6
%11 = call i64 @bson_find_field(i8* %9, i8* %10, i32 18)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load i8*, i8** %8
%17 = bitcast i8* %16 to i32*
%18 = getelementptr inbounds i32, i32* %17, i64 0
%19 = load i32, i32* %18
%20 = load i32*, i32** %7
store i32 %19, i32* %20
store i32 1, i32* %4
br label %22
21: ; preds = %3
store i32 0, i32* %4
br label %22
22: ; preds = %21, %15
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @bson_find_field_as_int64(i8* %0, i8* %1, i32* nocapture writeonly %2) {
%4 = tail call i64 @bson_find_field(i8* %0, i8* %1, i32 18)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = inttoptr i64 %4 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %2
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void send_message_self(const char *message, int conn_fd) {
  write(conn_fd, message, strlen(message));
}


x86 assembly (clang, -O0):
<send_message_self>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_message_self>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @send_message_self(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
float _ceilf(float x) {
  float y;
  y = x;
  if (x < (float)0.0) {
    y = -y;
  }
  if (y >= (float)16777216.0) {
    return x;
  }
  y = ((float)(((long)(x))));
  if (y < x) {
    y = ((float)(y) + (float)(1.0));
  }
  return y;
}


x86 assembly (clang, -O0):
<_ceilf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1137 <_ceilf+0x37>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xebc(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     115c <_ceilf+0x5c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    119b <_ceilf+0x9b>
cvttss2si -0x8(%rbp),%rax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1191 <_ceilf+0x91>
movss  0xe7d(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ceilf>:
movaps 0xef9(%rip),%xmm1
xorps  %xmm0,%xmm1
xorps  %xmm2,%xmm2
movaps %xmm0,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm1
andnps %xmm0,%xmm3
orps   %xmm1,%xmm3
ucomiss 0xeeb(%rip),%xmm3
jae    1154 <_ceilf+0x54>
cvttss2si %xmm0,%rax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
movss  0xed8(%rip),%xmm2
addss  %xmm1,%xmm2
movaps %xmm1,%xmm3
cmpltss %xmm0,%xmm3
andps  %xmm3,%xmm2
andnps %xmm1,%xmm3
orps   %xmm2,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @_ceilf(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
store float %5, float* %4
%6 = load float, float* %3
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load float, float* %4
%10 = fneg float %9
store float %10, float* %4
br label %11
11: ; preds = %8, %1
%12 = load float, float* %4
%13 = fcmp oge float %12, 0x4170000000000000
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load float, float* %3
store float %15, float* %2
br label %28
16: ; preds = %11
%17 = load float, float* %3
%18 = fptosi float %17 to i64
%19 = sitofp i64 %18 to float
store float %19, float* %4
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fcmp olt float %20, %21
br i1 %22, label %23, label %26
23: ; preds = %16
%24 = load float, float* %4
%25 = fadd float %24, 1.000000e+00
store float %25, float* %4
br label %26
26: ; preds = %23, %16
%27 = load float, float* %4
store float %27, float* %2
br label %28
28: ; preds = %26, %14
%29 = load float, float* %2
ret float %29
}

LLVM IR (-O2):
define float @_ceilf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fcmp ult float %4, 0x4170000000000000
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = fptosi float %0 to i64
%8 = sitofp i64 %7 to float
%9 = fcmp olt float %8, %0
%10 = fadd float %8, 1.000000e+00
%11 = select i1 %9, float %10, float %8
br label %12
12: ; preds = %1, %6
%13 = phi float [ %11, %6 ], [ %0, %1 ]
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_if_not_null(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<free_if_not_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_if_not_null+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_if_not_null>:
test   %rdi,%rdi
je     111a <free_if_not_null+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_if_not_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_if_not_null(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void p(void *e) {
  int *i = e;
  printf("%d ", *i);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x72() {
  Assert_real((isbdigit(114) == 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_isbdigit.c",
              575, ("isbdigit should be 0 for r"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0x72>:
push   %rax
mov    $0x72,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x23f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for r\00"
define void @t_isbdigit_0x72() {
%1 = tail call i64 @isbdigit(i32 114)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 575, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int foo();
int lib2() { return foo(); }


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

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

LLVM IR (-O0):
define i32 @lib2() {
%1 = call i32 (...) @foo()
ret i32 %1
}

LLVM IR (-O2):
define i32 @lib2() {
%1 = tail call i32 (...) @foo()
ret i32 %1
}
long long trans_endian(long long input) {
  union {
    long long llong_value;
    char byte_value[8];
  } before, after;
  int loopcnt;
  before.llong_value = input;
  for (loopcnt = 0; loopcnt < 8; loopcnt++) {
    after.byte_value[7 - loopcnt] = before.byte_value[loopcnt];
  }
  return (after.llong_value);
}


x86 assembly (clang, -O0):
<trans_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1145 <trans_endian+0x45>
movslq -0x1c(%rbp),%rax
mov    -0x10(%rbp,%rax,1),%cl
mov    $0x7,%eax
sub    -0x1c(%rbp),%eax
cltq
mov    %cl,-0x18(%rbp,%rax,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <trans_endian+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @trans_endian(i64 %0) {
%2 = call i64 @llvm.bswap.i64(i64 %0)
ret i64 %2
}
void cafebabe_constant_info_field_ref_deinit(
    struct cafebabe_constant_info_field_ref *r) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo6a() {
ret void
}
void GPIOPortP2_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<GPIOPortP2_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <GPIOPortP2_Handler+0x9>
jmp    1109 <GPIOPortP2_Handler+0x9>

x86 assembly (clang, -O2):
<GPIOPortP2_Handler>:
jmp    1100 <GPIOPortP2_Handler>

LLVM IR (-O0):
define void @GPIOPortP2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @GPIOPortP2_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void destroyRoom(char **currentRoom, int roomY) {
  for (int i = 0; i < roomY; i++) {
    free(currentRoom[i]);
  }
  free(currentRoom);
}


x86 assembly (clang, -O0):
<destroyRoom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <destroyRoom+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <destroyRoom+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyRoom>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <destroyRoom+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <destroyRoom+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyRoom(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
void RTLdrLoad(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLdrLoad() {
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
void time_1(void) {
  time_t now;
  now = time(NULL);
  printf("It is %d\n\n\n", now);
}


x86 assembly (clang, -O0):
<time_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_1>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"It is %d\0A\0A\0A\00"
define void @time_1() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
long int uinttoint(unsigned long int i) { return (long int)i; }


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

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

LLVM IR (-O0):
define i64 @uinttoint(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @uinttoint(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_setname_np(int /*<<< orphan*/, char const *);
int linux_pthread_setname_np(pthread_t thread, const char *name) {
  return pthread_setname_np(thread, name);
}


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

x86 assembly (clang, -O2):
<linux_pthread_setname_np>:
jmp    1030 <pthread_setname_np@plt>

LLVM IR (-O0):
define i32 @linux_pthread_setname_np(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 = load i8*, i8** %4
%7 = call i32 @pthread_setname_np(i32 %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @linux_pthread_setname_np(i32 %0, i8* %1) {
%3 = tail call i32 @pthread_setname_np(i32 %0, i8* %1)
ret i32 %3
}
int int_clamp(int val, int vmin, int vmax) {
  if (val < vmin)
    return vmin;
  else if (val > vmax)
    return vmax;
  else
    return val;
}


x86 assembly (clang, -O0):
<int_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <int_clamp+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <int_clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <int_clamp+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <int_clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
int fa() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fa() {
ret i32 0
}
/* Variables and functions */
int get_left_two_digits_of_current_year(int);
int get_current_century(int optional_current_year) {
  return get_left_two_digits_of_current_year(optional_current_year) * 100;
}


x86 assembly (clang, -O0):
<get_current_century>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_left_two_digits_of_current_year@plt>
imul   $0x64,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_current_century>:
push   %rax
call   1030 <get_left_two_digits_of_current_year@plt>
imul   $0x64,%eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_current_century(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_left_two_digits_of_current_year(i32 %3)
%5 = mul nsw i32 %4, 100
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_current_century(i32 %0) {
%2 = tail call i32 @get_left_two_digits_of_current_year(i32 %0)
%3 = mul nsw i32 %2, 100
ret i32 %3
}
/* Variables and functions */
double forma(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int val;
  double res;
  printf("Entre com o numero que deseja transformar: ");
  scanf("%d", &val);
  res = forma(val);
  printf("Forma binaria: %.0lf", res);
  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   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <forma@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <forma@plt>
lea    0xecf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Entre com o numero que deseja transformar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Forma binaria: %.0lf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call double @forma(i32 %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Entre com o numero que deseja transformar: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Forma binaria: %.0lf\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 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 double @forma(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
int test_imm_62int64_lowword_mem(long long *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_62int64_lowword_mem>:
testb  $0x62,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_62int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 98
%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_62int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 98
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ InitGlobals();
int /*<<< orphan*/ ReStretch();
void Form_Load() {
  InitGlobals();
  ReStretch();
}


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

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

LLVM IR (-O0):
define void @Form_Load() {
%1 = call i32 (...) @InitGlobals()
%2 = call i32 (...) @ReStretch()
ret void
}

LLVM IR (-O2):
define void @Form_Load() {
%1 = tail call i32 (...) @InitGlobals()
%2 = tail call i32 (...) @ReStretch()
ret void
}
/* Variables and functions */
scalar_t__ calloc(int, int);
void calloc_ok1() {
  int *arr = (int *)calloc(10, sizeof(int));
  arr[0] = 0;
  arr[9] = 0;
}


x86 assembly (clang, -O0):
<calloc_ok1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x24(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_ok1>:
push   %rax
mov    $0xa,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
movl   $0x0,(%rax)
movl   $0x0,0x24(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @calloc_ok1() {
%1 = alloca i32*
%2 = call i64 @calloc(i32 10, i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 0, i32* %5
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 9
store i32 0, i32* %7
ret void
}

LLVM IR (-O2):
define void @calloc_ok1() {
%1 = tail call i64 @calloc(i32 10, i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 0, i32* %2
%3 = getelementptr inbounds i32, i32* %2, i64 9
store i32 0, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int a = 5, b = 6;
  printf("%d %d\n", a, b);
  swap(&a, &b);
  printf("%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   $0x5,-0x8(%rbp)
movl   $0x6,-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    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x5,0xc(%rsp)
movl   $0x6,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 6, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 5, i32 6)
%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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
void hdl(int sig, siginfo_t *info, void *unused) { return; }


x86 assembly (clang, -O0):
<hdl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @hdl(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
const char *partcode_path(const char *part_type) { return (NULL); }


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

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

LLVM IR (-O0):
define i8* @partcode_path(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @partcode_path(i8* nocapture readnone %0) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *i_get_time() {
  time_t time_now;
  time(&time_now);
  return (ctime(&time_now));
}


x86 assembly (clang, -O0):
<i_get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_get_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @i_get_time() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call i8* @ctime(i32* %1)
ret i8* %3
}

LLVM IR (-O2):
define i8* @i_get_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
ret i8* %4
}
int isprint(int c) {
  c &= 0x7f;
  return (c >= 32 && c < 127);
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1129 <isprint+0x29>
cmpl   $0x7f,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
and    $0x7f,%edi
cmp    $0x20,%edi
setae  %al
cmp    $0x7f,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 127
br label %10
10: ; preds = %7, %1
%11 = phi i1 [ false, %1 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = and i32 %0, 127
%3 = icmp ugt i32 %2, 31
%4 = icmp ne i32 %2, 127
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct dentry {
  int dummy;
};

/* Variables and functions */
struct dentry *dget(struct dentry *);
int /*<<< orphan*/ dput(struct dentry *);
struct dentry *bad_follow_link(struct dentry *dent, struct dentry *base,
                               unsigned int follow) {
  dput(base);
  return dget(dent);
}


x86 assembly (clang, -O0):
<bad_follow_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <dput@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dget@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.dentry = type { i32 }
define %struct.dentry* @bad_follow_link(%struct.dentry* %0, %struct.dentry* %1, i32 %2) {
%4 = tail call i32 @dput(%struct.dentry* %1)
%5 = tail call %struct.dentry* @dget(%struct.dentry* %0)
ret %struct.dentry* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_GENCB;
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_is_prime_fasttest_ex(int /*<<< orphan*/ const *, int,
                            int /*<<< orphan*/ *, int /*<<< orphan*/,
                            int /*<<< orphan*/ *);
int BN_is_prime_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
                   BN_GENCB *cb) {
  return BN_is_prime_fasttest_ex(a, checks, ctx_passed, 0, cb);
}


x86 assembly (clang, -O0):
<BN_is_prime_ex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %ecx,%ecx
call   1030 <BN_is_prime_fasttest_ex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_is_prime_ex>:
mov    %rcx,%r8
xor    %ecx,%ecx
jmp    1030 <BN_is_prime_fasttest_ex@plt>

LLVM IR (-O0):
define i32 @BN_is_prime_ex(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @BN_is_prime_fasttest_ex(i32* %9, i32 %10, i32* %11, i32 0, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @BN_is_prime_ex(i32* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @BN_is_prime_fasttest_ex(i32* %0, i32 %1, i32* %2, i32 0, i32* %3)
ret i32 %5
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tst_timespec_diff(struct timespec, struct timespec);
long long tst_timespec_to_us(int /*<<< orphan*/);
long long tst_timespec_diff_us(struct timespec t1, struct timespec t2) {
  return tst_timespec_to_us(tst_timespec_diff(t1, t2));
}


x86 assembly (clang, -O0):
<tst_timespec_diff_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <tst_timespec_diff@plt>
mov    %eax,%edi
call   1040 <tst_timespec_to_us@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_timespec_diff_us>:
push   %rax
call   1030 <tst_timespec_diff@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <tst_timespec_to_us@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i64 @tst_timespec_diff_us(i32 %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @tst_timespec_diff(i32 %8, i32 %10)
%12 = call i64 @tst_timespec_to_us(i32 %11)
ret i64 %12
}

LLVM IR (-O2):
define i64 @tst_timespec_diff_us(i32 %0, i32 %1) {
%3 = tail call i32 @tst_timespec_diff(i32 %0, i32 %1)
%4 = tail call i64 @tst_timespec_to_us(i32 %3)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/
Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__enableTxInterrupt();
void Atm128Rfa1SerialP__Uart1Interrupts__enableTxInterrupt(void) {
  Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__enableTxInterrupt();
}


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

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

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

LLVM IR (-O2):
define void @Atm128Rfa1SerialP__Uart1Interrupts__enableTxInterrupt() {
%1 = tail call i32 (...) @Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__enableTxInterrupt()
ret void
}