#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 */
float multiplier_affix(char const *);
scalar_t__ parse_float(float *, char const *);
long long strtoll(char const *, int /*<<< orphan*/, int);
long long nepim_unit_ll(const char *str) {
  float f;
  if (parse_float(&f, str))
    return strtoll(str, 0, 10) * (long long)multiplier_affix(str);
  return f * multiplier_affix(str);
}


x86 assembly (clang, -O0):
<nepim_unit_ll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1050 <parse_float@plt>
cmp    $0x0,%rax
je     1186 <nepim_unit_ll+0x56>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <multiplier_affix@plt>
mov    -0x20(%rbp),%rax
cvttss2si %xmm0,%rcx
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    11ae <nepim_unit_ll+0x7e>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <multiplier_affix@plt>
movaps %xmm0,%xmm1
movss  -0x24(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nepim_unit_ll>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%rdi
mov    %rbx,%rsi
call   1050 <parse_float@plt>
test   %rax,%rax
je     116e <nepim_unit_ll+0x3e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <multiplier_affix@plt>
cvttss2si %xmm0,%rax
imul   %r14,%rax
jmp    118b <nepim_unit_ll+0x5b>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
mov    %rbx,%rdi
call   1040 <multiplier_affix@plt>
mulss  (%rsp),%xmm0
cvttss2si %xmm0,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @nepim_unit_ll(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @parse_float(float* %4, i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strtoll(i8* %9, i32 0, i32 10)
%11 = load i8*, i8** %3
%12 = call float @multiplier_affix(i8* %11)
%13 = fptosi float %12 to i64
%14 = mul nsw i64 %10, %13
store i64 %14, i64* %2
br label %21
15: ; preds = %1
%16 = load float, float* %4
%17 = load i8*, i8** %3
%18 = call float @multiplier_affix(i8* %17)
%19 = fmul float %16, %18
%20 = fptosi float %19 to i64
store i64 %20, i64* %2
br label %21
21: ; preds = %15, %8
%22 = load i64, i64* %2
ret i64 %22
}

LLVM IR (-O2):
define i64 @nepim_unit_ll(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i64 @parse_float(float* %2, i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = call i64 @strtoll(i8* %0, i32 0, i32 10)
%8 = call float @multiplier_affix(i8* %0)
%9 = fptosi float %8 to i64
%10 = mul nsw i64 %7, %9
br label %16
11: ; preds = %1
%12 = load float, float* %2
%13 = call float @multiplier_affix(i8* %0)
%14 = fmul float %12, %13
%15 = fptosi float %14 to i64
br label %16
16: ; preds = %11, %6
%17 = phi i64 [ %10, %6 ], [ %15, %11 ]
ret i64 %17
}