#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 /*<<< orphan*/ curlGetValue(char *, char *);
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];
  memset(cookie, 0, 128);
  if (getCookie(cookie)) {
    printf("0\n");
    goto end;
  }
  char result[16];
  memset(result, 0, 16);
  curlGetValue("http://rest:9000/getVacation", result);
  result[0] == '1' ? printf("1") : printf("0");
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
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
lea    -0x90(%rbp),%rdi
call   1060 <getCookie@plt>
cmp    $0x0,%rax
je     119f <main+0x5f>
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
jmp    11f2 <main+0xb2>
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <memset@plt>
lea    -0xa0(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1030 <curlGetValue@plt>
movsbl -0xa0(%rbp),%eax
cmp    $0x31,%eax
jne    11e6 <main+0xa6>
lea    0xe70(%rip),%rdi
call   1040 <printf@plt>
jmp    11f2 <main+0xb2>
lea    0xe61(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
lea    0xebe(%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
je     1193 <main+0x43>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
jmp    11cb <main+0x7b>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1060 <memset@plt>
lea    0xe54(%rip),%rdi
mov    %rbx,%rsi
call   1050 <curlGetValue@plt>
cmpb   $0x31,(%rsp)
jne    11c1 <main+0x71>
mov    $0x31,%edi
jmp    11c6 <main+0x76>
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"0\0A\00"
@.str.2 = [29 x i8] c"http://rest:9000/getVacation\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [2 x i8] c"0\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [128 x i8]
%7 = alloca [16 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 0, i32 128)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%12 = call i64 @getCookie(i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %31
16: ; preds = %2
%17 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%18 = call i32 @memset(i8* %17, i32 0, i32 16)
%19 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%20 = call i32 @curlGetValue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 49
br i1 %24, label %25, label %27
25: ; preds = %16
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %29
27: ; preds = %16
%28 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
%30 = phi i32 [ %26, %25 ], [ %28, %27 ]
br label %31
31: ; preds = %29, %14
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [29 x i8] c"http://rest:9000/getVacation\00"
@str = [43 x i8] c"Content-Type: text/plain;charset=us-ascii\0A\00"
@str.5 = [2 x i8] c"0\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = alloca [16 x i8]
%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 = call i32 @memset(i8* %6, i32 0, i32 128)
%8 = call i64 @getCookie(i8* %6)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %2
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0))
br label %22
12: ; preds = %2
%13 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%14 = call i32 @memset(i8* %13, i32 0, i32 16)
%15 = call i32 @curlGetValue(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%16 = load i8, i8* %13
%17 = icmp eq i8 %16, 49
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i32 @putchar(i32 49)
br label %22
20: ; preds = %12
%21 = call i32 @putchar(i32 48)
br label %22
22: ; preds = %18, %20, %10
ret i32 0
}