#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
char *malloc(int);
int sqrt(long long);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *aux(long long num, long long rac) {
  if (num == 0)
    return "[]";
  long long i = rac;
  char *result = malloc(200);
  strcpy(result, "[]");
  while (i >= sqrt(num / 2.0) + 1) {
    long long diff = num - i * i;
    rac = sqrt(diff);
    if (strcmp(result, "[]") != 0) {
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <aux+0x2b>
lea    0xea6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1219 <aux+0xd9>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe7c(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xe59(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1060 <sqrt@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%rax
add    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jl     1211 <aux+0xd1>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
imul   -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1060 <sqrt@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe10(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     120c <aux+0xcc>
jmp    120c <aux+0xcc>
jmp    1191 <aux+0x51>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aux>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %rdi,%rdi
je     11d7 <aux+0x97>
mov    %rsi,%r14
mov    %rdi,%r12
mov    $0xc8,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
cvtsi2sd %r12,%xmm0
mulsd  0xe7f(%rip),%xmm0
cvttsd2si %xmm0,%rbx
mov    %rbx,%rdi
call   1060 <sqrt@plt>
add    $0x1,%eax
cltq
cmp    %r14,%rax
jg     11de <aux+0x9e>
mov    %r14,%rax
imul   %r14,%rax
sub    %rax,%r12
lea    0xe5f(%rip),%r13
nopl   0x0(%rax)
mov    %r12,%rdi
call   1060 <sqrt@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1040 <strcmp@plt>
mov    %rbx,%rdi
call   1060 <sqrt@plt>
add    $0x1,%eax
cltq
cmp    %r14,%rax
jle    11b0 <aux+0x70>
jmp    11de <aux+0x9e>
lea    0xe2a(%rip),%r15
mov    %r15,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"[]\00"
define i8* @aux(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%9 = load i64, i64* %4
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3
br label %43
12: ; preds = %2
%13 = load i64, i64* %5
store i64 %13, i64* %6
%14 = call i8* @malloc(i32 200)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %40, %12
%18 = load i64, i64* %6
%19 = load i64, i64* %4
%20 = sitofp i64 %19 to double
%21 = fdiv double %20, 2.000000e+00
%22 = fptosi double %21 to i64
%23 = call i32 @sqrt(i64 %22)
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = icmp sge i64 %18, %25
br i1 %26, label %27, label %41
27: ; preds = %17
%28 = load i64, i64* %4
%29 = load i64, i64* %6
%30 = load i64, i64* %6
%31 = mul nsw i64 %29, %30
%32 = sub nsw i64 %28, %31
store i64 %32, i64* %8
%33 = load i64, i64* %8
%34 = call i32 @sqrt(i64 %33)
%35 = sext i32 %34 to i64
store i64 %35, i64* %5
%36 = load i8*, i8** %7
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %27
br label %40
40: ; preds = %39, %27
br label %17
41: ; preds = %17
%42 = load i8*, i8** %7
store i8* %42, i8** %3
br label %43
43: ; preds = %41, %11
%44 = load i8*, i8** %3
ret i8* %44
}

LLVM IR (-O2):
@.str = [3 x i8] c"[]\00"
define i8* @aux(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %24, label %4
4: ; preds = %2
%5 = tail call dereferenceable_or_null(200) i8* @malloc(i32 200)
%6 = tail call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = sitofp i64 %0 to double
%8 = fmul double %7, 5.000000e-01
%9 = fptosi double %8 to i64
%10 = tail call i32 @sqrt(i64 %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = icmp sgt i64 %12, %1
br i1 %13, label %24, label %14
14: ; preds = %4
%15 = mul nsw i64 %1, %1
%16 = sub nsw i64 %0, %15
br label %17
17: ; preds = %14, %17
%18 = tail call i32 @sqrt(i64 %16)
%19 = tail call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @sqrt(i64 %9)
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = icmp sgt i64 %22, %1
br i1 %23, label %24, label %17
24: ; preds = %17, %4, %2
%25 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %2 ], [ %5, %4 ], [ %5, %17 ]
ret i8* %25
}