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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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     118e <main+0x4e>
jmp    11f8 <main+0xb8>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x98(%rbp)
ff
lea    -0x90(%rbp),%rdi
lea    -0x98(%rbp),%rsi
call   1060 <getCart__HT@plt>
mov    %eax,-0x94(%rbp)
movss  -0x98(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11e5 <main+0xa5>
movss  -0x98(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xe53(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11f3 <main+0xb3>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f8 <main+0xb8>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
call   1070 <getCookie@plt>
test   %rax,%rax
jne    11d8 <main+0x78>
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1080 <getCart__HT@plt>
movss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11ce <main+0x6e>
cvtss2sd %xmm0,%xmm0
lea    0xe3b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
jmp    11d8 <main+0x78>
mov    $0x30,%edi
call   1030 <putchar@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"%f\00"
@.str.2 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca i32
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i32 0, i32 128)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%9 = call i64 @getCookie(i8* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
br label %24
12: ; preds = %0
store float 0.000000e+00, float* %4
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%14 = call i32 @getCart__HT(i8* %13, float* %4)
store i32 %14, i32* %3
%15 = load float, float* %4
%16 = fcmp ogt float %15, 0.000000e+00
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = load float, float* %4
%19 = fpext float %18 to double
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), double %19)
br label %23
21: ; preds = %12
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %17
br label %24
24: ; preds = %23, %11
ret i32 0
}

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