#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 *ft_itoa(long double);
long double ft_power(int, long double);
char *ft_strinsert(char *, char *, int);
char *ft_strjoinnchar(char *, int, int /*<<< orphan*/);
char *ft_get_expo(long double *a) {
  long double f;
  long double x;
  int sign;
  char *s;
  x = 0;
  f = *a;
  if ((sign = (f < 0 ? -1 : 1)) == -1)
    (void)1;
  *a = f;
  while ((int)*a < -9 || (int)*a > 9 || ((int)*a == 0 && *a)) {
    if ((sign == 1 ? (*a > 1) : (*a < -1)))
      *a = f / ft_power(10, ++x);
    else
      *a = f / ft_power(10, --x);
  }
  s = ft_itoa(x);
  if (((x >= 0 && x <= 9) || (x <= -1 && x >= -9) ? 1 : 0) && s[0] == '-')
    s = ft_strinsert(s, "0", 1);
  else if (((x >= 0 && x <= 9) || (x <= -1 && x >= -9) ? 1 : 0))
    s = ft_strjoinnchar(s, 1, '0');
  return (s);
}


x86 assembly (clang, -O0):
<ft_get_expo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
xor    %eax,%eax
mov    %rdi,-0x8(%rbp)
fldz
fld    %st(0)
fstpt  -0x30(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
movzbl %al,%ecx
mov    %ecx,%eax
lea    -0x1(%rax,%rax,1),%eax
mov    %eax,-0x34(%rbp)
cmp    $0xffffffff,%eax
jne    1187 <ft_get_expo+0x47>
jmp    1187 <ft_get_expo+0x47>
fldt   -0x20(%rbp)
mov    -0x8(%rbp),%rax
fstpt  (%rax)
mov    -0x8(%rbp),%rax
fldt   (%rax)
fnstcw -0x4e(%rbp)
movzwl -0x4e(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x50(%rbp)
fldcw  -0x50(%rbp)
fistpl -0x44(%rbp)
fldcw  -0x4e(%rbp)
mov    -0x44(%rbp),%ecx
mov    $0x1,%al
cmp    $0xfffffff7,%ecx
mov    %al,-0x59(%rbp)
jl     123d <ft_get_expo+0xfd>
mov    -0x8(%rbp),%rax
fldt   (%rax)
fnstcw -0x52(%rbp)
movzwl -0x52(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x54(%rbp)
fldcw  -0x54(%rbp)
fistpl -0x48(%rbp)
fldcw  -0x52(%rbp)
mov    -0x48(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x59(%rbp)
jg     123d <ft_get_expo+0xfd>
mov    -0x8(%rbp),%rax
fldt   (%rax)
fnstcw -0x56(%rbp)
movzwl -0x56(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x58(%rbp)
fldcw  -0x58(%rbp)
fistpl -0x4c(%rbp)
fldcw  -0x56(%rbp)
mov    -0x4c(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5a(%rbp)
jne    1237 <ft_get_expo+0xf7>
mov    -0x8(%rbp),%rax
fldt   (%rax)
fldz
fucomip %st(1),%st
fstp   %st(0)
setp   %cl
setne  %al
or     %cl,%al
mov    %al,-0x5a(%rbp)
mov    -0x5a(%rbp),%al
mov    %al,-0x59(%rbp)
mov    -0x59(%rbp),%al
test   $0x1,%al
jne    124d <ft_get_expo+0x10d>
jmp    12ed <ft_get_expo+0x1ad>
cmpl   $0x1,-0x34(%rbp)
jne    1270 <ft_get_expo+0x130>
mov    -0x8(%rbp),%rax
fldt   (%rax)
fld1
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
ja     1289 <ft_get_expo+0x149>
jmp    12ba <ft_get_expo+0x17a>
mov    -0x8(%rbp),%rax
fldt   (%rax)
fld1
fchs
fucomip %st(1),%st
fstp   %st(0)
jbe    12ba <ft_get_expo+0x17a>
jmp    1289 <ft_get_expo+0x149>
fldt   -0x20(%rbp)
fstpt  -0x64(%rbp)
fldt   -0x30(%rbp)
fld1
faddp  %st,%st(1)
fld    %st(0)
fstpt  -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0xa,%edi
call   1060 <ft_power@plt>
fldt   -0x64(%rbp)
fdivp  %st,%st(1)
mov    -0x8(%rbp),%rax
fstpt  (%rax)
jmp    12e8 <ft_get_expo+0x1a8>
fldt   -0x20(%rbp)
fstpt  -0x70(%rbp)
fldt   -0x30(%rbp)
fld1
fchs
faddp  %st,%st(1)
fld    %st(0)
fstpt  -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
mov    $0xa,%edi
call   1060 <ft_power@plt>
fldt   -0x70(%rbp)
fdivp  %st,%st(1)
mov    -0x8(%rbp),%rax
fstpt  (%rax)
jmp    1190 <ft_get_expo+0x50>
fldt   -0x30(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1040 <ft_itoa@plt>
mov    %rax,-0x40(%rbp)
fldt   -0x30(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     132c <ft_get_expo+0x1ec>
jmp    1314 <ft_get_expo+0x1d4>
fldt   -0x30(%rbp)
flds   0xce3(%rip)
fucomip %st(1),%st
fstp   %st(0)
jae    135c <ft_get_expo+0x21c>
jmp    132c <ft_get_expo+0x1ec>
fldt   -0x30(%rbp)
fld1
fchs
fucomip %st(1),%st
fstp   %st(0)
jb     136b <ft_get_expo+0x22b>
jmp    1342 <ft_get_expo+0x202>
fldt   -0x30(%rbp)
flds   0xcb9(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     136b <ft_get_expo+0x22b>
jmp    135c <ft_get_expo+0x21c>
mov    $0x1,%al
test   $0x1,%al
jne    137a <ft_get_expo+0x23a>
jmp    13a8 <ft_get_expo+0x268>
xor    %eax,%eax
test   $0x1,%al
jne    137a <ft_get_expo+0x23a>
jmp    13a8 <ft_get_expo+0x268>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    13a8 <ft_get_expo+0x268>
mov    -0x40(%rbp),%rdi
lea    0xc73(%rip),%rsi
mov    $0x1,%edx
call   1030 <ft_strinsert@plt>
mov    %rax,-0x40(%rbp)
jmp    1440 <ft_get_expo+0x300>
fldt   -0x30(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     13d6 <ft_get_expo+0x296>
jmp    13be <ft_get_expo+0x27e>
fldt   -0x30(%rbp)
flds   0xc39(%rip)
fucomip %st(1),%st
fstp   %st(0)
jae    1406 <ft_get_expo+0x2c6>
jmp    13d6 <ft_get_expo+0x296>
fldt   -0x30(%rbp)
fld1
fchs
fucomip %st(1),%st
fstp   %st(0)
jb     1415 <ft_get_expo+0x2d5>
jmp    13ec <ft_get_expo+0x2ac>
fldt   -0x30(%rbp)
flds   0xc0f(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jb     1415 <ft_get_expo+0x2d5>
jmp    1406 <ft_get_expo+0x2c6>
mov    $0x1,%al
test   $0x1,%al
jne    1424 <ft_get_expo+0x2e4>
jmp    143b <ft_get_expo+0x2fb>
xor    %eax,%eax
test   $0x1,%al
jne    1424 <ft_get_expo+0x2e4>
jmp    143b <ft_get_expo+0x2fb>
mov    -0x40(%rbp),%rdi
mov    $0x1,%esi
mov    $0x30,%edx
call   1050 <ft_strjoinnchar@plt>
mov    %rax,-0x40(%rbp)
jmp    1440 <ft_get_expo+0x300>
mov    -0x40(%rbp),%rax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_get_expo>:
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rbx
fldt   (%rdi)
fldz
fstpt  0x14(%rsp)
fld    %st(0)
fld    %st(1)
fstpt  0x24(%rsp)
jmp    118b <ft_get_expo+0x4b>
nopw   0x0(%rax,%rax,1)
fstp   %st(0)
fld1
fchs
fldt   0x14(%rsp)
faddp  %st,%st(1)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
mov    $0xa,%edi
call   1060 <ft_power@plt>
fldt   0x24(%rsp)
fdiv   %st,%st(1)
fld    %st(1)
fstpt  (%rbx)
fxch   %st(1)
fnstcw 0x10(%rsp)
movzwl 0x10(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0x12(%rsp)
fldcw  0x12(%rsp)
fistl  0x20(%rsp)
fldcw  0x10(%rsp)
mov    0x20(%rsp),%eax
lea    -0xa(%rax),%ecx
cmp    $0xffffffed,%ecx
jb     11c6 <ft_get_expo+0x86>
fldz
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jne    11c2 <ft_get_expo+0x82>
jnp    11f5 <ft_get_expo+0xb5>
test   %eax,%eax
jne    11f5 <ft_get_expo+0xb5>
fldz
fucomip %st(2),%st
fstp   %st(1)
ja     11e0 <ft_get_expo+0xa0>
fld1
fxch   %st(1)
fucomip %st(1),%st
jbe    1160 <ft_get_expo+0x20>
jmp    1166 <ft_get_expo+0x26>
nopl   0x0(%rax,%rax,1)
fld1
fld    %st(0)
fchs
fucomip %st(2),%st
fstp   %st(1)
jbe    1160 <ft_get_expo+0x20>
jmp    1166 <ft_get_expo+0x26>
fstp   %st(0)
fstp   %st(0)
fldt   0x14(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1040 <ft_itoa@plt>
fldt   0x14(%rsp)
fldz
fxch   %st(1)
fucomi %st(1),%st
fstp   %st(1)
jb     1223 <ft_get_expo+0xe3>
flds   0xde1(%rip)
fucomip %st(1),%st
jae    123b <ft_get_expo+0xfb>
fld1
fchs
fucomip %st(1),%st
jb     1272 <ft_get_expo+0x132>
flds   0xdd3(%rip)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
fldz
jb     1272 <ft_get_expo+0x132>
fstp   %st(0)
cmpb   $0x2d,(%rax)
jne    125b <ft_get_expo+0x11b>
lea    0xdbf(%rip),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
add    $0x30,%rsp
pop    %rbx
jmp    1030 <ft_strinsert@plt>
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x30,%edx
add    $0x30,%rsp
pop    %rbx
jmp    1050 <ft_strjoinnchar@plt>
fstp   %st(0)
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"0\00"
define i8* @ft_get_expo(x86_fp80* %0) {
%2 = alloca x86_fp80*
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca i32
%6 = alloca i8*
store x86_fp80* %0, x86_fp80** %2
store x86_fp80 0xK00000000000000000000, x86_fp80* %4
%7 = load x86_fp80*, x86_fp80** %2
%8 = load x86_fp80, x86_fp80* %7
store x86_fp80 %8, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %3
%10 = fcmp olt x86_fp80 %9, 0xK00000000000000000000
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 -1, i32 1
store i32 %12, i32* %5
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %1
%16 = load x86_fp80, x86_fp80* %3
%17 = load x86_fp80*, x86_fp80** %2
store x86_fp80 %16, x86_fp80* %17
br label %18
18: ; preds = %66, %15
%19 = load x86_fp80*, x86_fp80** %2
%20 = load x86_fp80, x86_fp80* %19
%21 = fptosi x86_fp80 %20 to i32
%22 = icmp slt i32 %21, -9
br i1 %22, label %39, label %23
23: ; preds = %18
%24 = load x86_fp80*, x86_fp80** %2
%25 = load x86_fp80, x86_fp80* %24
%26 = fptosi x86_fp80 %25 to i32
%27 = icmp sgt i32 %26, 9
br i1 %27, label %39, label %28
28: ; preds = %23
%29 = load x86_fp80*, x86_fp80** %2
%30 = load x86_fp80, x86_fp80* %29
%31 = fptosi x86_fp80 %30 to i32
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %37
33: ; preds = %28
%34 = load x86_fp80*, x86_fp80** %2
%35 = load x86_fp80, x86_fp80* %34
%36 = fcmp une x86_fp80 %35, 0xK00000000000000000000
br label %37
37: ; preds = %33, %28
%38 = phi i1 [ false, %28 ], [ %36, %33 ]
br label %39
39: ; preds = %37, %23, %18
%40 = phi i1 [ true, %23 ], [ true, %18 ], [ %38, %37 ]
br i1 %40, label %41, label %67
41: ; preds = %39
%42 = load i32, i32* %5
%43 = icmp eq i32 %42, 1
br i1 %43, label %44, label %48
44: ; preds = %41
%45 = load x86_fp80*, x86_fp80** %2
%46 = load x86_fp80, x86_fp80* %45
%47 = fcmp ogt x86_fp80 %46, 0xK3FFF8000000000000000
br i1 %47, label %52, label %59
48: ; preds = %41
%49 = load x86_fp80*, x86_fp80** %2
%50 = load x86_fp80, x86_fp80* %49
%51 = fcmp olt x86_fp80 %50, 0xKBFFF8000000000000000
br i1 %51, label %52, label %59
52: ; preds = %48, %44
%53 = load x86_fp80, x86_fp80* %3
%54 = load x86_fp80, x86_fp80* %4
%55 = fadd x86_fp80 %54, 0xK3FFF8000000000000000
store x86_fp80 %55, x86_fp80* %4
%56 = call x86_fp80 @ft_power(i32 10, x86_fp80 %55)
%57 = fdiv x86_fp80 %53, %56
%58 = load x86_fp80*, x86_fp80** %2
store x86_fp80 %57, x86_fp80* %58
br label %66
59: ; preds = %48, %44
%60 = load x86_fp80, x86_fp80* %3
%61 = load x86_fp80, x86_fp80* %4
%62 = fadd x86_fp80 %61, 0xKBFFF8000000000000000
store x86_fp80 %62, x86_fp80* %4
%63 = call x86_fp80 @ft_power(i32 10, x86_fp80 %62)
%64 = fdiv x86_fp80 %60, %63
%65 = load x86_fp80*, x86_fp80** %2
store x86_fp80 %64, x86_fp80* %65
br label %66
66: ; preds = %59, %52
br label %18
67: ; preds = %39
%68 = load x86_fp80, x86_fp80* %4
%69 = call i8* @ft_itoa(x86_fp80 %68)
store i8* %69, i8** %6
%70 = load x86_fp80, x86_fp80* %4
%71 = fcmp oge x86_fp80 %70, 0xK00000000000000000000
br i1 %71, label %72, label %75
72: ; preds = %67
%73 = load x86_fp80, x86_fp80* %4
%74 = fcmp ole x86_fp80 %73, 0xK40029000000000000000
br i1 %74, label %81, label %75
75: ; preds = %72, %67
%76 = load x86_fp80, x86_fp80* %4
%77 = fcmp ole x86_fp80 %76, 0xKBFFF8000000000000000
br i1 %77, label %78, label %82
78: ; preds = %75
%79 = load x86_fp80, x86_fp80* %4
%80 = fcmp oge x86_fp80 %79, 0xKC0029000000000000000
br i1 %80, label %81, label %82
81: ; preds = %78, %72
br i1 true, label %83, label %92
82: ; preds = %78, %75
br i1 false, label %83, label %92
83: ; preds = %82, %81
%84 = load i8*, i8** %6
%85 = getelementptr inbounds i8, i8* %84, i64 0
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 45
br i1 %88, label %89, label %92
89: ; preds = %83
%90 = load i8*, i8** %6
%91 = call i8* @ft_strinsert(i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
store i8* %91, i8** %6
br label %110
92: ; preds = %83, %82, %81
%93 = load x86_fp80, x86_fp80* %4
%94 = fcmp oge x86_fp80 %93, 0xK00000000000000000000
br i1 %94, label %95, label %98
95: ; preds = %92
%96 = load x86_fp80, x86_fp80* %4
%97 = fcmp ole x86_fp80 %96, 0xK40029000000000000000
br i1 %97, label %104, label %98
98: ; preds = %95, %92
%99 = load x86_fp80, x86_fp80* %4
%100 = fcmp ole x86_fp80 %99, 0xKBFFF8000000000000000
br i1 %100, label %101, label %105
101: ; preds = %98
%102 = load x86_fp80, x86_fp80* %4
%103 = fcmp oge x86_fp80 %102, 0xKC0029000000000000000
br i1 %103, label %104, label %105
104: ; preds = %101, %95
br i1 true, label %106, label %109
105: ; preds = %101, %98
br i1 false, label %106, label %109
106: ; preds = %105, %104
%107 = load i8*, i8** %6
%108 = call i8* @ft_strjoinnchar(i8* %107, i32 1, i32 48)
store i8* %108, i8** %6
br label %109
109: ; preds = %106, %105, %104
br label %110
110: ; preds = %109, %89
%111 = load i8*, i8** %6
ret i8* %111
}

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
define i8* @ft_get_expo(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = fcmp uge x86_fp80 %2, 0xK00000000000000000000
br label %4
4: ; preds = %20, %1
%5 = phi x86_fp80 [ %24, %20 ], [ %2, %1 ]
%6 = phi x86_fp80 [ %22, %20 ], [ 0xK00000000000000000000, %1 ]
%7 = fptosi x86_fp80 %5 to i32
%8 = add i32 %7, -10
%9 = icmp ult i32 %8, -19
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = icmp eq i32 %7, 0
%12 = fcmp une x86_fp80 %5, 0xK00000000000000000000
%13 = and i1 %12, %11
br i1 %13, label %14, label %25
14: ; preds = %10, %4
br i1 %3, label %15, label %17
15: ; preds = %14
%16 = fcmp ogt x86_fp80 %5, 0xK3FFF8000000000000000
br i1 %16, label %20, label %19
17: ; preds = %14
%18 = fcmp olt x86_fp80 %5, 0xKBFFF8000000000000000
br i1 %18, label %20, label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %15, %17, %19
%21 = phi x86_fp80 [ 0xKBFFF8000000000000000, %19 ], [ 0xK3FFF8000000000000000, %17 ], [ 0xK3FFF8000000000000000, %15 ]
%22 = fadd x86_fp80 %6, %21
%23 = tail call x86_fp80 @ft_power(i32 10, x86_fp80 %22)
%24 = fdiv x86_fp80 %2, %23
store x86_fp80 %24, x86_fp80* %0
br label %4
25: ; preds = %10
%26 = tail call i8* @ft_itoa(x86_fp80 %6)
%27 = fcmp oge x86_fp80 %6, 0xK00000000000000000000
%28 = fcmp ole x86_fp80 %6, 0xK40029000000000000000
%29 = and i1 %27, %28
br i1 %29, label %34, label %30
30: ; preds = %25
%31 = fcmp ole x86_fp80 %6, 0xKBFFF8000000000000000
%32 = fcmp oge x86_fp80 %6, 0xKC0029000000000000000
%33 = and i1 %31, %32
br i1 %33, label %37, label %44
34: ; preds = %25
%35 = load i8, i8* %26
%36 = icmp eq i8 %35, 45
br i1 %36, label %40, label %42
37: ; preds = %30
%38 = load i8, i8* %26
%39 = icmp eq i8 %38, 45
br i1 %39, label %40, label %42
40: ; preds = %37, %34
%41 = tail call i8* @ft_strinsert(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
br label %44
42: ; preds = %37, %34
%43 = tail call i8* @ft_strjoinnchar(i8* %26, i32 1, i32 48)
br label %44
44: ; preds = %30, %42, %40
%45 = phi i8* [ %41, %40 ], [ %43, %42 ], [ %26, %30 ]
ret i8* %45
}