#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 */
typedef int /*<<< orphan*/ CLIENT;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ *clnt_create(char *, int, int, char *);
int /*<<< orphan*/ clnt_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main(int argn, char *argc[]) {
  int test_status = 1;
  int progNum = atoi(argc[2]);
  char *proto = "tcp";
  CLIENT *clnt = NULL;
  clnt = clnt_create(argc[1], progNum, 1, proto);
  clnt_destroy(clnt);
  test_status = 0;
  printf("%d\n", test_status);
  return test_status;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
lea    0xe8c(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%esi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1040 <clnt_create@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <clnt_destroy@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1060 <atoi@plt>
mov    0x8(%rbx),%rdi
lea    0xea8(%rip),%rcx
mov    %eax,%esi
mov    $0x1,%edx
call   1040 <clnt_create@plt>
mov    %rax,%rdi
call   1050 <clnt_destroy@plt>
lea    0xe91(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 2
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %8
store i32* null, i32** %9
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i32, i32* %7
%18 = load i8*, i8** %8
%19 = call i32* @clnt_create(i8* %16, i32 %17, i32 1, i8* %18)
store i32* %19, i32** %9
%20 = load i32*, i32** %9
%21 = call i32 @clnt_destroy(i32* %20)
store i32 0, i32* %6
%22 = load i32, i32* %6
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32* @clnt_create(i8* %7, i32 %5, i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @clnt_destroy(i32* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}