#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 EXIT_FAILURE;
int atoi(char *);
int /*<<< orphan*/ send_request(int, char *);
int main(int argc, char *argv[]) {
  int ret = EXIT_FAILURE;
  int port;
  if (argc < 2) {
    goto out;
  }
  port = atoi(argv[1]);
  send_request(port, "/date");
  send_request(port, "/status");
  send_request(port, "/status?field_a=1");
  send_request(port, "/question");
  send_request(port, "/response?happy=1&hungry=0");
  send_request(port, "/response");
  send_request(port, "/response?happy=1&hungry=1");
  send_request(port, "/response?happy=1&hungry=1&happy=0");
  send_request(port, "/notfound");
  send_request(port, "/quit");
  ret = 0;
out:
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1151 <main+0x31>
jmp    11fe <main+0xde>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    0xe95(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe8c(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe85(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe88(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe83(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe8f(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe8a(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xe96(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xeaa(%rip),%rsi
call   1030 <send_request@plt>
mov    -0x18(%rbp),%edi
lea    0xea5(%rip),%rsi
call   1030 <send_request@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jge    1131 <main+0x11>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebx
lea    0xebd(%rip),%rsi
mov    %eax,%edi
call   1030 <send_request@plt>
lea    0xeb5(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xeaf(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xeb3(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xeaf(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xebc(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xec5(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xeda(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
lea    0xed6(%rip),%rsi
mov    %ebx,%edi
call   1030 <send_request@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [6 x i8] c"/date\00"
@.str.1 = [8 x i8] c"/status\00"
@.str.2 = [18 x i8] c"/status?field_a=1\00"
@.str.3 = [10 x i8] c"/question\00"
@.str.4 = [27 x i8] c"/response?happy=1&hungry=0\00"
@.str.5 = [10 x i8] c"/response\00"
@.str.6 = [27 x i8] c"/response?happy=1&hungry=1\00"
@.str.7 = [35 x i8] c"/response?happy=1&hungry=1&happy=0\00"
@.str.8 = [10 x i8] c"/notfound\00"
@.str.9 = [6 x i8] c"/quit\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* @EXIT_FAILURE
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %2
br label %37
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @send_request(i32 %17, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* %7
%20 = call i32 @send_request(i32 %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %7
%22 = call i32 @send_request(i32 %21, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%23 = load i32, i32* %7
%24 = call i32 @send_request(i32 %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%25 = load i32, i32* %7
%26 = call i32 @send_request(i32 %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%27 = load i32, i32* %7
%28 = call i32 @send_request(i32 %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%29 = load i32, i32* %7
%30 = call i32 @send_request(i32 %29, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%31 = load i32, i32* %7
%32 = call i32 @send_request(i32 %31, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%33 = load i32, i32* %7
%34 = call i32 @send_request(i32 %33, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%35 = load i32, i32* %7
%36 = call i32 @send_request(i32 %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %6
br label %37
37: ; preds = %12, %11
%38 = load i32, i32* %6
ret i32 %38
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [6 x i8] c"/date\00"
@.str.1 = [8 x i8] c"/status\00"
@.str.2 = [18 x i8] c"/status?field_a=1\00"
@.str.3 = [10 x i8] c"/question\00"
@.str.4 = [27 x i8] c"/response?happy=1&hungry=0\00"
@.str.5 = [10 x i8] c"/response\00"
@.str.6 = [27 x i8] c"/response?happy=1&hungry=1\00"
@.str.7 = [35 x i8] c"/response?happy=1&hungry=1&happy=0\00"
@.str.8 = [10 x i8] c"/notfound\00"
@.str.9 = [6 x i8] c"/quit\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @EXIT_FAILURE
%4 = icmp slt i32 %0, 2
br i1 %4, label %19, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%12 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%13 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%14 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%16 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%17 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%18 = tail call i32 @send_request(i32 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %19
19: ; preds = %2, %5
%20 = phi i32 [ %3, %2 ], [ 0, %5 ]
ret i32 %20
}