xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned char *, size_t);
size_t strlen(char *);
size_t log_reponame(unsigned char *data, size_t length, char *buf,
                    size_t buflen) {
  data += 20;
  memcpy(buf, data, length - 20);
  return strlen(buf);
}


x86 assembly (clang, -O0):
<log_reponame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
sub    $0x14,%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_reponame>:
push   %rbx
mov    %rdx,%rbx
lea    0x14(%rdi),%rax
lea    -0x14(%rsi),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i64 @log_reponame(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 20
store i8* %10, i8** %5
%11 = load i8*, i8** %7
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = sub i64 %13, 20
%15 = call i32 @memcpy(i8* %11, i8* %12, i64 %14)
%16 = load i8*, i8** %7
%17 = call i64 @strlen(i8* %16)
ret i64 %17
}

LLVM IR (-O2):
define i64 @log_reponame(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 20
%6 = add i64 %1, -20
%7 = tail call i32 @memcpy(i8* %2, i8* %5, i64 %6)
%8 = tail call i64 @strlen(i8* dereferenceable(1) %2)
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int dag_get_erf_types(int, int /*<<< orphan*/ *, int);
int dag_get_stream_erf_types(int dagfd, int stream_num, uint8_t *erfs,
                             int size) {
  return dag_get_erf_types(dagfd, erfs, size);
}


x86 assembly (clang, -O0):
<dag_get_stream_erf_types>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <dag_get_erf_types@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dag_get_stream_erf_types>:
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <dag_get_erf_types@plt>

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

LLVM IR (-O2):
define i32 @dag_get_stream_erf_types(i32 %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @dag_get_erf_types(i32 %0, i32* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sendCmd(int, char *, unsigned int);
void sketchFont(int fd, unsigned int fontNum) {
  sendCmd(fd, "font %u\n", fontNum);
}


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

x86 assembly (clang, -O2):
<sketchFont>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <sendCmd@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"font %u\0A\00"
define void @sketchFont(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 = call i32 @sendCmd(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"font %u\0A\00"
define void @sketchFont(i32 %0, i32 %1) {
%3 = tail call i32 @sendCmd(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int atexit(void (*function)(void)) {}


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

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

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

LLVM IR (-O2):
define i32 @atexit(void ()* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printscreen(char *str) {
  printf("%s\n", str);
  return;
}


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

x86 assembly (clang, -O2):
<printscreen>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printscreen(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prs_error(char *);
void syntax() { prs_error("Syntax error"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Syntax error\00"
define void @syntax() {
%1 = call i32 @prs_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Syntax error\00"
define void @syntax() {
%1 = tail call i32 @prs_error(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int MP_lichtschranke(int /*<<< orphan*/);
int /*<<< orphan*/ MP_motor(int, int);
void MP_p3wait2(void) {
  int LV_ii;
  volatile int PV_dummy1;
  volatile int PV_dummy2;
  MP_motor(2, 1);
  while (MP_lichtschranke(0) == 1)
    ;
  while (MP_lichtschranke(0) == 0)
    ;
}


x86 assembly (clang, -O0):
<MP_p3wait2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <MP_motor@plt>
xor    %edi,%edi
call   1030 <MP_lichtschranke@plt>
cmp    $0x1,%eax
jne    114c <MP_p3wait2+0x2c>
jmp    1137 <MP_p3wait2+0x17>
jmp    1151 <MP_p3wait2+0x31>
xor    %edi,%edi
call   1030 <MP_lichtschranke@plt>
cmp    $0x0,%eax
jne    1166 <MP_p3wait2+0x46>
jmp    1151 <MP_p3wait2+0x31>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MP_p3wait2>:
push   %rax
mov    $0x2,%edi
mov    $0x1,%esi
call   1040 <MP_motor@plt>
xor    %edi,%edi
call   1030 <MP_lichtschranke@plt>
cmp    $0x1,%eax
je     1130 <MP_p3wait2+0x10>
nopl   0x0(%rax)
xor    %edi,%edi
call   1030 <MP_lichtschranke@plt>
test   %eax,%eax
je     1140 <MP_p3wait2+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @MP_p3wait2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @MP_motor(i32 2, i32 1)
br label %5
5: ; preds = %8, %0
%6 = call i32 @MP_lichtschranke(i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %5
br label %5
9: ; preds = %5
br label %10
10: ; preds = %13, %9
%11 = call i32 @MP_lichtschranke(i32 0)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %10
14: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @MP_p3wait2() {
%1 = tail call i32 @MP_motor(i32 2, i32 1)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @MP_lichtschranke(i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %2, label %5
5: ; preds = %2, %5
%6 = tail call i32 @MP_lichtschranke(i32 0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
int mat(int *const p __attribute__((pass_object_size(2))), int n) {
  return p[n];
}


x86 assembly (clang, -O0):
<mat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat>:
movslq %edx,%rax
mov    (%rdi,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @mat(i32* nocapture %0, i64 %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ HDMITX_WriteI2C_Byte(int, int);
void GenerateDDCSCLK() {
  HDMITX_WriteI2C_Byte(0x10, (0 << 1) | (1 << 0));
  HDMITX_WriteI2C_Byte(0x15, 0xA);
}


x86 assembly (clang, -O0):
<GenerateDDCSCLK>:
push   %rbp
mov    %rsp,%rbp
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x15,%edi
mov    $0xa,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenerateDDCSCLK>:
push   %rax
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <HDMITX_WriteI2C_Byte@plt>
mov    $0x15,%edi
mov    $0xa,%esi
pop    %rax
jmp    1030 <HDMITX_WriteI2C_Byte@plt>

LLVM IR (-O0):
define void @GenerateDDCSCLK() {
%1 = call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 1)
%2 = call i32 @HDMITX_WriteI2C_Byte(i32 21, i32 10)
ret void
}

LLVM IR (-O2):
define void @GenerateDDCSCLK() {
%1 = tail call i32 @HDMITX_WriteI2C_Byte(i32 16, i32 1)
%2 = tail call i32 @HDMITX_WriteI2C_Byte(i32 21, i32 10)
ret void
}
int do_935() { return 935; }


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

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

LLVM IR (-O0):
define i32 @do_935() {
ret i32 935
}

LLVM IR (-O2):
define i32 @do_935() {
ret i32 935
}
void swapInt(int *a, int *b) {
  int aux = *a;
  *a = *b;
  *b = aux;
}


x86 assembly (clang, -O0):
<swapInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @swapInt(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 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swapInt(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func2();
int func1() {
  func2();
  return 73;
}


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

x86 assembly (clang, -O2):
<func1>:
push   %rax
xor    %eax,%eax
call   1030 <func2@plt>
mov    $0x49,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func1() {
%1 = call i32 (...) @func2()
ret i32 73
}

LLVM IR (-O2):
define i32 @func1() {
%1 = tail call i32 (...) @func2()
ret i32 73
}
/* Variables and functions */
int /*<<< orphan*/ isdigit(char const);
int isdigits(const char *s) {
  for (; *s; s++)
    if (!isdigit(*s))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isdigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <isdigits+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    114a <isdigits+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1167 <isdigits+0x57>
jmp    114f <isdigits+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <isdigits+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigits>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <isdigits+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isdigits+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isdigits+0x20>
jmp    114b <isdigits+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isdigits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isdigit(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *ptr, const char *pFileName, int line) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @xfree(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
void invalidFunctionArgBool_abs(bool b, double x, double y) {
  (void)abs(true);
  (void)abs(b);
  (void)abs(x < y);
}


x86 assembly (clang, -O0):
<invalidFunctionArgBool_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @invalidFunctionArgBool_abs(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%7 = call i32 @abs(i32 1)
%8 = load i32, i32* %4
%9 = call i32 @abs(i32 %8)
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fcmp olt double %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @abs(i32 %13)
ret void
}

LLVM IR (-O2):
define void @invalidFunctionArgBool_abs(i32 %0, double %1, double %2) {
ret void
}
float CubicBezierP1(float t, float p) {
  float k = 1 - t;
  return 3 * k * k * t * p;
}


x86 assembly (clang, -O0):
<CubicBezierP1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  0xeee(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xed8(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CubicBezierP1>:
movss  0xef8(%rip),%xmm2
subss  %xmm0,%xmm2
movss  0xef0(%rip),%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm2,%xmm3
mulss  %xmm3,%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CubicBezierP1(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = fsub float 1.000000e+00, %6
store float %7, float* %5
%8 = load float, float* %5
%9 = fmul float 3.000000e+00, %8
%10 = load float, float* %5
%11 = fmul float %9, %10
%12 = load float, float* %3
%13 = fmul float %11, %12
%14 = load float, float* %4
%15 = fmul float %13, %14
ret float %15
}

LLVM IR (-O2):
define float @CubicBezierP1(float %0, float %1) {
%3 = fsub float 1.000000e+00, %0
%4 = fmul float %3, 3.000000e+00
%5 = fmul float %3, %4
%6 = fmul float %5, %0
%7 = fmul float %6, %1
ret float %7
}
void cortexm_svcall(void (*call)(void *), void *args) { call(args); }


x86 assembly (clang, -O0):
<cortexm_svcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cortexm_svcall>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define void @cortexm_svcall(void (i8*)* nocapture %0, i8* %1) {
tail call void %0(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ divisore(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Insira um numero: \n");
  scanf("%d", &n);
  divisore(n);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <divisore@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Insira um numero: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 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 @divisore(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [19 x i8] c"Insira um numero: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 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 @divisore(i32 %5)
ret i32 0
}
int pthread_cond_destroy() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_cond_destroy() {
ret i32 0
}
void set_n_bit(unsigned char *var, unsigned char num, unsigned char bit) {
  if (bit)
    *var |= 1 << num;
  else
    *var &= ~(1 << num);
}


x86 assembly (clang, -O0):
<set_n_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
cmpb   $0x0,-0xa(%rbp)
je     1138 <set_n_bit+0x38>
movzbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
jmp    1151 <set_n_bit+0x51>
movzbl -0x9(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
and    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_n_bit>:
mov    %esi,%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    (%rdi),%cl
mov    %esi,%eax
not    %al
and    %cl,%al
or     %sil,%cl
test   %edx,%edx
movzbl %cl,%ecx
movzbl %al,%eax
cmovne %ecx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @set_n_bit(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %3
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = shl i32 1, %11
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = or i32 %15, %12
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
br label %28
18: ; preds = %3
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = shl i32 1, %20
%22 = xor i32 %21, -1
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, %22
%27 = trunc i32 %26 to i8
store i8 %27, i8* %23
br label %28
28: ; preds = %18, %9
ret void
}

LLVM IR (-O2):
define void @set_n_bit(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
%5 = zext i8 %1 to i32
%6 = shl nuw i32 1, %5
%7 = load i8, i8* %0
%8 = trunc i32 %6 to i8
%9 = xor i8 %8, -1
%10 = and i8 %7, %9
%11 = or i8 %7, %8
%12 = select i1 %4, i8 %10, i8 %11
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hextochar(int, char *);
int /*<<< orphan*/ mystrlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void PrintInt(int i) {
  char buffer[16];
  hextochar(i, buffer);
  write(1, buffer, mystrlen(buffer));
  write(1, "\n", mystrlen("\n"));
}


x86 assembly (clang, -O0):
<PrintInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1050 <hextochar@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <mystrlen@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xe91(%rip),%rdi
call   1040 <mystrlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe7e(%rip),%rsi
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <hextochar@plt>
mov    %rbx,%rdi
call   1040 <mystrlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xea2(%rip),%rbx
mov    %rbx,%rdi
call   1040 <mystrlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @PrintInt(i32 %0) {
%2 = alloca i32
%3 = alloca [16 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%6 = call i32 @hextochar(i32 %4, i8* %5)
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%9 = call i32 @mystrlen(i8* %8)
%10 = call i32 @write(i32 1, i8* %7, i32 %9)
%11 = call i32 @mystrlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @PrintInt(i32 %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @hextochar(i32 %0, i8* %3)
%5 = call i32 @mystrlen(i8* %3)
%6 = call i32 @write(i32 1, i8* %3, i32 %5)
%7 = call i32 @mystrlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EMLINK;
int /*<<< orphan*/ errno;
int _link(char *old, char *new) {
  (void)(old);
  (void)(new);
  errno = EMLINK;
  return -1;
}


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2edd(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_link>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@EMLINK = global i32 0
@errno = global i32 0
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EMLINK
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
scalar_t__ random();
int /*<<< orphan*/ srandom(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
unsigned int get_rand(void) {
  unsigned int seed;
  seed = (unsigned int)time(NULL);
  srandom(seed);
  return (unsigned int)random();
}


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1050 <random@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <random@plt>

LLVM IR (-O0):
define i32 @get_rand() {
%1 = alloca i32
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = call i32 @srandom(i32 %4)
%6 = call i64 (...) @random()
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_rand() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srandom(i32 %2)
%4 = tail call i64 (...) @random()
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int ldrfilexists(const char *path) {
  struct stat buf;
  return !stat(path, &buf);
}


x86 assembly (clang, -O0):
<ldrfilexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @ldrfilexists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @ldrfilexists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void AI_free(void *mem) { free(mem); }


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

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

LLVM IR (-O2):
define void @AI_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct map_si {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _pbcM_free(struct map_si *);
void _pbcM_si_delete(struct map_si *map) { _pbcM_free(map); }


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

x86 assembly (clang, -O2):
<_pbcM_si_delete>:
jmp    1030 <_pbcM_free@plt>

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

LLVM IR (-O2):
%struct.map_si = type { i32 }
define void @_pbcM_si_delete(%struct.map_si* %0) {
%2 = tail call i32 @_pbcM_free(%struct.map_si* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void cgi_http_header_set_cookie(char *name, char *value) {
  printf("Set-Cookie: %s=%s; Path=/;\n", name, value);
}


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

x86 assembly (clang, -O2):
<cgi_http_header_set_cookie>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Set-Cookie: %s=%s; Path=/;\0A\00"
define void @cgi_http_header_set_cookie(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Set-Cookie: %s=%s; Path=/;\0A\00"
define void @cgi_http_header_set_cookie(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, int /*<<< orphan*/ *, int);
void load_bank(uint8_t *p, int fd) {
  if (read(fd, p, 16384) < 1) {
    perror("read");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<load_bank>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    $0x4000,%edx
call   1030 <read@plt>
cmp    $0x1,%eax
jge    116f <load_bank+0x3f>
lea    0xea0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_bank>:
push   %rax
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
mov    $0x4000,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1149 <load_bank+0x19>
pop    %rax
ret
lea    0xeb0(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"read\00"
define void @load_bank(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @read(i32 %5, i32* %6, i32 16384)
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"read\00"
define void @load_bank(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @read(i32 %1, i32* %0, i32 16384)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
long long __nv_llrintf(float);
long long llrintf(float __a) { return __nv_llrintf(__a); }


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

x86 assembly (clang, -O2):
<llrintf>:
jmp    1030 <__nv_llrintf@plt>

LLVM IR (-O0):
define i64 @llrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @__nv_llrintf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @llrintf(float %0) {
%2 = tail call i64 @__nv_llrintf(float %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ calculate_output(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  while (1) {
    int input;
    scanf("%d", &input);
    calculate_output(input);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <calculate_output@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%r14
lea    0x4(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <calculate_output@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @calculate_output(i32 %5)
br label %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @calculate_output(i32 %5)
br label %3
}
void s_init(void) {}


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

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

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

LLVM IR (-O2):
define void @s_init() {
ret void
}
/* Variables and functions */
scalar_t__ SIM_power_gatecap(double, int /*<<< orphan*/);
double SIM_rr_arbiter_pri_cap() {
  double Ctotal = 0;
  Ctotal += SIM_power_gatecap((5.4 * 0.0875) + (30.5 * 0.0875), 0);
  return Ctotal;
}


x86 assembly (clang, -O0):
<SIM_rr_arbiter_pri_cap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xed8(%rip),%xmm0
xor    %edi,%edi
call   1030 <SIM_power_gatecap@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIM_rr_arbiter_pri_cap>:
push   %rax
movsd  0xee7(%rip),%xmm0
xor    %edi,%edi
call   1030 <SIM_power_gatecap@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SIM_rr_arbiter_pri_cap() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i64 @SIM_power_gatecap(double 3.141250e+00, i32 0)
%3 = sitofp i64 %2 to double
%4 = load double, double* %1
%5 = fadd double %4, %3
store double %5, double* %1
%6 = load double, double* %1
ret double %6
}

LLVM IR (-O2):
define double @SIM_rr_arbiter_pri_cap() {
%1 = tail call i64 @SIM_power_gatecap(double 3.141250e+00, i32 0)
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int *malloc(int);
int main(void) {
  int *int_block = malloc(4 * sizeof(int));
  for (int i = 0; i < 4; i++)
    int_block[i] = i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    115a <main+0x4a>
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1134 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 16)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void line_printer(void) {
  for (int i = 0; i < 100; i++)
    printf(i == 100 - 1 || !i ? "\n" : "-");
}


x86 assembly (clang, -O0):
<line_printer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    116f <line_printer+0x5f>
mov    $0x1,%al
cmpl   $0x63,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1144 <line_printer+0x34>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%cl
lea    0xeb4(%rip),%rdi
lea    0xeab(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <line_printer+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_printer>:
push   %r15
push   %r14
push   %rbx
mov    $0x64,%ebx
lea    0xedf(%rip),%r14
lea    0xeda(%rip),%r15
nopl   0x0(%rax,%rax,1)
cmp    $0x64,%ebx
mov    %r15,%rdi
cmove  %r14,%rdi
cmp    $0x1,%ebx
cmove  %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <line_printer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c"-\00"
define void @line_printer() {
br label %2
1: ; preds = %2
ret void
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %9, %2 ]
%4 = icmp eq i32 %3, 99
%5 = icmp eq i32 %3, 0
%6 = or i1 %4, %5
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
%9 = add nuw nsw i32 %3, 1
%10 = icmp eq i32 %9, 100
br i1 %10, label %1, label %2
}
int ex_design(designname, libname, cellname)
char *designname, *libname, *cellname;
{
  dprintf("design %s (cellref %s (libraryref %s))\n", designname, libname,
          cellname);
  return (1);
}


x86 assembly (clang, -O0):
<ex_design>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <dprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ex_design>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xedf(%rip),%rdi
xor    %eax,%eax
call   1030 <dprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"design %s (cellref %s (libraryref %s))\0A\00"
define i32 @ex_design(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @dprintf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* %9)
ret i32 1
}

LLVM IR (-O2):
@.str = [40 x i8] c"design %s (cellref %s (libraryref %s))\0A\00"
define i32 @ex_design(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 (i8*, i8*, i8*, i8*, ...) bitcast (i32 (...)* @dprintf to i32 (i8*, i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *);
void fwbug(void *fwdesc) { printf("[FIRMWARE BUG] %r", fwdesc); }


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

x86 assembly (clang, -O2):
<fwbug>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [18 x i8] c"[FIRMWARE BUG] %r\00"
define void @fwbug(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void megaInit(void) {
  {
    _1_sort__opaque_list2_1_i$nit();
    _1_sort__opaque_list1_1_i$nit();
  }
}


x86 assembly (clang, -O0):
<megaInit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_1_sort__opaque_list2_1_i$nit@plt>
mov    $0x0,%al
call   1040 <_1_sort__opaque_list1_1_i$nit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<megaInit>:
push   %rax
xor    %eax,%eax
call   1030 <_1_sort__opaque_list2_1_i$nit@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_1_sort__opaque_list1_1_i$nit@plt>

LLVM IR (-O0):
define void @megaInit() {
%1 = call i32 (...) @"_1_sort__opaque_list2_1_i$nit"()
%2 = call i32 (...) @"_1_sort__opaque_list1_1_i$nit"()
ret void
}

LLVM IR (-O2):
define void @megaInit() {
%1 = tail call i32 (...) @"_1_sort__opaque_list2_1_i$nit"()
%2 = tail call i32 (...) @"_1_sort__opaque_list1_1_i$nit"()
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *dupStr(const char *str) {
  size_t len;
  char *dst;
  if (str == NULL) {
    return NULL;
  }
  len = strlen(str);
  dst = malloc(len + 1);
  memcpy(dst, str, len);
  dst[len] = '\0';
  return dst;
}


x86 assembly (clang, -O0):
<dupStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <dupStr+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1197 <dupStr+0x67>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupStr>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     1166 <dupStr+0x36>
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
jmp    1168 <dupStr+0x38>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @dupStr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* null, i8** %2
br label %23
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i64 @strlen(i8* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
%13 = add i64 %12, 1
%14 = call i8* @malloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %4
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %5
store i8* %22, i8** %2
br label %23
23: ; preds = %9, %8
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @dupStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @memcpy(i8* %6, i8* %0, i64 %4)
%8 = getelementptr inbounds i8, i8* %6, i64 %4
store i8 0, i8* %8
br label %9
9: ; preds = %1, %3
%10 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void unlink_f() { unlink("8_random_name"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"8_random_name\00"
define void @unlink_f() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"8_random_name\00"
define void @unlink_f() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}