xunge/DecIR huggingface dataset:
int game_over(int figures[]) {
  if (figures[0] > 49 && figures[1] > 49) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<game_over>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x31,(%rax)
jle    112f <game_over+0x2f>
mov    -0x10(%rbp),%rax
cmpl   $0x31,0x4(%rax)
jle    112f <game_over+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    1136 <game_over+0x36>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_over>:
cmpl   $0x32,(%rdi)
jl     1110 <game_over+0x10>
mov    $0x1,%eax
cmpl   $0x31,0x4(%rdi)
jg     1112 <game_over+0x12>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @game_over(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 49
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, 49
br i1 %12, label %13, label %14
13: ; preds = %8
store i32 1, i32* %2
br label %15
14: ; preds = %8, %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @game_over(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp sgt i32 %2, 49
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = icmp sgt i32 %6, 49
br i1 %7, label %9, label %8
8: ; preds = %4, %1
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %10
}
GET_PROMPT_CHR(c, s) int *c;
char *s;
{
  puts((char *)s);
  GET_CHR(c);
}


x86 assembly (clang, -O0):
<GET_PROMPT_CHR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1030 <puts@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <GET_CHR@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GET_PROMPT_CHR>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <GET_CHR@plt>

LLVM IR (-O0):
define i32 @GET_PROMPT_CHR(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %6)
%8 = load i32*, i32** %4
%9 = call i32 (i32*, ...) bitcast (i32 (...)* @GET_CHR to i32 (i32*, ...)*)(i32* %8)
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @GET_PROMPT_CHR(i32* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @puts to i32 (i8*, ...)*)(i8* %1)
%4 = tail call i32 (i32*, ...) bitcast (i32 (...)* @GET_CHR to i32 (i32*, ...)*)(i32* %0)
ret i32 undef
}
void hw_breakpoint(void) { __asm__ __volatile__("int $3" ::); }


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

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

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

LLVM IR (-O2):
define void @hw_breakpoint() {
tail call void asm sideeffect "int $$3", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_prim2_exp(unsigned int, struct Cyc_Absyn_Exp *,
                                          struct Cyc_Absyn_Exp *, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_ulte_exp(struct Cyc_Absyn_Exp *e1,
                                         struct Cyc_Absyn_Exp *e2,
                                         unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_prim2_exp(25U, e1, e2, loc);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_ulte_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x19,%edi
call   1030 <Cyc_Absyn_prim2_exp@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_ulte_exp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x19,%edi
jmp    1030 <Cyc_Absyn_prim2_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_ulte_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca i32
%7 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %4
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %5
store i32 %2, i32* %6
%8 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%9 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%10 = load i32, i32* %6
%11 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 25, %struct.Cyc_Absyn_Exp* %8, %struct.Cyc_Absyn_Exp* %9, i32 %10)
store %struct.Cyc_Absyn_Exp* %11, %struct.Cyc_Absyn_Exp** %7
%12 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %7
ret %struct.Cyc_Absyn_Exp* %12
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_ulte_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 25, %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2)
ret %struct.Cyc_Absyn_Exp* %4
}
void foo652() {}


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

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

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

LLVM IR (-O2):
define void @foo652() {
ret void
}
/* Variables and functions */
int getlineuser(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  int len;
  char line[1000];
  while ((len = getlineuser(line, 1000)) > 0) {
    if (line[0] == '\n')
      ;
    else
      printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getlineuser@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    117c <main+0x5c>
movsbl -0x3f0(%rbp),%eax
cmp    $0xa,%eax
jne    1164 <main+0x44>
jmp    1177 <main+0x57>
lea    -0x3f0(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getlineuser@plt>
test   %eax,%eax
jle    1174 <main+0x54>
mov    %rsp,%rbx
lea    0xebb(%rip),%r14
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getlineuser@plt>
test   %eax,%eax
jle    1174 <main+0x54>
cmpb   $0xa,(%rsp)
je     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %17, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getlineuser(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %8
br label %17
14: ; preds = %8
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %14, %13
br label %4
18: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getlineuser(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 10
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %5, %8
%11 = call i32 @getlineuser(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
unsigned int strlen_unsigned(const unsigned char *str) {
  unsigned const char *wrk = str;
  int retval;
  for (retval = 0; *wrk != '\0'; wrk++)
    retval++;
  return retval;
}


x86 assembly (clang, -O0):
<strlen_unsigned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     1141 <strlen_unsigned+0x41>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <strlen_unsigned+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_unsigned>:
cmpb   $0x0,(%rdi)
je     111c <strlen_unsigned+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen_unsigned+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen_unsigned(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int _gettimeofday(struct timeval *p, void *z) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @_gettimeofday(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void integer(int arg) { printf("got a integer:%d\n", arg); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"got a integer:%d\0A\00"
define void @integer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"got a integer:%d\0A\00"
define void @integer(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void ff_hevc_put_hevc_uni_qpel_h4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h4_8_sse4() {
ret void
}
int gpio_no(int bank, int n) { return bank * 32 + n; }


x86 assembly (clang, -O0):
<gpio_no>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_no>:
shl    $0x5,%edi
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @gpio_no(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 32
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @gpio_no(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 5
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ArgNum();
void Act_NeedField(void) { ArgNum(); }


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

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

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

LLVM IR (-O2):
define void @Act_NeedField() {
%1 = tail call i32 (...) @ArgNum()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glVertex3s(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
void Vertex3s(GLshort x, GLshort y, GLshort z) { glVertex3s(x, y, z); }


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

x86 assembly (clang, -O2):
<Vertex3s>:
jmp    1030 <glVertex3s@plt>

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

LLVM IR (-O2):
define void @Vertex3s(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glVertex3s(i32 %0, i32 %1, i32 %2)
ret void
}
int get_char(char *addr) { return *addr; }


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

x86 assembly (clang, -O2):
<get_char>:
movsbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_char(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int get_sub1(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_sub1(int a, int b, int mask) {
  int f, r;
  f = get_sub1(a, b, &r);
  f &= mask;
  printf("sub"
         " 1"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_sub1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1030 <get_sub1@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sub1>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1030 <get_sub1@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"sub 1 %08x %08x %08x %08x %08x\0A\00"
define void @print_sub1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_sub1(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"sub 1 %08x %08x %08x %08x %08x\0A\00"
define void @print_sub1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_sub1(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_AddUserToList();
int /*<<< orphan*/ test_ChangeUserName();
int /*<<< orphan*/ test_CheckUserNameValid();
int /*<<< orphan*/ test_NewUser();
int /*<<< orphan*/ test_RemoveUserFromList();
int /*<<< orphan*/ test_UserEqual();
int main() {
  test_UserEqual();
  test_NewUser();
  test_AddUserToList();
  test_RemoveUserFromList();
  test_CheckUserNameValid();
  test_ChangeUserName();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_UserEqual@plt>
mov    $0x0,%al
call   1030 <test_NewUser@plt>
mov    $0x0,%al
call   1040 <test_AddUserToList@plt>
mov    $0x0,%al
call   1060 <test_RemoveUserFromList@plt>
mov    $0x0,%al
call   1050 <test_CheckUserNameValid@plt>
mov    $0x0,%al
call   1080 <test_ChangeUserName@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_UserEqual@plt>
xor    %eax,%eax
call   1030 <test_NewUser@plt>
xor    %eax,%eax
call   1040 <test_AddUserToList@plt>
xor    %eax,%eax
call   1060 <test_RemoveUserFromList@plt>
xor    %eax,%eax
call   1050 <test_CheckUserNameValid@plt>
xor    %eax,%eax
call   1080 <test_ChangeUserName@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_UserEqual()
%3 = call i32 (...) @test_NewUser()
%4 = call i32 (...) @test_AddUserToList()
%5 = call i32 (...) @test_RemoveUserFromList()
%6 = call i32 (...) @test_CheckUserNameValid()
%7 = call i32 (...) @test_ChangeUserName()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_UserEqual()
%2 = tail call i32 (...) @test_NewUser()
%3 = tail call i32 (...) @test_AddUserToList()
%4 = tail call i32 (...) @test_RemoveUserFromList()
%5 = tail call i32 (...) @test_CheckUserNameValid()
%6 = tail call i32 (...) @test_ChangeUserName()
ret i32 0
}
int xma_quick_mask(int chans) {
  int i, mask;
  mask = 0;
  for (i = 0; i < chans; i++) {
    mask = 1 << 1;
  }
  return (mask);
}


x86 assembly (clang, -O0):
<xma_quick_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1136 <xma_quick_mask+0x36>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <xma_quick_mask+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xma_quick_mask>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @xma_quick_mask(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = select i1 %2, i32 2, i32 0
ret i32 %3
}
/* Type definitions */
struct VariableShare {
  int dummy;
};

/* Variables and functions */
int FullySyncVariable(struct VariableShare *, unsigned int, int);
int RVS_Sync_Variable(struct VariableShare *vsh, unsigned int var_id) {
  return FullySyncVariable(vsh, var_id, 1);
}


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

x86 assembly (clang, -O2):
<RVS_Sync_Variable>:
mov    $0x1,%edx
jmp    1030 <FullySyncVariable@plt>

LLVM IR (-O0):
%struct.VariableShare = type { i32 }
define i32 @RVS_Sync_Variable(%struct.VariableShare* %0, i32 %1) {
%3 = alloca %struct.VariableShare*
%4 = alloca i32
store %struct.VariableShare* %0, %struct.VariableShare** %3
store i32 %1, i32* %4
%5 = load %struct.VariableShare*, %struct.VariableShare** %3
%6 = load i32, i32* %4
%7 = call i32 @FullySyncVariable(%struct.VariableShare* %5, i32 %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.VariableShare = type { i32 }
define i32 @RVS_Sync_Variable(%struct.VariableShare* %0, i32 %1) {
%3 = tail call i32 @FullySyncVariable(%struct.VariableShare* %0, i32 %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int ASRT_Fail();
int /*<<< orphan*/ ASRT_Mark(char *, int, char *);
int test_Failm() {
  do {
    ASRT_Mark("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/"
              "src/asrt_tests.c",
              40, "FAILm custom message");
    return ASRT_Fail();
  } while (0);
}


x86 assembly (clang, -O0):
<test_Failm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
jmp    112d <test_Failm+0xd>
lea    0xecc(%rip),%rdi
mov    $0x28,%esi
lea    0xf50(%rip),%rdx
call   1030 <ASRT_Mark@plt>
mov    $0x0,%al
call   1040 <ASRT_Fail@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_Failm>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf61(%rip),%rdx
mov    $0x28,%esi
call   1030 <ASRT_Mark@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ASRT_Fail@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [21 x i8] c"FAILm custom message\00"
define i32 @test_Failm() {
br label %1
1: ; preds = %0
%2 = call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @ASRT_Fail()
br label %4
4: ; preds = %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cohadar/c-learning/refs/heads/master/src/asrt_tests.c\00"
@.str.1 = [21 x i8] c"FAILm custom message\00"
define i32 @test_Failm() {
%1 = tail call i32 @ASRT_Mark(i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 40, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @ASRT_Fail()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cabecalho() {
  printf("\t\t\t_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\n");
  printf("\t\t\tUniversidade de Brasilia - FGA\n");
  printf("\t\t\tAluno: xxxxxx\n");
  printf("\t\t\tMatricula:xx/xxxxx \n");
  printf("\t\t\t_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\n");
}


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

x86 assembly (clang, -O2):
<cabecalho>:
push   %rbx
lea    0xf32(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"\09\09\09_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\0A\00"
@.str.1 = [35 x i8] c"\09\09\09Universidade de Brasilia - FGA\0A\00"
@.str.2 = [18 x i8] c"\09\09\09Aluno: xxxxxx\0A\00"
@.str.3 = [24 x i8] c"\09\09\09Matricula:xx/xxxxx \0A\00"
define void @cabecalho() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.4 = [34 x i8] c"\09\09\09Universidade de Brasilia - FGA\00"
@str.5 = [17 x i8] c"\09\09\09Aluno: xxxxxx\00"
@str.6 = [23 x i8] c"\09\09\09Matricula:xx/xxxxx \00"
@str.7 = [40 x i8] c"\09\09\09_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-\00"
define void @cabecalho() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.7, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recvfrom(int, void *, size_t, int, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
ssize_t recv(int sockfd, void *buf, size_t len, int flags) {
  return recvfrom(sockfd, buf, len, flags, NULL, NULL);
}


x86 assembly (clang, -O0):
<recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1030 <recvfrom@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <recvfrom@plt>

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

LLVM IR (-O2):
define i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recvfrom(i32 %0, i8* %1, i64 %2, i32 %3, i32* null, i32* null)
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
int verificaComplemento(char *complemento) {
  int tamComplemento = strlen(complemento);
  if (complemento == NULL || tamComplemento == 0 || tamComplemento >= 80)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verificaComplemento>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1147 <verificaComplemento+0x37>
cmpl   $0x0,-0x14(%rbp)
je     1147 <verificaComplemento+0x37>
cmpl   $0x50,-0x14(%rbp)
jl     1153 <verificaComplemento+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <verificaComplemento+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verificaComplemento>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rbx,%rbx
setne  %cl
test   %eax,%eax
setne  %dl
and    %cl,%dl
cmp    $0x50,%eax
setl   %al
and    %dl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @verificaComplemento(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp ne i8* %0, null
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = icmp slt i32 %2, 80
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void pgtrace_stop(void) {}


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

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

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

LLVM IR (-O2):
define void @pgtrace_stop() {
ret void
}
/* Type definitions */
struct po_manager_pvt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct po_manager_pvt *);
void rtpp_po_mgr_dtor(struct po_manager_pvt *pvt) { free(pvt); }


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

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

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

LLVM IR (-O2):
%struct.po_manager_pvt = type { i32 }
define void @rtpp_po_mgr_dtor(%struct.po_manager_pvt* nocapture %0) {
%2 = tail call i32 @free(%struct.po_manager_pvt* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ scanf(char *, char *);
unsigned int strtoul(char *, char **, int);
unsigned int GetHex(const char *szComment) {
  char cmd[1024];
  printf("%s: 0x", szComment);
  scanf("%1023s", cmd);
  return (strtoul(cmd, (char **)NULL, 16));
}


x86 assembly (clang, -O0):
<GetHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x410(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x410(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1050 <strtoul@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetHex>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <strtoul@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s: 0x\00"
@.str.1 = [7 x i8] c"%1023s\00"
define i32 @GetHex(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%9 = call i32 @strtoul(i8* %8, i8** null, i32 16)
ret i32 %9
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: 0x\00"
@.str.1 = [7 x i8] c"%1023s\00"
define i32 @GetHex(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = call i32 @strtoul(i8* nocapture %3, i8** null, i32 16)
ret i32 %6
}
void foo612(int p) {}


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

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

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

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

/* Variables and functions */
void gpu_send_control_gp0(int v) {
  int k;
  for (;;)
    if (((*(volatile uint32_t *)(0x00000000 + 0x1F801814)) & 0x04000000) != 0)
      break;
  (*(volatile uint32_t *)(0x00000000 + 0x1F801810)) = v;
}


x86 assembly (clang, -O0):
<gpu_send_control_gp0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1f801814,%eax
mov    (%rax),%eax
and    $0x4000000,%eax
cmp    $0x0,%eax
je     1121 <gpu_send_control_gp0+0x21>
jmp    1126 <gpu_send_control_gp0+0x26>
jmp    1107 <gpu_send_control_gp0+0x7>
mov    -0x4(%rbp),%ecx
mov    $0x1f801810,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpu_send_control_gp0>:
testl  $0x4000000,0x1f801814
je     1100 <gpu_send_control_gp0>
mov    %edi,0x1f801810
ret

LLVM IR (-O0):
define void @gpu_send_control_gp0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %9, %1
%5 = load volatile i32, i32* inttoptr (i64 528488468 to i32*)
%6 = and i32 %5, 67108864
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %4
br label %10
9: ; preds = %4
br label %4
10: ; preds = %8
%11 = load i32, i32* %2
store volatile i32 %11, i32* inttoptr (i64 528488464 to i32*)
ret void
}

LLVM IR (-O2):
define void @gpu_send_control_gp0(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i32, i32* inttoptr (i64 528488468 to i32*)
%4 = and i32 %3, 67108864
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
store volatile i32 %0, i32* inttoptr (i64 528488464 to i32*)
ret void
}
long get(long *a, int idx) { return a[idx]; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rax
ret

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

LLVM IR (-O2):
define i64 @get(i64* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_si64(int /*<<< orphan*/, int);
__m64 test69(__m64 a) { return _mm_slli_si64(a, 3); }


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

x86 assembly (clang, -O2):
<test69>:
mov    $0x3,%esi
jmp    1030 <_mm_slli_si64@plt>

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

LLVM IR (-O2):
define i32 @test69(i32 %0) {
%2 = tail call i32 @_mm_slli_si64(i32 %0, i32 3)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
bool fileExists(const char *filename) {
  FILE *file;
  if ((file = fopen(filename, "r")) == NULL) {
    return false;
  } else {
    fclose(file);
    return true;
  }
}


x86 assembly (clang, -O0):
<fileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1156 <fileExists+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1166 <fileExists+0x46>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <fileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @fileExists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @fileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  double x, y = -1;
  int a = 3, b = 4, c;
  printf("%d\n", a / -b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x4,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
xor    %ecx,%ecx
sub    -0x20(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store double -1.000000e+00, double* %3
store i32 3, i32* %4
store i32 4, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sub nsw i32 0, %8
%10 = sdiv i32 %7, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(const char *s, int fd) {
  int i;
  i = 0;
  while (s[i] != '\0')
    i++;
  write(fd, s, i);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1149 <ft_putstr_fd+0x39>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ft_putstr_fd+0x16>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
mov    %esi,%eax
mov    %rdi,%rsi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <ft_putstr_fd+0x10>
add    $0xffffffff,%edx
mov    %eax,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %8, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
%11 = tail call i32 @write(i32 %1, i8* %0, i32 %10)
ret void
}
/* Variables and functions */
int twice(int);
int main(void) {
  int t = twice(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <twice@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @twice(i32 1)
store i32 %3, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @twice(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ register_capmp_function_list();
void capmp_init() { register_capmp_function_list(); }


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

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

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

LLVM IR (-O2):
define void @capmp_init() {
%1 = tail call i32 (...) @register_capmp_function_list()
ret void
}
/* Variables and functions */
int fatorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Digite o numero a ser fatorado:\n");
  scanf("%d", &n);
  printf("%d", fatorial(n));
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
call   1050 <fatorial@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Digite o numero a ser fatorado:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fatorial(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [32 x i8] c"Digite o numero a ser fatorado:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @fatorial(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
__attribute__((noipa)) int fn2(int x, int y) { return x + y; }


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fn2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd = open(argv[1], O_CREAT);
  close(fd);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
call   1040 <open@plt>
mov    %eax,%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
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 i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = load i32, i32* @O_CREAT
%11 = call i32 @open(i8* %9, i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @close(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@O_CREAT = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @O_CREAT
%6 = tail call i32 @open(i8* %4, i32 %5)
%7 = tail call i32 @close(i32 %6)
ret i32 0
}