#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 create_server_socket(char *, int);
int create_server_socket_(char *s, int *port) {
  char host[255];
  int i = 0;
  while (*s != ' ' && i < 255) {
    host[i] = *s;
    s++;
    i++;
  };
  host[i] = 0;
  return create_server_socket(host, *port);
}


x86 assembly (clang, -O0):
<create_server_socket_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x114(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x115(%rbp)
je     1158 <create_server_socket_+0x48>
cmpl   $0xff,-0x114(%rbp)
setl   %al
mov    %al,-0x115(%rbp)
mov    -0x115(%rbp),%al
test   $0x1,%al
jne    116b <create_server_socket_+0x5b>
jmp    119f <create_server_socket_+0x8f>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
movslq -0x114(%rbp),%rax
mov    %cl,-0x110(%rbp,%rax,1)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x114(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x114(%rbp)
jmp    112d <create_server_socket_+0x1d>
movslq -0x114(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <create_server_socket@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_server_socket_>:
sub    $0x108,%rsp
mov    (%rdi),%al
cmp    $0x20,%al
jne    1121 <create_server_socket_+0x11>
xor    %ecx,%ecx
jmp    114c <create_server_socket_+0x3c>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %al,(%rsp,%rdx,1)
lea    0x1(%rdx),%rcx
movzbl 0x1(%rdi,%rdx,1),%eax
cmp    $0x20,%al
je     114c <create_server_socket_+0x3c>
cmp    $0xfe,%rdx
mov    %rcx,%rdx
jb     1130 <create_server_socket_+0x20>
movb   $0x0,(%rsp,%rcx,1)
mov    (%rsi),%esi
mov    %rsp,%rdi
call   1030 <create_server_socket@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @create_server_socket_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [255 x i8]
%6 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %6
br label %7
7: ; preds = %17, %2
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 32
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 255
br label %15
15: ; preds = %12, %7
%16 = phi i1 [ false, %7 ], [ %14, %12 ]
br i1 %16, label %17, label %27
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 %21
store i8 %19, i8* %22
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
br label %7
27: ; preds = %15
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 %29
store i8 0, i8* %30
%31 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%32 = load i32*, i32** %4
%33 = load i32, i32* %32
%34 = call i32 @create_server_socket(i8* %31, i32 %33)
ret i32 %34
}

LLVM IR (-O2):
define i32 @create_server_socket_(i8* nocapture %0, i32* nocapture %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 32
br i1 %6, label %18, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %13, %7 ], [ 0, %2 ]
%9 = phi i8 [ %14, %7 ], [ %5, %2 ]
%10 = phi i8* [ %12, %7 ], [ %0, %2 ]
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %8
store i8 %9, i8* %11
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = add nuw nsw i64 %8, 1
%14 = load i8, i8* %12
%15 = icmp ne i8 %14, 32
%16 = icmp ult i64 %8, 254
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %7, label %18
18: ; preds = %7, %2
%19 = phi i64 [ 0, %2 ], [ %13, %7 ]
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %19
store i8 0, i8* %20
%21 = load i32, i32* %1
%22 = call i32 @create_server_socket(i8* %4, i32 %21)
ret i32 %22
}