xunge/DecIR huggingface dataset:
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ accept(int, struct sockaddr *, int *);
int assert(char *, int /*<<< orphan*/);
int tcpAccept(struct sockaddr_in *addr, int listener) {
  socklen_t len = sizeof *addr;
  return assert("accept", accept(listener, (struct sockaddr *)addr, &len));
}


x86 assembly (clang, -O0):
<tcpAccept>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpAccept>:
push   %rax
mov    %rdi,%rax
movl   $0x4,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %esi,%edi
mov    %rax,%rsi
call   1040 <accept@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <assert@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @tcpAccept(%struct.sockaddr_in* %0, i32 %1) {
%3 = alloca %struct.sockaddr_in*
%4 = alloca i32
%5 = alloca i32
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %3
store i32 %1, i32* %4
store i32 4, i32* %5
%6 = load i32, i32* %4
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %3
%8 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%9 = call i32 @accept(i32 %6, %struct.sockaddr* %8, i32* %5)
%10 = call i32 @assert(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @tcpAccept(%struct.sockaddr_in* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%5 = bitcast %struct.sockaddr_in* %0 to %struct.sockaddr*
%6 = call i32 @accept(i32 %1, %struct.sockaddr* %5, i32* %3)
%7 = call i32 @assert(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 %7
}
/* Variables and functions */
float random_range(float, float);
float proc_uniform(void *data) {
  float a = ((float *)data)[0];
  float b = ((float *)data)[1];
  return random_range(a, b);
}


x86 assembly (clang, -O0):
<proc_uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <random_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_uniform>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
jmp    1030 <random_range@plt>

LLVM IR (-O0):
define float @proc_uniform(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to float*
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
store float %8, float* %3
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to float*
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
store float %12, float* %4
%13 = load float, float* %3
%14 = load float, float* %4
%15 = call float @random_range(float %13, float %14)
ret float %15
}

LLVM IR (-O2):
define float @proc_uniform(i8* nocapture %0) {
%2 = bitcast i8* %0 to float*
%3 = load float, float* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to float*
%6 = load float, float* %5
%7 = tail call float @random_range(float %3, float %6)
ret float %7
}
char *strbool(int value) {
  if (value == 0)
    return "no";
  else
    return "yes";
}


x86 assembly (clang, -O0):
<strbool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1121 <strbool+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strbool+0x2c>
lea    0xedb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strbool>:
test   %edi,%edi
lea    0xef7(%rip),%rcx
lea    0xef3(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
define i8* @strbool(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
define i8* @strbool(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
void global_teardown() { printf("%s: hello global teardown\n", __func__); }


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

x86 assembly (clang, -O2):
<global_teardown>:
lea    0xee9(%rip),%rdi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s: hello global teardown\0A\00"
@__func__.global_teardown = [16 x i8] c"global_teardown\00"
define void @global_teardown() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.global_teardown, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s: hello global teardown\0A\00"
@__func__.global_teardown = [16 x i8] c"global_teardown\00"
define void @global_teardown() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.global_teardown, i64 0, i64 0))
ret void
}
/* Variables and functions */
int BUFSIZ;
int read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char buf[BUFSIZ];
  int n;
  while ((n = read(0, buf, BUFSIZ)) > 0)
    write(1, buf, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rsi
mov    0x2e7a(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1040 <read@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    1191 <main+0x71>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
jmp    115b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rbx
mov    %rdx,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
xor    %edi,%edi
mov    %rbx,%rsi
nopw   0x0(%rax,%rax,1)
call   1040 <read@plt>
test   %eax,%eax
jle    1172 <main+0x52>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    (%r14),%edx
xor    %edi,%edi
mov    %rbx,%rsi
jmp    1150 <main+0x30>
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i8, i64 %6
store i64 %6, i64* %3
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* @BUFSIZ
%11 = call i32 @read(i32 0, i8* %8, i32 %10)
store i32 %11, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i32, i32* %4
%15 = call i32 @write(i32 1, i8* %8, i32 %14)
br label %9
16: ; preds = %9
store i32 0, i32* %1
%17 = load i8*, i8** %2
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
define i32 @main() {
%1 = load i32, i32* @BUFSIZ
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @read(i32 0, i8* %3, i32 %1)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @write(i32 1, i8* %3, i32 %7)
%9 = load i32, i32* @BUFSIZ
%10 = call i32 @read(i32 0, i8* %3, i32 %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %0
ret i32 0
}
f(x) {
  switch (x) {
  case 6:
  case 4:
  case 3:
  case 1:;
  }
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     1140 <f+0x40>
jmp    111b <f+0x1b>
mov    -0x8(%rbp),%eax
add    $0xfffffffd,%eax
sub    $0x2,%eax
jb     1140 <f+0x40>
jmp    112f <f+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
jne    1145 <f+0x45>
jmp    1140 <f+0x40>
jmp    1145 <f+0x45>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %5 [
i32 6, label %4
i32 4, label %4
i32 3, label %4
i32 1, label %4
]
4: ; preds = %1, %1, %1, %1
br label %5
5: ; preds = %4, %1
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int mainskel(int, char **, int /*<<< orphan*/);
int main(int argc, char *argv[]) { return mainskel(argc, argv, 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)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <mainskel@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = load i8**, i8*** %5
%8 = call i32 @mainskel(i32 %6, i8** %7, i32 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @mainskel(i32 %0, i8** %1, i32 0)
ret i32 %3
}
void base64_append(char **ou, int *line_count, char data) {
  if (*line_count == 76) {
    *(*ou)++ = '\n';
    *line_count = 0;
  }
  *(*ou)++ = data;
  (*line_count)++;
}


x86 assembly (clang, -O0):
<base64_append>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x4c,(%rax)
jne    113c <base64_append+0x3c>
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0xa,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_append>:
cmpl   $0x4c,(%rsi)
jne    1118 <base64_append+0x18>
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movb   $0xa,(%rax)
movl   $0x0,(%rsi)
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    %dl,(%rax)
addl   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @base64_append(i8** nocapture %0, i32* nocapture %1, i8 signext %2) {
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 76
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
store i8 10, i8* %7
store i32 0, i32* %1
br label %9
9: ; preds = %6, %3
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
store i8 %2, i8* %10
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushpointer8array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 8));
}


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

x86 assembly (clang, -O2):
<pushpointer8array>:
shl    $0x3,%esi
jmp    1030 <pushNarray@plt>

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

LLVM IR (-O2):
define void @pushpointer8array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
void test(int i) {
  while (i) {
    if (i - 1)
      test(0);
    i++;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <test+0x39>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     113b <test+0x2b>
xor    %edi,%edi
call   1030 <test@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <test+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
jmp    1123 <test+0x13>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x1,%ebx
je     1120 <test+0x10>
test   %ebx,%ebx
je     1135 <test+0x25>
xor    %edi,%edi
call   1030 <test@plt>
jmp    1120 <test+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %11, %1
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %11
11: ; preds = %10, %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @test(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i32 [ %0, %1 ], [ %6, %5 ]
switch i32 %3, label %4 [
i32 0, label %7
i32 1, label %5
]
4: ; preds = %2
tail call void @test(i32 0)
br label %5
5: ; preds = %2, %4
%6 = add nsw i32 %3, 1
br label %2
7: ; preds = %2
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int ones16(int);
int symbol2num(uint16_t x) {
  x |= (x >> 1);
  x |= (x >> 2);
  x |= (x >> 4);
  x |= (x >> 8);
  return ones16(x);
}


x86 assembly (clang, -O0):
<symbol2num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ones16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol2num>:
mov    %edi,%eax
sar    %eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x2,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x4,%eax
or     %eax,%edi
mov    %edi,%eax
sar    $0x8,%eax
or     %eax,%edi
jmp    1030 <ones16@plt>

LLVM IR (-O0):
define i32 @symbol2num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = load i32, i32* %2
%6 = or i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = ashr i32 %7, 2
%9 = load i32, i32* %2
%10 = or i32 %9, %8
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = ashr i32 %11, 4
%13 = load i32, i32* %2
%14 = or i32 %13, %12
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = load i32, i32* %2
%18 = or i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = call i32 @ones16(i32 %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @symbol2num(i32 %0) {
%2 = ashr i32 %0, 1
%3 = or i32 %2, %0
%4 = ashr i32 %3, 2
%5 = or i32 %4, %3
%6 = ashr i32 %5, 4
%7 = or i32 %6, %5
%8 = ashr i32 %7, 8
%9 = or i32 %8, %7
%10 = tail call i32 @ones16(i32 %9)
ret i32 %10
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int errno;
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ timer_reset(struct timeval *);
struct timeval timer_now() {
  struct timeval current_time;
  int old_errno = errno;
  timer_reset(&current_time);
  gettimeofday(&current_time, NULL);
  errno = old_errno;
  return current_time;
}


x86 assembly (clang, -O0):
<timer_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <timer_reset@plt>
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0xc(%rbp),%ecx
mov    0x2e8c(%rip),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_now>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb1(%rip),%r14
mov    (%r14),%ebp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <timer_reset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %ebp,(%r14)
mov    0x8(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@errno = global i32 0
define i32 @timer_now() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = load i32, i32* @errno
store i32 %3, i32* %2
%4 = call i32 @timer_reset(%struct.timeval* %1)
%5 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%6 = load i32, i32* %2
store i32 %6, i32* @errno
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@errno = global i32 0
define i32 @timer_now() {
%1 = alloca %struct.timeval
%2 = load i32, i32* @errno
%3 = call i32 @timer_reset(%struct.timeval* %1)
%4 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %2, i32* @errno
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}
int fontCheckSize(int x) {
  if (x == 2 || x == 4 || x == 8 || x == 16 || x == 32 || x == 64 || x == 128 ||
      x == 256 || x == 512)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fontCheckSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x4,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x8,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x10,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x20,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x40,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x80,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x100,-0x8(%rbp)
je     116a <fontCheckSize+0x6a>
cmpl   $0x200,-0x8(%rbp)
jne    1176 <fontCheckSize+0x76>
movl   $0x1,-0x4(%rbp)
jmp    117d <fontCheckSize+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fontCheckSize>:
mov    $0x1,%eax
cmp    $0x7f,%edi
jg     1123 <fontCheckSize+0x23>
add    $0xfffffffe,%edi
cmp    $0x3e,%edi
ja     113b <fontCheckSize+0x3b>
movabs $0x4000000040004045,%rcx
bt     %rdi,%rcx
jae    113b <fontCheckSize+0x3b>
ret
cmp    $0x80,%edi
je     1122 <fontCheckSize+0x22>
cmp    $0x100,%edi
je     1122 <fontCheckSize+0x22>
cmp    $0x200,%edi
je     1122 <fontCheckSize+0x22>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @fontCheckSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 2
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 4
br i1 %8, label %30, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 8
br i1 %11, label %30, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 16
br i1 %14, label %30, label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 32
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 64
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 128
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 256
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 512
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21, %18, %15, %12, %9, %6, %1
store i32 1, i32* %2
br label %32
31: ; preds = %27
store i32 0, i32* %2
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @fontCheckSize(i32 %0) {
switch i32 %0, label %2 [
i32 512, label %3
i32 256, label %3
i32 128, label %3
i32 64, label %3
i32 32, label %3
i32 16, label %3
i32 8, label %3
i32 4, label %3
i32 2, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void xml_free_converted_string(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @xml_free_converted_string(i8* nocapture %0) {
ret void
}
galign(t) int t;
{
  int sign;
  if (t < 0) {
    sign = 1;
    t = -t;
  } else
    sign = 0;
  t = (t + 4 - 1) & ~(4 - 1);
  t = sign ? -t : t;
  return (t);
}


x86 assembly (clang, -O0):
<galign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1125 <galign+0x25>
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112c <galign+0x2c>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x4,%eax
sub    $0x1,%eax
and    $0xfffffffc,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <galign+0x52>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1158 <galign+0x58>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<galign>:
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
add    $0x3,%ecx
and    $0xfffffffc,%ecx
mov    %ecx,%eax
neg    %eax
test   %edi,%edi
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @galign(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = add nuw nsw i32 %4, 3
%6 = and i32 %5, -4
%7 = sub nsw i32 0, %6
%8 = select i1 %2, i32 %7, i32 %6
ret i32 %8
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x;
};
struct TYPE_4__ {
  TYPE_1__ min_aspect;
};
typedef TYPE_2__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_min_aspect_x(void *_p) {
  return (int)((XSizeHints *)_p)->min_aspect.x;
}


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

x86 assembly (clang, -O2):
<get_XSizeHints_min_aspect_x>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XSizeHints_min_aspect_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XSizeHints_min_aspect_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getBraceParam();
int /*<<< orphan*/ safe_free(int /*<<< orphan*/);
void CmdNoCite(int code) { safe_free(getBraceParam()); }


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

x86 assembly (clang, -O2):
<CmdNoCite>:
push   %rax
xor    %eax,%eax
call   1030 <getBraceParam@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <safe_free@plt>

LLVM IR (-O0):
define void @CmdNoCite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getBraceParam()
%4 = call i32 @safe_free(i32 %3)
ret void
}

LLVM IR (-O2):
define void @CmdNoCite(i32 %0) {
%2 = tail call i32 (...) @getBraceParam()
%3 = tail call i32 @safe_free(i32 %2)
ret void
}
/* Variables and functions */
int ioCanCreatePathOfSize(char *, int);
int secCanCreatePathOfSize(char *dirName, int dirNameSize) {
  return ioCanCreatePathOfSize(dirName, dirNameSize);
}


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

x86 assembly (clang, -O2):
<secCanCreatePathOfSize>:
jmp    1030 <ioCanCreatePathOfSize@plt>

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

LLVM IR (-O2):
define i32 @secCanCreatePathOfSize(i8* %0, i32 %1) {
%3 = tail call i32 @ioCanCreatePathOfSize(i8* %0, i32 %1)
ret i32 %3
}
void noopFreer(void *_) {}


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

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

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

LLVM IR (-O2):
define void @noopFreer(i8* nocapture %0) {
ret void
}
int cmdExit(int argc, char **argv) { return 0; }


x86 assembly (clang, -O0):
<cmdExit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @cmdExit(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lstFree(char **);
void mapFree(char **map) { lstFree(map); }


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

x86 assembly (clang, -O2):
<mapFree>:
jmp    1030 <lstFree@plt>

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

LLVM IR (-O2):
define void @mapFree(i8** %0) {
%2 = tail call i32 @lstFree(i8** %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int tlsext_ec_serverhello_needs(SSL *s) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tlsext_ec_serverhello_needs(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double atan(double);
double _atan(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<_atan>:
jmp    1030 <atan@plt>

LLVM IR (-O0):
define double @_atan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @atan(double %3)
ret double %4
}

LLVM IR (-O2):
define double @_atan(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ geraVetorNumerosAleatorios(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int n;
  if (argc < 2) {
    printf("ERRO: informe a potencia de base 2 do vetor que deverá ser gerada: "
           "<./prog> <dimensao>\n");
    return -1;
  }
  n = atoi(argv[1]);
  geraVetorNumerosAleatorios(n);
  return 1;
}


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)
jge    1168 <main+0x38>
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1187 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <geraVetorNumerosAleatorios@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     1149 <main+0x19>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <geraVetorNumerosAleatorios@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [89 x i8] c"ERRO: informe a potencia de base 2 do vetor que dever\C3\A1 ser gerada: <./prog> <dimensao>\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 slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %18
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = call i32 @geraVetorNumerosAleatorios(i32 %16)
store i32 1, i32* %3
br label %18
18: ; preds = %11, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [88 x i8] c"ERRO: informe a potencia de base 2 do vetor que dever\C3\A1 ser gerada: <./prog> <dimensao>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([88 x i8], [88 x i8]* @str, i64 0, i64 0))
br label %11
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @geraVetorNumerosAleatorios(i32 %9)
br label %11
11: ; preds = %6, %4
%12 = phi i32 [ -1, %4 ], [ 1, %6 ]
ret i32 %12
}
void sock_init() {}


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

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

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

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

/* Variables and functions */
uint32_t new_id(void) {
  static uint32_t current_id = 0;
  current_id = (current_id + 1) % 16000;
  if (current_id == 0)
    current_id = 1;
  return (current_id);
}


x86 assembly (clang, -O0):
<new_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    $0x3e80,%ecx
cltd
idiv   %ecx
mov    %edx,0x2f09(%rip)
cmpl   $0x0,0x2f02(%rip)
jne    1132 <new_id+0x32>
movl   $0x1,0x2ef2(%rip)
mov    0x2eec(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_id>:
mov    0x2f1e(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x10624dd3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
imul   $0x3e80,%ecx,%ecx
neg    %ecx
add    %eax,%ecx
add    $0x1,%ecx
test   %ecx,%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
mov    %eax,0x2ee5(%rip)
ret

LLVM IR (-O0):
@new_id.current_id = internal global i32 0
define i32 @new_id() {
%1 = load i32, i32* @new_id.current_id
%2 = add nsw i32 %1, 1
%3 = srem i32 %2, 16000
store i32 %3, i32* @new_id.current_id
%4 = load i32, i32* @new_id.current_id
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* @new_id.current_id
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* @new_id.current_id
ret i32 %8
}

LLVM IR (-O2):
@new_id.current_id = internal unnamed_addr global i32 0
define i32 @new_id() {
%1 = load i32, i32* @new_id.current_id
%2 = add nsw i32 %1, 1
%3 = srem i32 %2, 16000
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 1, i32 %3
store i32 %5, i32* @new_id.current_id
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xff() {
  Assert_real((iscntrl(255) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              1280, ("iscntrl should be 0 for 0xff"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xff\00"
define void @t_iscntrl_0xff() {
%1 = tail call i64 @iscntrl(i32 255)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1280, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_79int64_lowword_mem(long long *val) {
  return ((*val) & (0x79 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_79int64_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, 121
%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_79int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 121
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ htobe64(int /*<<< orphan*/);
u_int64_t hton64(u_int64_t u64) { return htobe64(u64); }


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

x86 assembly (clang, -O2):
<hton64>:
jmp    1030 <htobe64@plt>

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

LLVM IR (-O2):
define i32 @hton64(i32 %0) {
%2 = tail call i32 @htobe64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void minuscconlyl(unsigned long a, unsigned long b) {
  unsigned long difference = a - b;
  if (difference > a)
    abort();
}


x86 assembly (clang, -O0):
<minuscconlyl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jbe    1141 <minuscconlyl+0x31>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minuscconlyl>:
cmp    %rdi,%rsi
ja     1116 <minuscconlyl+0x6>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @minuscconlyl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sub i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @minuscconlyl(i64 %0, i64 %1) {
%3 = icmp ugt i64 %1, %0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %2
ret void
}
int open() {}


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

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

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

LLVM IR (-O2):
define i32 @open() {
ret i32 undef
}
__attribute__((always_)) int unregister_trace_mm_page_free_direct(
    void (*probe)(void *__data, struct page *page, unsigned int order),
    void *data) {
  return -38;
}


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

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

LLVM IR (-O0):
%struct.page = type opaque
define i32 @unregister_trace_mm_page_free_direct(void (i8*, %struct.page*, i32)* %0, i8* %1) {
%3 = alloca void (i8*, %struct.page*, i32)*
%4 = alloca i8*
store void (i8*, %struct.page*, i32)* %0, void (i8*, %struct.page*, i32)** %3
store i8* %1, i8** %4
ret i32 -38
}

LLVM IR (-O2):
%struct.page = type opaque
define i32 @unregister_trace_mm_page_free_direct(void (i8*, %struct.page*, i32)* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -38
}
/* Variables and functions */
scalar_t__ regmatchInsensitive(char *, char *);
int isdays(char *string) {
  if (regmatchInsensitive(string, "^days=")) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<isdays>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
cmp    $0x0,%rax
je     1142 <isdays+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <isdays+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdays>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <regmatchInsensitive@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"^days=\00"
define i32 @isdays(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @regmatchInsensitive(i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"^days=\00"
define i32 @isdays(i8* %0) {
%2 = tail call i64 @regmatchInsensitive(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
unsigned int ic_pvector_destroyer_free(void *item, unsigned int free_item) {
  if (free_item) {
    free(item);
  }
  return 1;
}


x86 assembly (clang, -O0):
<ic_pvector_destroyer_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1132 <ic_pvector_destroyer_free+0x22>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_pvector_destroyer_free>:
test   %esi,%esi
je     111e <ic_pvector_destroyer_free+0xe>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @ic_pvector_destroyer_free(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret i32 1
}

LLVM IR (-O2):
define i32 @ic_pvector_destroyer_free(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret i32 1
}
int atmc_fetch_and_add(volatile unsigned int *address, int value) {
  int prev = value;
  asm volatile("lock ; "
               "xaddl %0, %1"
               : "+r"(value), "+m"(*address)
               :
               : "memory");
  return prev + value;
}


x86 assembly (clang, -O0):
<atmc_fetch_and_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
lock xadd %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atmc_fetch_and_add>:
mov    %esi,%eax
lock xadd %eax,(%rdi)
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @atmc_fetch_and_add(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
store i32 %6, i32* %5
%7 = load i32, i32* %4
%8 = load i32*, i32** %3
%9 = call i32 asm sideeffect "lock ; xaddl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %8, i32 %7, i32* elementtype(i32) %8)
store i32 %9, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @atmc_fetch_and_add(i32* %0, i32 %1) {
%3 = tail call i32 asm sideeffect "lock ; xaddl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %1, i32* elementtype(i32) %0)
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ do_test_oom1(char const *, int *);
void test_oom(const char *zPattern, int *pRc) { do_test_oom1(zPattern, pRc); }


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

x86 assembly (clang, -O2):
<test_oom>:
jmp    1030 <do_test_oom1@plt>

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

LLVM IR (-O2):
define void @test_oom(i8* %0, i32* %1) {
%3 = tail call i32 @do_test_oom1(i8* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
void getroundkey(unsigned char *full, unsigned char *piece, int which) {
  memcpy(piece, full + which * 16, 16);
}


x86 assembly (clang, -O0):
<getroundkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
cltq
add    %rax,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getroundkey>:
mov    %rsi,%rax
shl    $0x4,%edx
movslq %edx,%rsi
add    %rdi,%rsi
mov    %rax,%rdi
mov    $0x10,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @getroundkey(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 16
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = call i32 @memcpy(i8* %7, i8* %12, i32 16)
ret void
}

LLVM IR (-O2):
define void @getroundkey(i8* %0, i8* %1, i32 %2) {
%4 = shl nsw i32 %2, 4
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @memcpy(i8* %1, i8* %6, i32 16)
ret void
}