#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 */
int ft_pb(int, int);
int ft_sci(double *i, double *f, int power, int fl[8]) {
  if ((int)(*i) == 0) {
    power -= 1;
    *i = (int)(*f / ft_pb((fl[1] - 1), 10));
    *f -= (int)(*f / ft_pb(fl[1] - 1, 10)) * ft_pb(fl[1] - 1, 10);
    *f *= 10.0;
  }
  return (power);
}


x86 assembly (clang, -O0):
<ft_sci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
cmp    $0x0,%eax
jne    11f8 <ft_sci+0xe8>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edi
sub    $0x1,%edi
mov    $0xa,%esi
call   1030 <ft_pb@plt>
movsd  -0x38(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edi
sub    $0x1,%edi
mov    $0xa,%esi
call   1030 <ft_pb@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edi
sub    $0x1,%edi
mov    $0xa,%esi
call   1030 <ft_pb@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xe10(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_sci>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r14d
cvttsd2si (%rdi),%eax
test   %eax,%eax
jne    11c7 <ft_sci+0xb7>
mov    %rcx,%rbp
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0xffffffff,%r14d
movsd  (%rsi),%xmm0
movaps %xmm0,(%rsp)
mov    0x4(%rcx),%edi
add    $0xffffffff,%edi
mov    $0xa,%esi
call   1030 <ft_pb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movapd (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttpd2dq %xmm1,%xmm0
cvtdq2pd %xmm0,%xmm0
movlps %xmm0,(%rbx)
movsd  (%r15),%xmm0
movsd  %xmm0,(%rsp)
mov    0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    $0xa,%esi
call   1030 <ft_pb@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%ebx
mov    0x4(%rbp),%edi
add    $0xffffffff,%edi
mov    $0xa,%esi
call   1030 <ft_pb@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%r15),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xe3e(%rip),%xmm1
movsd  %xmm1,(%r15)
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ft_sci(double* %0, double* %1, i32 %2, i32* %3) {
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32*
store double* %0, double** %5
store double* %1, double** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load double*, double** %5
%10 = load double, double* %9
%11 = fptosi double %10 to i32
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %51
13: ; preds = %4
%14 = load i32, i32* %7
%15 = sub nsw i32 %14, 1
store i32 %15, i32* %7
%16 = load double*, double** %6
%17 = load double, double* %16
%18 = load i32*, i32** %8
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = sub nsw i32 %20, 1
%22 = call i32 @ft_pb(i32 %21, i32 10)
%23 = sitofp i32 %22 to double
%24 = fdiv double %17, %23
%25 = fptosi double %24 to i32
%26 = sitofp i32 %25 to double
%27 = load double*, double** %5
store double %26, double* %27
%28 = load double*, double** %6
%29 = load double, double* %28
%30 = load i32*, i32** %8
%31 = getelementptr inbounds i32, i32* %30, i64 1
%32 = load i32, i32* %31
%33 = sub nsw i32 %32, 1
%34 = call i32 @ft_pb(i32 %33, i32 10)
%35 = sitofp i32 %34 to double
%36 = fdiv double %29, %35
%37 = fptosi double %36 to i32
%38 = load i32*, i32** %8
%39 = getelementptr inbounds i32, i32* %38, i64 1
%40 = load i32, i32* %39
%41 = sub nsw i32 %40, 1
%42 = call i32 @ft_pb(i32 %41, i32 10)
%43 = mul nsw i32 %37, %42
%44 = sitofp i32 %43 to double
%45 = load double*, double** %6
%46 = load double, double* %45
%47 = fsub double %46, %44
store double %47, double* %45
%48 = load double*, double** %6
%49 = load double, double* %48
%50 = fmul double %49, 1.000000e+01
store double %50, double* %48
br label %51
51: ; preds = %13, %4
%52 = load i32, i32* %7
ret i32 %52
}

LLVM IR (-O2):
define i32 @ft_sci(double* nocapture %0, double* nocapture %1, i32 %2, i32* nocapture %3) {
%5 = load double, double* %0
%6 = fptosi double %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %34
8: ; preds = %4
%9 = add nsw i32 %2, -1
%10 = load double, double* %1
%11 = getelementptr inbounds i32, i32* %3, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, -1
%14 = tail call i32 @ft_pb(i32 %13, i32 10)
%15 = sitofp i32 %14 to double
%16 = fdiv double %10, %15
%17 = fptosi double %16 to i32
%18 = sitofp i32 %17 to double
store double %18, double* %0
%19 = load double, double* %1
%20 = load i32, i32* %11
%21 = add nsw i32 %20, -1
%22 = tail call i32 @ft_pb(i32 %21, i32 10)
%23 = sitofp i32 %22 to double
%24 = fdiv double %19, %23
%25 = fptosi double %24 to i32
%26 = load i32, i32* %11
%27 = add nsw i32 %26, -1
%28 = tail call i32 @ft_pb(i32 %27, i32 10)
%29 = mul nsw i32 %28, %25
%30 = sitofp i32 %29 to double
%31 = load double, double* %1
%32 = fsub double %31, %30
%33 = fmul double %32, 1.000000e+01
store double %33, double* %1
br label %34
34: ; preds = %8, %4
%35 = phi i32 [ %9, %8 ], [ %2, %4 ]
ret i32 %35
}