#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  int /*<<< orphan*/ h_length;
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int atoi(char *);
int /*<<< orphan*/ bcopy(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ bzero(char *, int);
scalar_t__ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ *strstr(char *, char *);
int write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int sockfd, portno, n;
  struct sockaddr_in serv_addr;
  struct hostent *server;
  int started = 0;
  char buffer[256];
  if (argc < 3) {
    fprintf(stderr, "használat: %s hostname port\n", argv[0]);
    exit(0);
  }
  portno = atoi(argv[2]);
  sockfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sockfd < 0)
    error("Hiba a socket létrehozásában.");
  server = gethostbyname(argv[1]);
  if (server == NULL) {
    fprintf(stderr, "Hiba, nem található ilyen nevű host.\n");
    exit(0);
  }
  bzero((char *)&serv_addr, sizeof(serv_addr));
  serv_addr.sin_family = AF_INET;
  bcopy((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr,
        server->h_length);
  serv_addr.sin_port = htons(portno);
  if (connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error("Sikertelen csatlakozás.");
  while (1) {
    bzero(buffer, 256);
    n = read(sockfd, buffer, 255);
    if (n < 0)
      error("Sikertelen olvasás a socketről.");
    if (strcmp(buffer, "") == 0) {
      printf("A szerver lecsatlakazott. A játéknak vége!\n");
      exit(0);
    }
    printf("%s\n", buffer);
    if (strstr(buffer, "vége") != NULL) {
      exit(0);
    }
    if (strstr(buffer, "Start") != NULL) {
      started = 1;
    }
    if (started) {
      do {
        printf("Add meg, hogy melyik bábuval szeretnél lépni (0/1)! Vagy "
               "válaszd a feladási opciót a (feladom) üzenettel!\n");
        bzero(buffer, 256);
        fgets(buffer, 255, stdin);
      } while (strcmp(buffer, "feladom\n") != 0 && strcmp(buffer, "0\n") != 0 &&
               strcmp(buffer, "1\n") != 0);
      n = write(sockfd, buffer, strlen(buffer));
      if (n < 0)
        error("Sikertelen írás a socketre.");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    125f <main+0x4f>
mov    0x2d8f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdaf(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10f0 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    0x2d72(%rip),%rax
mov    (%rax),%edi
mov    0x2d49(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    12a1 <main+0x91>
lea    0xd82(%rip),%rdi
call   10d0 <error@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10a0 <gethostbyname@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12db <main+0xcb>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
lea    -0x28(%rbp),%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    0x2cf8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x28(%rbp),%rsi
add    $0x4,%rsi
mov    -0x30(%rbp),%rax
mov    (%rax),%edx
call   10c0 <bcopy@plt>
mov    -0x18(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x28(%rbp),%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
cmp    $0x0,%rax
jge    1342 <main+0x132>
lea    0xd2b(%rip),%rdi
call   10d0 <error@plt>
jmp    1347 <main+0x137>
lea    -0x140(%rbp),%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
mov    -0x14(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0xff,%edx
call   1070 <read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    1385 <main+0x175>
lea    0xd01(%rip),%rdi
call   10d0 <error@plt>
lea    -0x140(%rbp),%rdi
lea    0xd3e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13b7 <main+0x1a7>
lea    0xcfa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
lea    -0x140(%rbp),%rsi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x140(%rbp),%rdi
lea    0xcfc(%rip),%rsi
call   1120 <strstr@plt>
cmp    $0x0,%rax
je     13f0 <main+0x1e0>
xor    %edi,%edi
call   1100 <exit@plt>
lea    -0x140(%rbp),%rdi
lea    0xcde(%rip),%rsi
call   1120 <strstr@plt>
cmp    $0x0,%rax
je     1414 <main+0x204>
movl   $0x1,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     152f <main+0x31f>
jmp    1423 <main+0x213>
lea    0xcb8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x140(%rbp),%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
lea    -0x140(%rbp),%rdi
mov    0x2b90(%rip),%rax
mov    (%rax),%edx
mov    $0xff,%esi
call   1080 <fgets@plt>
lea    -0x140(%rbp),%rdi
lea    0xcea(%rip),%rsi
call   1090 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x141(%rbp)
je     14cc <main+0x2bc>
lea    -0x140(%rbp),%rdi
lea    0xccb(%rip),%rsi
call   1090 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x141(%rbp)
je     14cc <main+0x2bc>
lea    -0x140(%rbp),%rdi
lea    0xca6(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x141(%rbp)
mov    -0x141(%rbp),%al
test   $0x1,%al
jne    1423 <main+0x213>
mov    -0x14(%rbp),%eax
mov    %eax,-0x154(%rbp)
lea    -0x140(%rbp),%rax
mov    %rax,-0x150(%rbp)
lea    -0x140(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x154(%rbp),%edi
mov    -0x150(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    152a <main+0x31a>
lea    0xc3e(%rip),%rdi
call   10d0 <error@plt>
jmp    152f <main+0x31f>
jmp    1347 <main+0x137>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jle    12d8 <main+0xc8>
mov    0x10(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r14d
mov    0x2da8(%rip),%rbp
mov    0x0(%rbp),%edi
mov    0x2d7e(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1130 <socket@plt>
mov    %eax,0x8(%rsp)
test   %eax,%eax
jns    1267 <main+0x57>
lea    0xdbc(%rip),%rdi
call   10d0 <error@plt>
mov    0x8(%rbx),%rdi
call   10a0 <gethostbyname@plt>
test   %rax,%rax
je     12f9 <main+0xe9>
mov    %rax,%rbx
lea    0x10(%rsp),%r15
mov    %r15,%rdi
mov    $0xc,%esi
call   10e0 <bzero@plt>
mov    0x0(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    0x8(%rbx),%rsi
lea    0x14(%rsp),%rdi
mov    (%rbx),%edx
call   10c0 <memmove@plt>
mov    %r14d,%edi
call   1060 <htons@plt>
mov    %eax,0x10(%rsp)
mov    0x8(%rsp),%edi
mov    %r15,%rsi
mov    $0xc,%edx
call   1110 <connect@plt>
movl   $0x0,0xc(%rsp)
lea    0xd97(%rip),%rdi
test   %rax,%rax
jns    131c <main+0x10c>
jmp    1317 <main+0x107>
mov    0x2cf1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xd15(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
mov    0x2cd0(%rip),%rax
mov    (%rax),%edi
lea    0xd36(%rip),%rsi
xor    %eax,%eax
call   10b0 <fprintf@plt>
xor    %edi,%edi
call   1100 <exit@plt>
call   10d0 <error@plt>
lea    0x20(%rsp),%rbx
lea    0xdb4(%rip),%r15
mov    0x2cb1(%rip),%rbp
lea    0xd79(%rip),%r12
lea    0xd7b(%rip),%r13
lea    0xd77(%rip),%r14
jmp    136e <main+0x15e>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
test   %eax,%eax
js     1462 <main+0x252>
mov    %rbx,%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1070 <read@plt>
test   %eax,%eax
jns    139c <main+0x18c>
lea    0xcea(%rip),%rdi
call   10d0 <error@plt>
mov    %rbx,%rdi
lea    0xcc1(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     146e <main+0x25e>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
lea    0xcdd(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
jne    147a <main+0x26a>
mov    %rbx,%rdi
lea    0xccb(%rip),%rsi
call   1120 <strstr@plt>
test   %rax,%rax
mov    0xc(%rsp),%eax
mov    $0x1,%ecx
cmovne %ecx,%eax
mov    %eax,0xc(%rsp)
test   %eax,%eax
je     136e <main+0x15e>
xchg   %ax,%ax
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   10e0 <bzero@plt>
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1080 <fgets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1350 <main+0x140>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1350 <main+0x140>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    1400 <main+0x1f0>
jmp    1350 <main+0x140>
lea    0xc55(%rip),%rdi
jmp    1317 <main+0x107>
lea    0xcd8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"haszn\C3\A1lat: %s hostname port\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [33 x i8] c"Hiba a socket l\C3\A9trehoz\C3\A1s\C3\A1ban.\00"
@.str.2 = [41 x i8] c"Hiba, nem tal\C3\A1lhat\C3\B3 ilyen nev\C5\B1 host.\0A\00"
@.str.3 = [25 x i8] c"Sikertelen csatlakoz\C3\A1s.\00"
@.str.4 = [34 x i8] c"Sikertelen olvas\C3\A1s a socketr\C5\91l.\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.6 = [47 x i8] c"A szerver lecsatlakazott. A j\C3\A1t\C3\A9knak v\C3\A9ge!\0A\00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [6 x i8] c"v\C3\A9ge\00"
@.str.9 = [6 x i8] c"Start\00"
@.str.10 = [114 x i8] c"Add meg, hogy melyik b\C3\A1buval szeretn\C3\A9l l\C3\A9pni (0/1)! Vagy v\C3\A1laszd a felad\C3\A1si opci\C3\B3t a (feladom) \C3\BCzenettel!\0A\00"
@stdin = global i32 0
@.str.11 = [9 x i8] c"feladom\0A\00"
@.str.12 = [3 x i8] c"0\0A\00"
@.str.13 = [3 x i8] c"1\0A\00"
@.str.14 = [30 x i8] c"Sikertelen \C3\ADr\C3\A1s a socketre.\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 i32
%9 = alloca %struct.sockaddr_in
%10 = alloca %struct.hostent*
%11 = alloca i32
%12 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %11
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 0
%19 = load i8*, i8** %18
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
22: ; preds = %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 2
%25 = load i8*, i8** %24
%26 = call i32 @atoi(i8* %25)
store i32 %26, i32* %7
%27 = load i32, i32* @AF_INET
%28 = load i32, i32* @SOCK_STREAM
%29 = call i32 @socket(i32 %27, i32 %28, i32 0)
store i32 %29, i32* %6
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %22
%33 = call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %32, %22
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 1
%37 = load i8*, i8** %36
%38 = call %struct.hostent* @gethostbyname(i8* %37)
store %struct.hostent* %38, %struct.hostent** %10
%39 = load %struct.hostent*, %struct.hostent** %10
%40 = icmp eq %struct.hostent* %39, null
br i1 %40, label %41, label %45
41: ; preds = %34
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @exit(i32 0)
unreachable
45: ; preds = %34
%46 = bitcast %struct.sockaddr_in* %9 to i8*
%47 = call i32 @bzero(i8* %46, i32 12)
%48 = load i32, i32* @AF_INET
%49 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 2
store i32 %48, i32* %49
%50 = load %struct.hostent*, %struct.hostent** %10
%51 = getelementptr inbounds %struct.hostent, %struct.hostent* %50, i32 0, i32 1
%52 = load i64, i64* %51
%53 = inttoptr i64 %52 to i8*
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 1
%55 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %54, i32 0, i32 0
%56 = bitcast i32* %55 to i8*
%57 = load %struct.hostent*, %struct.hostent** %10
%58 = getelementptr inbounds %struct.hostent, %struct.hostent* %57, i32 0, i32 0
%59 = load i32, i32* %58
%60 = call i32 @bcopy(i8* %53, i8* %56, i32 %59)
%61 = load i32, i32* %7
%62 = call i32 @htons(i32 %61)
%63 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
store i32 %62, i32* %63
%64 = load i32, i32* %6
%65 = bitcast %struct.sockaddr_in* %9 to %struct.sockaddr*
%66 = call i64 @connect(i32 %64, %struct.sockaddr* %65, i32 12)
%67 = icmp slt i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %45
%69 = call i32 @error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %70
70: ; preds = %68, %45
br label %71
71: ; preds = %70, %137
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%73 = call i32 @bzero(i8* %72, i32 256)
%74 = load i32, i32* %6
%75 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%76 = call i32 @read(i32 %74, i8* %75, i32 255)
store i32 %76, i32* %8
%77 = load i32, i32* %8
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %71
%80 = call i32 @error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %81
81: ; preds = %79, %71
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%83 = call i64 @strcmp(i8* %82, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %81
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%87 = call i32 @exit(i32 0)
unreachable
88: ; preds = %81
%89 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %89)
%91 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%92 = call i32* @strstr(i8* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%93 = icmp ne i32* %92, null
br i1 %93, label %94, label %96
94: ; preds = %88
%95 = call i32 @exit(i32 0)
unreachable
96: ; preds = %88
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%98 = call i32* @strstr(i8* %97, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%99 = icmp ne i32* %98, null
br i1 %99, label %100, label %101
100: ; preds = %96
store i32 1, i32* %11
br label %101
101: ; preds = %100, %96
%102 = load i32, i32* %11
%103 = icmp ne i32 %102, 0
br i1 %103, label %104, label %137
104: ; preds = %101
br label %105
105: ; preds = %124, %104
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.10, i64 0, i64 0))
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%108 = call i32 @bzero(i8* %107, i32 256)
%109 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%110 = load i32, i32* @stdin
%111 = call i32 @fgets(i8* %109, i32 255, i32 %110)
br label %112
112: ; preds = %105
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%114 = call i64 @strcmp(i8* %113, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %124
116: ; preds = %112
%117 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%118 = call i64 @strcmp(i8* %117, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%119 = icmp ne i64 %118, 0
br i1 %119, label %120, label %124
120: ; preds = %116
%121 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%122 = call i64 @strcmp(i8* %121, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%123 = icmp ne i64 %122, 0
br label %124
124: ; preds = %120, %116, %112
%125 = phi i1 [ false, %116 ], [ false, %112 ], [ %123, %120 ]
br i1 %125, label %105, label %126
126: ; preds = %124
%127 = load i32, i32* %6
%128 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%129 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%130 = call i32 @strlen(i8* %129)
%131 = call i32 @write(i32 %127, i8* %128, i32 %130)
store i32 %131, i32* %8
%132 = load i32, i32* %8
%133 = icmp slt i32 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %126
%135 = call i32 @error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
br label %136
136: ; preds = %134, %126
br label %137
137: ; preds = %136, %101
br label %71
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.hostent = type { i32, i64 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [30 x i8] c"haszn\C3\A1lat: %s hostname port\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [33 x i8] c"Hiba a socket l\C3\A9trehoz\C3\A1s\C3\A1ban.\00"
@.str.2 = [41 x i8] c"Hiba, nem tal\C3\A1lhat\C3\B3 ilyen nev\C5\B1 host.\0A\00"
@.str.3 = [25 x i8] c"Sikertelen csatlakoz\C3\A1s.\00"
@.str.4 = [34 x i8] c"Sikertelen olvas\C3\A1s a socketr\C5\91l.\00"
@.str.5 = [1 x i8] zeroinitializer
@.str.8 = [6 x i8] c"v\C3\A9ge\00"
@.str.9 = [6 x i8] c"Start\00"
@stdin = global i32 0
@.str.11 = [9 x i8] c"feladom\0A\00"
@.str.12 = [3 x i8] c"0\0A\00"
@.str.13 = [3 x i8] c"1\0A\00"
@.str.14 = [30 x i8] c"Sikertelen \C3\ADr\C3\A1s a socketre.\00"
@str = [113 x i8] c"Add meg, hogy melyik b\C3\A1buval szeretn\C3\A9l l\C3\A9pni (0/1)! Vagy v\C3\A1laszd a felad\C3\A1si opci\C3\B3t a (feladom) \C3\BCzenettel!\00"
@str.15 = [46 x i8] c"A szerver lecsatlakazott. A j\C3\A1t\C3\A9knak v\C3\A9ge!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca [256 x i8]
%5 = bitcast %struct.sockaddr_in* %3 to i8*
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = icmp slt i32 %0, 3
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %1
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = getelementptr inbounds i8*, i8** %1, i64 2
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = load i32, i32* @AF_INET
%18 = load i32, i32* @SOCK_STREAM
%19 = tail call i32 @socket(i32 %17, i32 %18, i32 0)
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = tail call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %13
%24 = getelementptr inbounds i8*, i8** %1, i64 1
%25 = load i8*, i8** %24
%26 = tail call %struct.hostent* @gethostbyname(i8* %25)
%27 = icmp eq %struct.hostent* %26, null
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
%31 = tail call i32 @exit(i32 0)
unreachable
32: ; preds = %23
%33 = call i32 @bzero(i8* %5, i32 12)
%34 = load i32, i32* @AF_INET
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i32 %34, i32* %35
%36 = getelementptr inbounds %struct.hostent, %struct.hostent* %26, i64 0, i32 1
%37 = load i64, i64* %36
%38 = inttoptr i64 %37 to i8*
%39 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1, i32 0
%40 = bitcast i32* %39 to i8*
%41 = getelementptr inbounds %struct.hostent, %struct.hostent* %26, i64 0, i32 0
%42 = load i32, i32* %41
%43 = tail call i32 @htons(i32 %16)
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0
store i32 %43, i32* %44
%45 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%46 = call i64 @connect(i32 %19, %struct.sockaddr* %45, i32 12)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %91, %32
%49 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), %32 ], [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), %91 ]
%50 = phi i32 [ 0, %32 ], [ %76, %91 ]
%51 = call i32 @error(i8* %49)
br label %52
52: ; preds = %32, %48
%53 = phi i32 [ %50, %48 ], [ 0, %32 ]
br label %54
54: ; preds = %95, %52
%55 = phi i32 [ %53, %52 ], [ %76, %95 ]
%56 = call i32 @bzero(i8* %6, i32 256)
%57 = call i32 @read(i32 %19, i8* %6, i32 255)
%58 = icmp slt i32 %57, 0
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = call i32 @error(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %61
61: ; preds = %59, %54
%62 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.5, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.15, i64 0, i64 0))
%66 = call i32 @exit(i32 0)
unreachable
67: ; preds = %61
%68 = call i32 @puts(i8* %6)
%69 = call i32* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%70 = icmp eq i32* %69, null
br i1 %70, label %73, label %71
71: ; preds = %67
%72 = call i32 @exit(i32 0)
unreachable
73: ; preds = %67
%74 = call i32* @strstr(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%75 = icmp eq i32* %74, null
%76 = select i1 %75, i32 %55, i32 1
%77 = icmp eq i32 %76, 0
br i1 %77, label %95, label %78
78: ; preds = %73, %88
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @str, i64 0, i64 0))
%80 = call i32 @bzero(i8* %6, i32 256)
%81 = load i32, i32* @stdin
%82 = call i32 @fgets(i8* %6, i32 255, i32 %81)
%83 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%84 = icmp eq i64 %83, 0
br i1 %84, label %91, label %85
85: ; preds = %78
%86 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%87 = icmp eq i64 %86, 0
br i1 %87, label %91, label %88
88: ; preds = %85
%89 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
%90 = icmp eq i64 %89, 0
br i1 %90, label %91, label %78
91: ; preds = %78, %85, %88
%92 = call i32 @strlen(i8* %6)
%93 = call i32 @write(i32 %19, i8* %6, i32 %92)
%94 = icmp slt i32 %93, 0
br i1 %94, label %48, label %95
95: ; preds = %91, %73
br label %54
}