#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 getCart__SHIPPING(char *, float *);
scalar_t__ getCookie(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("Content-Type: text/plain;charset=us-ascii\n\n");
  char cookie[128];
  float result = 0;
  memset(cookie, 0, 128);
  if (getCookie(cookie)) {
    printf("-\n");
    goto end;
  }
  int ret;
  ret = getCart__SHIPPING(cookie, &result);
  if (result < 0) {
    printf("-\n");
    goto end;
  } else
    printf("%.2f", result);
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x94(%rbp)
ff
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
call   1050 <getCookie@plt>
cmp    $0x0,%rax
je     11ae <main+0x6e>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1209 <main+0xc9>
lea    -0x90(%rbp),%rdi
lea    -0x94(%rbp),%rsi
call   1060 <getCart__SHIPPING@plt>
mov    %eax,-0x98(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x94(%rbp),%xmm0
jbe    11ea <main+0xaa>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1209 <main+0xc9>
movss  -0x94(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xe32(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1209 <main+0xc9>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    %rbx,%rdi
call   1060 <getCookie@plt>
test   %rax,%rax
jne    11aa <main+0x5a>
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1070 <getCart__SHIPPING@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    11b8 <main+0x68>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
jmp    11ca <main+0x7a>
cvtss2sd %xmm0,%xmm0
lea    0xe3d(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\0A\00"
@.str.1 = [3 x i8] c"-\0A\00"
@.str.2 = [5 x i8] c"%.2f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
store float 0.000000e+00, float* %7
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%11 = call i32 @memset(i8* %10, i32 0, i32 128)
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%13 = call i64 @getCookie(i8* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %29
17: ; preds = %2
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%19 = call i32 @getCart__SHIPPING(i8* %18, float* %7)
store i32 %19, i32* %8
%20 = load float, float* %7
%21 = fcmp olt float %20, 0.000000e+00
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %29
24: ; preds = %17
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %26)
br label %28
28: ; preds = %24
br label %29
29: ; preds = %28, %22, %15
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [5 x i8] c"%.2f\00"
@str = [43 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\00"
@str.4 = [2 x i8] c"-\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = alloca float
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%7 = bitcast float* %4 to i8*
store float 0.000000e+00, float* %4
%8 = call i32 @memset(i8* %6, i32 0, i32 128)
%9 = call i64 @getCookie(i8* %6)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
br label %22
13: ; preds = %2
%14 = call i32 @getCart__SHIPPING(i8* %6, float* %4)
%15 = load float, float* %4
%16 = fcmp olt float %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.4, i64 0, i64 0))
br label %22
19: ; preds = %13
%20 = fpext float %15 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), double %20)
br label %22
22: ; preds = %19, %17, %11
ret i32 0
}