xunge/DecIR huggingface dataset:
const char *protobuf_c_version(void) { return "1.1.1"; }


x86 assembly (clang, -O0):
<protobuf_c_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<protobuf_c_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.1.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.1.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ OneFunc();
int main() {
  OneFunc();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <OneFunc@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @OneFunc()
ret i32 0
}
void fc197(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
  a : {
    typedef int(*h)[n];
    goto a;
    0;
  };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc197>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc197+0x7>

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

LLVM IR (-O0):
define void @fc197(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %15
15: ; preds = %15, %1
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
br label %15
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc197(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int do_358() { return 358; }


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

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

LLVM IR (-O0):
define i32 @do_358() {
ret i32 358
}

LLVM IR (-O2):
define i32 @do_358() {
ret i32 358
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ msb_first;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
bool WriteUint32(uint32_t to_write, FILE *file) {
  uint32_t msb_first = htonl(to_write);
  return fwrite(&msb_first, sizeof(msb_first), 1, file) == 1;
}


x86 assembly (clang, -O0):
<WriteUint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUint32>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @WriteUint32(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* %3
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = call i32 @fwrite(i32* %5, i32 4, i32 1, i32* %8)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @WriteUint32(i32 %0, i32* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %0)
store i32 %5, i32* %3
%6 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %1)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: biff [n | y | b]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"usage: biff [n | y | b]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"usage: biff [n | y | b]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void terminator() { printf("The system goes online August 4th, 1997.\n"); }


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"The system goes online August 4th, 1997.\0A\00"
define void @terminator() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"The system goes online August 4th, 1997.\00"
define void @terminator() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int /*<<< orphan*/);
int /*<<< orphan*/ bboard_to_fset(int);
void bboard_to_fset_test(void **state) {
  assert_int_equal(0x25, bboard_to_fset(0x0000000001200400ul));
}


x86 assembly (clang, -O0):
<bboard_to_fset_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1200400,%edi
call   1030 <bboard_to_fset@plt>
mov    %eax,%esi
mov    $0x25,%edi
call   1040 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bboard_to_fset_test>:
push   %rax
mov    $0x1200400,%edi
call   1030 <bboard_to_fset@plt>
mov    $0x25,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <assert_int_equal@plt>

LLVM IR (-O0):
define void @bboard_to_fset_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @bboard_to_fset(i32 18875392)
%4 = call i32 @assert_int_equal(i32 37, i32 %3)
ret void
}

LLVM IR (-O2):
define void @bboard_to_fset_test(i8** nocapture readnone %0) {
%2 = tail call i32 @bboard_to_fset(i32 18875392)
%3 = tail call i32 @assert_int_equal(i32 37, i32 %2)
ret void
}
/* Variables and functions */
float *calloc(int, int);
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ free(float *);
int /*<<< orphan*/ interp_pitch(float *, float *, int, int);
int main() {
  float *exc = calloc(126, sizeof(float));
  float *interp = calloc(80, sizeof(float));
  int pitch = -35;
  check_vect();
  interp_pitch(exc, interp, pitch, 80);
  free(exc);
  free(interp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7e,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x50,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0xffffffdd,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <check_vect@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x50,%ecx
call   1060 <interp_pitch@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x7e,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%r14
mov    $0x50,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <check_vect@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0xffffffdd,%edx
mov    $0x50,%ecx
call   1060 <interp_pitch@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
%3 = alloca float*
%4 = alloca i32
store i32 0, i32* %1
%5 = call float* @calloc(i32 126, i32 4)
store float* %5, float** %2
%6 = call float* @calloc(i32 80, i32 4)
store float* %6, float** %3
store i32 -35, i32* %4
%7 = call i32 (...) @check_vect()
%8 = load float*, float** %2
%9 = load float*, float** %3
%10 = load i32, i32* %4
%11 = call i32 @interp_pitch(float* %8, float* %9, i32 %10, i32 80)
%12 = load float*, float** %2
%13 = call i32 @free(float* %12)
%14 = load float*, float** %3
%15 = call i32 @free(float* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float* @calloc(i32 126, i32 4)
%2 = tail call float* @calloc(i32 80, i32 4)
%3 = tail call i32 (...) @check_vect()
%4 = tail call i32 @interp_pitch(float* %1, float* %2, i32 -35, i32 80)
%5 = tail call i32 @free(float* %1)
%6 = tail call i32 @free(float* %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ calloc(int, unsigned int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ nrerror(char *);
int /*<<< orphan*/ stderr;
void *space(unsigned size) {
  void *pointer;
  if ((pointer = (void *)calloc(1, size)) == NULL) {
    fprintf(stderr, "SPACE: requested size: %d\n", size);
    nrerror("SPACE allocation failure -> no memory");
  }
  return pointer;
}


x86 assembly (clang, -O0):
<space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117a <space+0x4a>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe97(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xea6(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x1,%edi
mov    %ebp,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116c <space+0x3c>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %ebp,%edx
call   1050 <fprintf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <nrerror@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"SPACE: requested size: %d\0A\00"
@.str.1 = [38 x i8] c"SPACE allocation failure -> no memory\00"
define i8* @space(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 1, i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i32, i32* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 @nrerror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"SPACE: requested size: %d\0A\00"
@.str.1 = [38 x i8] c"SPACE allocation failure -> no memory\00"
define i8* @space(i32 %0) {
%2 = tail call i64 @calloc(i32 1, i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @nrerror(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %4, %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
void dyna_stop2() {}


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

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

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

LLVM IR (-O2):
define void @dyna_stop2() {
ret void
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int __syscall_sched_setparam(int /*<<< orphan*/, struct sched_param const *);
int sched_setparam(pid_t pid, const struct sched_param *p) {
  return (__syscall_sched_setparam(pid, p));
}


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

x86 assembly (clang, -O2):
<sched_setparam>:
jmp    1030 <__syscall_sched_setparam@plt>

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

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @sched_setparam(i32 %0, %struct.sched_param* %1) {
%3 = tail call i32 @__syscall_sched_setparam(i32 %0, %struct.sched_param* %1)
ret i32 %3
}
/* Variables and functions */
scalar_t__ __send_to_ppe(int, int, char **);
char *tmpnam(char *s) { return (char *)__send_to_ppe(0x2100, 33, &s); }


x86 assembly (clang, -O0):
<tmpnam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2100,%edi
mov    $0x21,%esi
lea    -0x8(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpnam>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdx
mov    $0x2100,%edi
mov    $0x21,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @tmpnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @__send_to_ppe(i32 8448, i32 33, i8** %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}

LLVM IR (-O2):
define i8* @tmpnam(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 @__send_to_ppe(i32 8448, i32 33, i8** %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
scalar_t__ IS_ERR(void const *);
int PTR_ERR(void const *);
int PTR_ERR_OR_ZERO(const void *ptr) {
  if (IS_ERR(ptr))
    return PTR_ERR(ptr);
  else
    return 0;
}


x86 assembly (clang, -O0):
<PTR_ERR_OR_ZERO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <IS_ERR@plt>
cmp    $0x0,%rax
je     1150 <PTR_ERR_OR_ZERO+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <PTR_ERR@plt>
mov    %eax,-0x4(%rbp)
jmp    1157 <PTR_ERR_OR_ZERO+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PTR_ERR_OR_ZERO>:
push   %rbx
mov    %rdi,%rbx
call   1040 <IS_ERR@plt>
test   %rax,%rax
je     1137 <PTR_ERR_OR_ZERO+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <PTR_ERR@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @PTR_ERR_OR_ZERO(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @IS_ERR(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @PTR_ERR(i8* %8)
store i32 %9, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @PTR_ERR_OR_ZERO(i8* %0) {
%2 = tail call i64 @IS_ERR(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @PTR_ERR(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ mostraplinha(char);
int /*<<< orphan*/ sprintf(char, char *);
void frasetres(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "3: Cafe s/acucar");
  mostraplinha(plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<frasetres>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1040 <sprintf@plt>
movsbl -0x1(%rbp),%edi
call   1050 <mostraplinha@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frasetres>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1040 <sprintf@plt>
mov    %ebp,%edi
call   1050 <mostraplinha@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"3: Cafe s/acucar\00"
define void @frasetres(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @mostraplinha(i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"3: Cafe s/acucar\00"
define void @frasetres(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @mostraplinha(i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int);
void init(uint8_t *const array) {
  int i;
  srand(1);
  for (i = 0; i < (1 << 12); ++i) {
    array[i] = (uint8_t)(rand() % 256);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <srand@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1000,-0xc(%rbp)
jge    1176 <init+0x56>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
movslq %edx,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <init+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
cltq
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    $0x1000,%rbx
jne    1140 <init+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @init(i64* nocapture writeonly %0) {
%2 = tail call i32 @srand(i32 1)
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %9, %3 ]
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 256
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 %4
store i64 %7, i64* %8
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 4096
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_action_frame_usage(void) {
  printf("\nUsage : wfd_action_frame <CONFIG_FILE> |"
         " [<PeerAddr> <Category> <OUISubtype> <DialogToken>]\n");
  printf("\nAction frame is sent using parameters in the CONFIG_FILE "
         "or parameters specified on command line.\n");
  return;
}


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

x86 assembly (clang, -O2):
<print_wfd_action_frame_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [94 x i8] c"\0AUsage : wfd_action_frame <CONFIG_FILE> | [<PeerAddr> <Category> <OUISubtype> <DialogToken>]\0A\00"
@.str.1 = [100 x i8] c"\0AAction frame is sent using parameters in the CONFIG_FILE or parameters specified on command line.\0A\00"
define void @print_wfd_action_frame_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [93 x i8] c"\0AUsage : wfd_action_frame <CONFIG_FILE> | [<PeerAddr> <Category> <OUISubtype> <DialogToken>]\00"
@str.2 = [99 x i8] c"\0AAction frame is sent using parameters in the CONFIG_FILE or parameters specified on command line.\00"
define void @print_wfd_action_frame_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([93 x i8], [93 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct searchable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct searchable *);
void searchable_free(struct searchable *s) { free(s); }


x86 assembly (clang, -O0):
<searchable_free>:
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):
<searchable_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.searchable = type { i32 }
define void @searchable_free(%struct.searchable* nocapture %0) {
%2 = tail call i32 @free(%struct.searchable* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
void printf2(char *s, int d, int e) {
  printf(s, d / 1000, d % 1000, e / 1000, e % 1000);
}


x86 assembly (clang, -O0):
<printf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
mov    $0x3e8,%r8d
cltd
idiv   %r8d
mov    %edx,%r8d
mov    -0x14(%rbp),%edx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf2>:
movslq %esi,%rax
imul   $0x10624dd3,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rsi
add    %ecx,%esi
imul   $0x3e8,%esi,%ecx
sub    %ecx,%eax
movslq %edx,%r8
imul   $0x10624dd3,%r8,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%edx
sub    %edx,%r8d
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @printf2(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sdiv i32 %8, 1000
%10 = load i32, i32* %5
%11 = srem i32 %10, 1000
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 1000
%14 = load i32, i32* %6
%15 = srem i32 %14, 1000
%16 = call i32 @printf(i8* %7, i32 %9, i32 %11, i32 %13, i32 %15)
ret void
}

LLVM IR (-O2):
define void @printf2(i8* %0, i32 %1, i32 %2) {
%4 = sdiv i32 %1, 1000
%5 = srem i32 %1, 1000
%6 = sdiv i32 %2, 1000
%7 = srem i32 %2, 1000
%8 = tail call i32 @printf(i8* %0, i32 %4, i32 %5, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
int yaffs_sync_common(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int yaffs_sync_files(const char *path) {
  return yaffs_sync_common((0), path, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @yaffs_sync_files(i8* %0) {
%2 = tail call i32 @yaffs_sync_common(i32 0, i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void PrintBits(unsigned num) {
  unsigned max_pow = 1 << sizeof(unsigned) * 8 - 1;
  while (max_pow) {
    printf("%u", !!(max_pow & num));
    max_pow >>= 1;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<PrintBits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x80000000,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115d <PrintBits+0x4d>
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <PrintBits+0x12>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintBits>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%r15d
mov    $0x80000000,%ebx
lea    0xeca(%rip),%r14
mov    $0x80000000,%ebp
nopl   0x0(%rax,%rax,1)
xor    %esi,%esi
test   %r15d,%ebx
setne  %sil
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
shr    %ebp
cmp    $0x1,%ebx
mov    %ebp,%ebx
ja     1140 <PrintBits+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @PrintBits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -2147483648, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = and i32 %8, %9
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %3
%17 = lshr i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define void @PrintBits(i32 %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ -2147483648, %1 ], [ %8, %2 ]
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = lshr i32 %3, 1
%9 = icmp ult i32 %3, 2
br i1 %9, label %10, label %2
10: ; preds = %2
%11 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *syscfg_get_EXTICR1() {
  return mem_get_reg32(0x40010000 + 0x08);
}


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

x86 assembly (clang, -O2):
<syscfg_get_EXTICR1>:
mov    $0x40010008,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @syscfg_get_EXTICR1() {
%1 = call i32* @mem_get_reg32(i32 1073807368)
ret i32* %1
}

LLVM IR (-O2):
define i32* @syscfg_get_EXTICR1() {
%1 = tail call i32* @mem_get_reg32(i32 1073807368)
ret i32* %1
}
/* Variables and functions */
int cosDegrees(int /*<<< orphan*/);
int /*<<< orphan*/ potToDegree();
float horizontalDistanceToDrive(int initValue) {
  return initValue - 28 * cosDegrees(potToDegree());
}


x86 assembly (clang, -O0):
<horizontalDistanceToDrive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <potToDegree@plt>
mov    %eax,%edi
call   1040 <cosDegrees@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x1c,%ecx,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<horizontalDistanceToDrive>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <potToDegree@plt>
mov    %eax,%edi
call   1040 <cosDegrees@plt>
imul   $0xffffffe4,%eax,%eax
add    %ebx,%eax
cvtsi2ss %eax,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @horizontalDistanceToDrive(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @potToDegree()
%5 = call i32 @cosDegrees(i32 %4)
%6 = mul nsw i32 28, %5
%7 = sub nsw i32 %3, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @horizontalDistanceToDrive(i32 %0) {
%2 = tail call i32 (...) @potToDegree()
%3 = tail call i32 @cosDegrees(i32 %2)
%4 = mul i32 %3, -28
%5 = add i32 %4, %0
%6 = sitofp i32 %5 to float
ret float %6
}
char *copy(s)
char *s;
{
  char *new;
  new = (char *)malloc(strlen(s) + 1);
  strcpy(new, s);
  return (new);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @copy(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i8* @strcpy(i8* dereferenceable(1) %4, i8* dereferenceable(1) %0)
ret i8* %4
}
int eng2num(int engine) {
  if (engine >= 0 && engine <= 52 && (engine % 10) <= 2)
    return ((engine / 10) * 3 + (engine % 10));
  else
    return -1;
}


x86 assembly (clang, -O0):
<eng2num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1158 <eng2num+0x58>
cmpl   $0x34,-0x8(%rbp)
jg     1158 <eng2num+0x58>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x2,%edx
jg     1158 <eng2num+0x58>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <eng2num+0x5f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eng2num>:
mov    $0xffffffff,%eax
cmp    $0x34,%edi
ja     1130 <eng2num+0x30>
movzbl %dil,%ecx
imul   $0xcd,%ecx,%edx
shr    $0xb,%edx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
sub    %sil,%cl
cmp    $0x2,%cl
ja     1130 <eng2num+0x30>
movzbl %dl,%eax
lea    (%rax,%rax,2),%eax
add    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @eng2num(i32 %0) {
%2 = icmp ult i32 %0, 53
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = urem i8 %4, 10
%6 = udiv i8 %4, 10
%7 = icmp ult i8 %5, 3
br i1 %7, label %8, label %12
8: ; preds = %3
%9 = mul nuw nsw i8 %6, 3
%10 = add nuw nsw i8 %9, %5
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %1, %3, %8
%13 = phi i32 [ %11, %8 ], [ -1, %3 ], [ -1, %1 ]
ret i32 %13
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, char const *, unsigned int, unsigned int,
                          unsigned int);
scalar_t__ pthread_self();
void printids(const char *s) {
  pid_t pid;
  pthread_t tid;
  pid = getpid();
  tid = pthread_self();
  printf("%s pid = %u, tid = %u (0x%x)\n", s, (unsigned int)pid,
         (unsigned int)tid, (unsigned int)tid);
}


x86 assembly (clang, -O0):
<printids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %eax,%r8d
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printids>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb1(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"%s pid = %u, tid = %u (0x%x)\0A\00"
define void @printids(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = call i64 (...) @getpid()
store i64 %5, i64* %3
%6 = call i64 (...) @pthread_self()
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
%10 = load i64, i64* %4
%11 = trunc i64 %10 to i32
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"%s pid = %u, tid = %u (0x%x)\0A\00"
define void @printids(i8* %0) {
%2 = tail call i64 (...) @getpid()
%3 = tail call i64 (...) @pthread_self()
%4 = trunc i64 %2 to i32
%5 = trunc i64 %3 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %5, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_log_levelv() {
  printf("NOT IMPLEMENTED:"
         "pa_log_levelv"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [31 x i8] c"NOT IMPLEMENTED:pa_log_levelv\0A\00"
define i32 @pa_log_levelv() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_log_levelv\00"
define i32 @pa_log_levelv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct passwd {
  int dummy;
};

/* Variables and functions */
int ENOSYS;
int getpwuid_r(uid_t uid, struct passwd *pwbuf, char *buf, size_t buflen,
               struct passwd **pwbufp) {
  return ENOSYS;
}


x86 assembly (clang, -O0):
<getpwuid_r>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpwuid_r>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@ENOSYS = global i32 0
define i32 @getpwuid_r(i32 %0, %struct.passwd* %1, i8* %2, i64 %3, %struct.passwd** %4) {
%6 = alloca i32
%7 = alloca %struct.passwd*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca %struct.passwd**
store i32 %0, i32* %6
store %struct.passwd* %1, %struct.passwd** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store %struct.passwd** %4, %struct.passwd*** %10
%11 = load i32, i32* @ENOSYS
ret i32 %11
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@ENOSYS = global i32 0
define i32 @getpwuid_r(i32 %0, %struct.passwd* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, %struct.passwd** nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ error(int, char *, char *, char *);
void at_error(int lineno, char *line, char *cptr) {
  error(lineno, line, cptr, "illegal @-name");
}


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

x86 assembly (clang, -O2):
<at_error>:
lea    0xee9(%rip),%rcx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"illegal @-name\00"
define void @at_error(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @error(i32 %7, i8* %8, i8* %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"illegal @-name\00"
define void @at_error(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @error(i32 %0, i8* %1, i8* %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putstr(char *, int);
void term_up(void) { putstr("\x1b[A", 3); }


x86 assembly (clang, -O0):
<term_up>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
call   1030 <putstr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_up>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <putstr@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[A\00"
define void @term_up() {
%1 = call i32 @putstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[A\00"
define void @term_up() {
%1 = tail call i32 @putstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
int num(int x) {
  int soma;
  int media;
  for (x = 0; x <= 100; x++) {
    soma = soma + x;
  }
  media = soma / 100;
  return media;
}


x86 assembly (clang, -O0):
<num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     112f <num+0x2f>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <num+0xe>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @num(i32 %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int dictCharKeyCompare(void *privdata, const void *key1, const void *key2) {
  ((void)privdata);
  const char *c1 = key1;
  const char *c2 = key2;
  return strcmp(c1, c2) == 0;
}


x86 assembly (clang, -O0):
<dictCharKeyCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictCharKeyCompare>:
push   %rax
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dictCharKeyCompare(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
store i8* %10, i8** %7
%11 = load i8*, i8** %6
store i8* %11, i8** %8
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i64 @strcmp(i8* %12, i8* %13)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @dictCharKeyCompare(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %1, i8* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void mempool_getstats(int stats_inuse[24], int stats_avail[24],
                      int stats_memoryused[24]) {
  return;
}


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

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

LLVM IR (-O0):
define void @mempool_getstats(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
ret void
}

LLVM IR (-O2):
define void @mempool_getstats(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RRC();
void do0x0F() { _I8080_RRC(); }


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

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

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

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

/* Variables and functions */
scalar_t__ hd44780_ll_register_write(int /*<<< orphan*/, int);
int8_t hd44780_ll_data_write(uint8_t data) {
  if (hd44780_ll_register_write(data, 1)) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<hd44780_ll_data_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1030 <hd44780_ll_register_write@plt>
cmp    $0x0,%rax
je     113e <hd44780_ll_data_write+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <hd44780_ll_data_write+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd44780_ll_data_write>:
push   %rax
mov    $0x1,%esi
call   1030 <hd44780_ll_register_write@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hd44780_ll_data_write(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @hd44780_ll_register_write(i32 %4, i32 1)
%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):
define i32 @hd44780_ll_data_write(i32 %0) {
%2 = tail call i64 @hd44780_ll_register_write(i32 %0, i32 1)
%3 = icmp ne i64 %2, 0
%4 = sext i1 %3 to i32
ret i32 %4
}
__attribute__((constructor)) void fb_ctor__astznodezconv(void) {
label$0:;
label$1:;
}


x86 assembly (clang, -O0):
<fb_ctor__astznodezconv>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fb_ctor__astznodezconv+0x9>
jmp    110e <fb_ctor__astznodezconv+0xe>
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @fb_ctor__astznodezconv, i8* null }]
define void @fb_ctor__astznodezconv() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1
ret void
}

LLVM IR (-O2):
@llvm.global_ctors = appending global [0 x { i32, void ()*, i8* }] zeroinitializer
define void @fb_ctor__astznodezconv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_D_N(double number) { printf("%g\n", number); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define void @print_D_N(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}