xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ setuid(int /*<<< orphan*/);
void squash_root() {
  if (geteuid() == 0)
    setuid(getuid());
}


x86 assembly (clang, -O0):
<squash_root>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    1153 <squash_root+0x23>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1050 <setuid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<squash_root>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
je     113f <squash_root+0xf>
pop    %rax
ret
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <setuid@plt>

LLVM IR (-O0):
define void @squash_root() {
%1 = call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @getuid()
%5 = call i32 @setuid(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @squash_root() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 (...) @getuid()
%5 = tail call i32 @setuid(i32 %4)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
char const *strtok_r(char *, char *, char **);
char *get_dst(const char *pkt) {
  char *tmp = strdup(pkt);
  char *tmp_tok;
  char *ret;
  ret = strtok_r(tmp, " ", &tmp_tok);
  ret = strdup(strtok_r(NULL, " ", &tmp_tok));
  free(tmp);
  return ret;
}


x86 assembly (clang, -O0):
<get_dst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <strtok_r@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xe94(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <strtok_r@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dst>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
call   1050 <strdup@plt>
mov    %rax,%r12
lea    0xeb9(%rip),%r14
mov    %rsp,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <strtok_r@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <strtok_r@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @get_dst(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i8* @strtok_r(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4)
store i8* %9, i8** %5
%10 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %4)
%11 = call i8* @strdup(i8* %10)
store i8* %11, i8** %5
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define noalias i8* @get_dst(i8* nocapture %0) {
%2 = alloca i8*
%3 = tail call i8* @strdup(i8* %0)
%4 = bitcast i8** %2 to i8*
%5 = call i8* @strtok_r(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2)
%6 = call i8* @strtok_r(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2)
%7 = call i8* @strdup(i8* %6)
%8 = call i32 @free(i8* %3)
ret i8* %7
}
/* Type definitions */
typedef scalar_t__ wint_t;

/* Variables and functions */
int islower(scalar_t__);
int iswlower(wint_t wc) { return ((wc < (wint_t)0x100 ? islower(wc) : 0)); }


x86 assembly (clang, -O0):
<iswlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x100,-0x8(%rbp)
jge    113b <iswlower+0x2b>
mov    -0x8(%rbp),%rdi
call   1030 <islower@plt>
mov    %eax,-0xc(%rbp)
jmp    1145 <iswlower+0x35>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <iswlower+0x35>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswlower>:
cmp    $0xff,%rdi
jg     111e <iswlower+0xe>
jmp    1030 <islower@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @iswlower(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 256
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @islower(i64 %6)
br label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %5
%10 = phi i32 [ %7, %5 ], [ 0, %8 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @iswlower(i64 %0) {
%2 = icmp slt i64 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @islower(i64 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
double sqrt(double);
float func(float ak, float x) {
  return 1.0 / sqrt(1.0 - ak * ak * (1.0 + x) / 2.0);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xebf(%rip),%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe8f(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0xed8(%rip),%xmm3
addsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xed0(%rip),%xmm0
addsd  %xmm3,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     114b <func+0x3b>
sqrtsd %xmm0,%xmm0
jmp    1158 <func+0x48>
call   1030 <sqrt@plt>
movsd  0xea8(%rip),%xmm3
divsd  %xmm0,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @func(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = fmul float %5, %6
%8 = fpext float %7 to double
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = fadd double 1.000000e+00, %10
%12 = fmul double %8, %11
%13 = fdiv double %12, 2.000000e+00
%14 = fsub double 1.000000e+00, %13
%15 = call double @sqrt(double %14)
%16 = fdiv double 1.000000e+00, %15
%17 = fptrunc double %16 to float
ret float %17
}

LLVM IR (-O2):
define float @func(float %0, float %1) {
%3 = fmul float %0, %0
%4 = fpext float %3 to double
%5 = fpext float %1 to double
%6 = fadd double %5, 1.000000e+00
%7 = fmul double %6, %4
%8 = fmul double %7, 5.000000e-01
%9 = fsub double 1.000000e+00, %8
%10 = tail call double @sqrt(double %9)
%11 = fdiv double 1.000000e+00, %10
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void ncs_quit() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @ncs_quit() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
char *lua_getstring(int /*<<< orphan*/);
int /*<<< orphan*/ lua_lua2C(int);
void luaI_error(void) {
  char *s = lua_getstring(lua_lua2C(1));
  if (s == 0)
    s = "(no message)";
  lua_error(s);
}


x86 assembly (clang, -O0):
<luaI_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1030 <lua_getstring@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <luaI_error+0x33>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lua_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaI_error>:
push   %rax
mov    $0x1,%edi
call   1050 <lua_lua2C@plt>
mov    %eax,%edi
call   1030 <lua_getstring@plt>
test   %rax,%rax
lea    0xeb4(%rip),%rdi
cmovne %rax,%rdi
pop    %rax
jmp    1040 <lua_error@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"(no message)\00"
define void @luaI_error() {
%1 = tail call i32 @lua_lua2C(i32 1)
%2 = tail call i8* @lua_getstring(i32 %1)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2
%5 = tail call i32 @lua_error(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *fvin_input_name() {
  printf("input name function was called\n");
  return ("default");
}


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

x86 assembly (clang, -O2):
<fvin_input_name>:
push   %rax
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"input name function was called\0A\00"
@.str.1 = [8 x i8] c"default\00"
define i8* @fvin_input_name() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"default\00"
@str = [31 x i8] c"input name function was called\00"
define i8* @fvin_input_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
}
void gtk_vbutton_box_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vbutton_box_get_type() {
ret void
}
/* Type definitions */
typedef union fc_sockaddr {
  int dummy;
} fc_sockaddr;
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert(struct genlist *, union fc_sockaddr *, int);
void fc_sockaddr_list_insert(struct fc_sockaddr_list *tthis,
                             union fc_sockaddr *pfoo, int idx) {
  genlist_insert((struct genlist *)tthis, pfoo, idx);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_insert>:
jmp    1030 <genlist_insert@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_insert(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1, i32 %2) {
%4 = alloca %struct.fc_sockaddr_list*
%5 = alloca %union.fc_sockaddr*
%6 = alloca i32
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %4
store %union.fc_sockaddr* %1, %union.fc_sockaddr** %5
store i32 %2, i32* %6
%7 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %4
%8 = bitcast %struct.fc_sockaddr_list* %7 to %struct.genlist*
%9 = load %union.fc_sockaddr*, %union.fc_sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @genlist_insert(%struct.genlist* %8, %union.fc_sockaddr* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%union.fc_sockaddr = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_insert(%struct.fc_sockaddr_list* %0, %union.fc_sockaddr* %1, i32 %2) {
%4 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%5 = tail call i32 @genlist_insert(%struct.genlist* %4, %union.fc_sockaddr* %1, i32 %2)
ret void
}
long nblock(size)
long size;
{ return ((size + 511) >> 9); }


x86 assembly (clang, -O0):
<nblock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1ff,%rax
sar    $0x9,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nblock>:
lea    0x1ff(%rdi),%rax
sar    $0x9,%rax
ret

LLVM IR (-O0):
define i64 @nblock(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 511
%5 = ashr i64 %4, 9
ret i64 %5
}

LLVM IR (-O2):
define i64 @nblock(i64 %0) {
%2 = add nsw i64 %0, 511
%3 = ashr i64 %2, 9
ret i64 %3
}
int ft_itoa_len(int n) {
  int len;
  unsigned int val;
  len = 0;
  if (n < 0)
    len++;
  val = (n < 0) ? -n : n;
  while (val > 0) {
    val /= 10;
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_itoa_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1121 <ft_itoa_len+0x21>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1138 <ft_itoa_len+0x38>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113e <ft_itoa_len+0x3e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    116b <ft_itoa_len+0x6b>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <ft_itoa_len+0x44>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_itoa_len>:
test   %edi,%edi
je     1135 <ft_itoa_len+0x35>
mov    %edi,%eax
shr    $0x1f,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <ft_itoa_len+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_itoa_len(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = lshr i32 %0, 31
%5 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %5, %3 ]
%8 = phi i32 [ %10, %6 ], [ %4, %3 ]
%9 = udiv i32 %7, 10
%10 = add nuw nsw i32 %8, 1
%11 = icmp ult i32 %7, 10
br i1 %11, label %12, label %6
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %10, %6 ]
ret i32 %13
}
/* Variables and functions */
scalar_t__ system(char *);
void clearscreen() {
  if (system("clear"))
    system("cls");
}


x86 assembly (clang, -O0):
<clearscreen>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
je     1136 <clearscreen+0x26>
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearscreen>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
je     112f <clearscreen+0x1f>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [4 x i8] c"cls\00"
define void @clearscreen() {
%1 = call i64 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i64 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [4 x i8] c"cls\00"
define void @clearscreen() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i64 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret void
}
int dd_geq_d_dd(double a, const double *b) {
  return (a > b[0] || (a == b[0] && b[1] <= 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_geq_d_dd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
ja     115b <dd_geq_d_dd+0x5b>
movsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x12(%rbp)
jne    1155 <dd_geq_d_dd+0x55>
jp     1155 <dd_geq_d_dd+0x55>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_geq_d_dd>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1125 <dd_geq_d_dd+0x25>
ucomisd %xmm0,%xmm1
jne    1126 <dd_geq_d_dd+0x26>
jp     1126 <dd_geq_d_dd+0x26>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rdi),%xmm0
setae  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_geq_d_dd(double %0, double* %1) {
%3 = alloca double
%4 = alloca double*
store double %0, double* %3
store double* %1, double** %4
%5 = load double, double* %3
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = fcmp ogt double %5, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double, double* %3
%12 = load double*, double** %4
%13 = getelementptr inbounds double, double* %12, i64 0
%14 = load double, double* %13
%15 = fcmp oeq double %11, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp ole double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @dd_geq_d_dd(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp olt double %3, %0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %0
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = fcmp ole double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
int _IOFBF;
int _IONBF;
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int,
                           int /*<<< orphan*/);
void setbuf(FILE *stream, char *buf) {
  int mode = buf ? _IOFBF : _IONBF;
  setvbuf(stream, buf, mode, BUFSIZ);
}


x86 assembly (clang, -O0):
<setbuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <setbuf+0x2c>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
jmp    1148 <setbuf+0x38>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    0x2e78(%rip),%rax
mov    (%rax),%ecx
call   1030 <setvbuf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbuf>:
test   %rsi,%rsi
jne    111e <setbuf+0xe>
mov    0x2ecc(%rip),%rax
jmp    1125 <setbuf+0x15>
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @_IOFBF
br label %12
10: ; preds = %2
%11 = load i32, i32* @_IONBF
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
store i32 %13, i32* %5
%14 = load i32*, i32** %3
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = load i32, i32* @BUFSIZ
%18 = call i32 @setvbuf(i32* %14, i8* %15, i32 %16, i32 %17)
ret void
}

LLVM IR (-O2):
@_IOFBF = global i32 0
@_IONBF = global i32 0
@BUFSIZ = global i32 0
define void @setbuf(i32* nocapture %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = load i32, i32* @_IOFBF
%5 = load i32, i32* @_IONBF
%6 = select i1 %3, i32 %5, i32 %4
%7 = load i32, i32* @BUFSIZ
%8 = tail call i32 @setvbuf(i32* %0, i8* %1, i32 %6, i32 %7)
ret void
}
/* Variables and functions */
unsigned long _mergeSort(unsigned long *, unsigned long *, int /*<<< orphan*/,
                         unsigned long);
scalar_t__ malloc(int);
unsigned long int mergeSort(unsigned long int arr[],
                            unsigned long int array_size) {
  unsigned long int *temp =
      (unsigned long int *)malloc(sizeof(unsigned long int) * array_size);
  return _mergeSort(arr, temp, 0, array_size - 1);
}


x86 assembly (clang, -O0):
<mergeSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    %edx,%edx
call   1030 <_mergeSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergeSort>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x0(,%rsi,8),%edi
call   1040 <malloc@plt>
add    $0xffffffffffffffff,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
xor    %edx,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <_mergeSort@plt>

LLVM IR (-O0):
define i64 @mergeSort(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64*
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = mul i64 8, %6
%8 = trunc i64 %7 to i32
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i64*
store i64* %10, i64** %5
%11 = load i64*, i64** %3
%12 = load i64*, i64** %5
%13 = load i64, i64* %4
%14 = sub i64 %13, 1
%15 = call i64 @_mergeSort(i64* %11, i64* %12, i32 0, i64 %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @mergeSort(i64* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %3, 3
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i64*
%7 = add i64 %1, -1
%8 = tail call i64 @_mergeSort(i64* %0, i64* %6, i32 0, i64 %7)
ret i64 %8
}
double sign(double a) { return (a < 0 ? -1 : 1); }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xeec(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 -1, i32 1
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = select i1 %2, double -1.000000e+00, double 1.000000e+00
ret double %3
}
/* Type definitions */
struct folder {
  int dummy;
};

/* Variables and functions */
struct folder *sm_request_folder(const char *text, struct folder *exclude) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
%struct.folder = type { i32 }
define noalias %struct.folder* @sm_request_folder(i8* nocapture readnone %0, %struct.folder* nocapture readnone %1) {
ret %struct.folder* null
}
int _col(int square) { return square % 8; }


x86 assembly (clang, -O0):
<_col>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_col>:
mov    %edi,%eax
lea    0x7(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
and    $0xfffffff8,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @_col(i32 %0) {
%2 = srem i32 %0, 8
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ BackToFront_EM();
void blitscreen(void) { BackToFront_EM(); }


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

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

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

LLVM IR (-O2):
define void @blitscreen() {
%1 = tail call i32 (...) @BackToFront_EM()
ret void
}
/* Variables and functions */
int ENOSYS;
int request_module(const char *name, ...) { return -ENOSYS; }


x86 assembly (clang, -O0):
<request_module>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_module>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @request_module(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @request_module(i8* nocapture readnone %0, ...) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Mali_SetBase(int *);
int /*<<< orphan*/ RunMaliTest_sim4_t760_part0();
int RunMaliTest_sim4_t760(int *base) {
  Mali_SetBase(base);
  RunMaliTest_sim4_t760_part0();
}


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

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

LLVM IR (-O0):
define i32 @RunMaliTest_sim4_t760(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @Mali_SetBase(i32* %4)
%6 = call i32 (...) @RunMaliTest_sim4_t760_part0()
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @RunMaliTest_sim4_t760(i32* %0) {
%2 = tail call i32 @Mali_SetBase(i32* %0)
%3 = tail call i32 (...) @RunMaliTest_sim4_t760_part0()
ret i32 undef
}
int roundupsize(int n) {
  unsigned int nbits = 0;
  unsigned int n2 = (unsigned int)n >> 5;
  do {
    n2 >>= 3;
    nbits += 3;
  } while (n2);
  return ((n >> nbits) + 1) << nbits;
}


x86 assembly (clang, -O0):
<roundupsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x5,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1117 <roundupsize+0x17>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
add    $0x1,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundupsize>:
mov    %edi,%eax
mov    %edi,%edx
shr    $0x5,%edx
xor    %ecx,%ecx
mov    %edx,%esi
nopl   0x0(%rax,%rax,1)
shr    $0x3,%esi
add    $0x3,%ecx
cmp    $0x7,%edx
mov    %esi,%edx
ja     1110 <roundupsize+0x10>
sar    %cl,%eax
add    $0x1,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @roundupsize(i32 %0) {
%2 = lshr i32 %0, 5
br label %3
3: ; preds = %3, %1
%4 = phi i32 [ 0, %1 ], [ %7, %3 ]
%5 = phi i32 [ %2, %1 ], [ %6, %3 ]
%6 = lshr i32 %5, 3
%7 = add nuw nsw i32 %4, 3
%8 = icmp ult i32 %5, 8
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = ashr i32 %0, %7
%11 = add nsw i32 %10, 1
%12 = shl i32 %11, %7
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test(int M) {
  int i;
  for (i = 0; i <= M; i++) {
    {
      hash(1);
      hash(i);
    };
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114e <test+0x3e>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%edi
call   1030 <hash@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <test+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1138 <test+0x28>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
mov    $0x1,%edi
call   1030 <hash@plt>
mov    %ebp,%edi
call   1030 <hash@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1120 <test+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @test(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @hash(i32 1)
%6 = tail call i32 @hash(i32 %4)
%7 = add nuw i32 %4, 1
%8 = icmp eq i32 %4, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
int f(void) {
  double(*y)[3];
  double z[3];
  y = &z;
  return 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
%1 = alloca [3 x double]*
%2 = alloca [3 x double]
store [3 x double]* %2, [3 x double]** %1
ret i32 0
}

LLVM IR (-O2):
define i32 @f() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ShowCursor(int);
void ShowCursorAbs(int w) {
  static int stat = 0;
  if (w) {
    if (stat == -1) {
      stat++;
      ShowCursor(1);
    }
  } else {
    if (stat == 0) {
      stat--;
      ShowCursor(0);
    }
  }
}


x86 assembly (clang, -O0):
<ShowCursorAbs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <ShowCursorAbs+0x40>
cmpl   $0xffffffff,0x2f00(%rip)
jne    114b <ShowCursorAbs+0x3b>
mov    0x2ef4(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2eeb(%rip)
mov    $0x1,%edi
call   1030 <ShowCursor@plt>
jmp    1178 <ShowCursorAbs+0x68>
cmpl   $0x0,0x2ed5(%rip)
jne    1173 <ShowCursorAbs+0x63>
mov    0x2ec9(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2ec0(%rip)
xor    %edi,%edi
call   1030 <ShowCursor@plt>
jmp    1178 <ShowCursorAbs+0x68>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowCursorAbs>:
mov    0x2f16(%rip),%cl
test   %edi,%edi
je     1134 <ShowCursorAbs+0x24>
mov    $0x1,%eax
test   $0x1,%cl
je     113b <ShowCursorAbs+0x2b>
test   %edi,%edi
sete   0x2eff(%rip)
mov    %eax,%edi
jmp    1030 <ShowCursor@plt>
xor    %eax,%eax
test   $0x1,%cl
je     1124 <ShowCursorAbs+0x14>
ret

LLVM IR (-O0):
@ShowCursorAbs.stat = internal global i32 0
define void @ShowCursorAbs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i32, i32* @ShowCursorAbs.stat
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i32, i32* @ShowCursorAbs.stat
%10 = add nsw i32 %9, 1
store i32 %10, i32* @ShowCursorAbs.stat
%11 = call i32 @ShowCursor(i32 1)
br label %12
12: ; preds = %8, %5
br label %21
13: ; preds = %1
%14 = load i32, i32* @ShowCursorAbs.stat
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i32, i32* @ShowCursorAbs.stat
%18 = add nsw i32 %17, -1
store i32 %18, i32* @ShowCursorAbs.stat
%19 = call i32 @ShowCursor(i32 0)
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %20, %12
ret void
}

LLVM IR (-O2):
@ShowCursorAbs.stat = internal unnamed_addr global i1 false
define void @ShowCursorAbs(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i1, i1* @ShowCursorAbs.stat
br i1 %2, label %5, label %4
4: ; preds = %1
br i1 %3, label %6, label %9
5: ; preds = %1
br i1 %3, label %9, label %6
6: ; preds = %5, %4
%7 = phi i32 [ 1, %4 ], [ 0, %5 ]
store i1 %2, i1* @ShowCursorAbs.stat
%8 = tail call i32 @ShowCursor(i32 %7)
br label %9
9: ; preds = %6, %5, %4
ret void
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mg_mqtt_prepend_header(struct mg_connection *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void mg_mqtt_disconnect(struct mg_connection *nc) {
  mg_mqtt_prepend_header(nc, 14, 0, 0);
}


x86 assembly (clang, -O0):
<mg_mqtt_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xe,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <mg_mqtt_prepend_header@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_mqtt_disconnect>:
mov    $0xe,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <mg_mqtt_prepend_header@plt>

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

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
define void @mg_mqtt_disconnect(%struct.mg_connection* %0) {
%2 = tail call i32 @mg_mqtt_prepend_header(%struct.mg_connection* %0, i32 14, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", sizeof(int));
  printf("%d", sizeof(char));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ InitApp();
int /*<<< orphan*/ UpdateLeds();
int32_t main(void) {
  InitApp();
  UpdateLeds();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <InitApp@plt>
mov    $0x0,%al
call   1040 <UpdateLeds@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @InitApp()
%2 = call i32 (...) @UpdateLeds()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitApp()
%2 = tail call i32 (...) @UpdateLeds()
ret i32 0
}
void glDeleteRenderbuffers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteRenderbuffers() {
ret void
}
void gestionnaire(int inutilise) {}


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

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

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

LLVM IR (-O2):
define void @gestionnaire(i32 %0) {
ret void
}
/* Variables and functions */
unsigned long CPUbasepriGet();
unsigned long IntPriorityMaskGet(void) { return (CPUbasepriGet()); }


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

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

LLVM IR (-O0):
define i64 @IntPriorityMaskGet() {
%1 = call i64 (...) @CPUbasepriGet()
ret i64 %1
}

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

/* Variables and functions */
int /*<<< orphan*/ glTexCoord1s(int /*<<< orphan*/);
void TexCoord1s(GLshort s) { glTexCoord1s(s); }


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

x86 assembly (clang, -O2):
<TexCoord1s>:
jmp    1030 <glTexCoord1s@plt>

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

LLVM IR (-O2):
define void @TexCoord1s(i32 %0) {
%2 = tail call i32 @glTexCoord1s(i32 %0)
ret void
}
void main() {
  int numero = 0;
  unsigned int inteiro = 0;
  short int algarismo = 0;
  long int habitantes = 0;
  char letra = 'a';
  unsigned char simbolo = '0';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
movq   $0x0,-0x18(%rbp)
movb   $0x61,-0x19(%rbp)
movb   $0x30,-0x1a(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i64
%5 = alloca i8
%6 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
store i16 0, i16* %3
store i64 0, i64* %4
store i8 97, i8* %5
store i8 48, i8* %6
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("frog.in", "r", stdin);
  freopen("frog.out", "w+", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xedd(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xeca(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
lea    0xecf(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"frog.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [9 x i8] c"frog.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"frog.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [9 x i8] c"frog.out\00"
@.str.3 = [3 x i8] c"w+\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsnansumpw(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  double v = stdlib_strided_dsnansumpw(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1030 <stdlib_strided_dsnansumpw@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1030 <stdlib_strided_dsnansumpw@plt>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsnansumpw(i32 %6, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsnansumpw(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
int c091(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c091() {
ret i32 0
}