#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 */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int INET_ADDRSTRLEN;
char *inet_ntop(int /*<<< orphan*/, struct in_addr *, char *, int);
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char *, struct in_addr *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  struct in_addr addr;
  char buf[INET_ADDRSTRLEN];
  inet_pton(AF_INET, "192.168.8.192", &addr);
  printf("192.168.8.192 = %s\n",
         inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN));
  return 0;
}


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)
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <inet_pton@plt>
mov    -0x30(%rbp),%rdx
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
mov    0x2e39(%rip),%rax
mov    (%rax),%ecx
lea    -0x18(%rbp),%rsi
call   1030 <inet_ntop@plt>
mov    %rax,%rsi
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsp,%r15
mov    0x2e90(%rip),%r12
mov    (%r12),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e84(%rip),%r13
mov    0x0(%r13),%edi
lea    0xe91(%rip),%rsi
lea    -0x30(%rbp),%r14
mov    %r14,%rdx
call   1050 <inet_pton@plt>
mov    0x0(%r13),%edi
mov    (%r12),%ecx
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
lea    0xe79(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@INET_ADDRSTRLEN = global i32 0
@AF_INET = global i32 0
@.str = [14 x i8] c"192.168.8.192\00"
@.str.1 = [20 x i8] c"192.168.8.192 = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @INET_ADDRSTRLEN
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %7
%12 = alloca i8, i64 %10
store i64 %10, i64* %8
%13 = load i32, i32* @AF_INET
%14 = call i32 @inet_pton(i32 %13, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.in_addr* %6)
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @INET_ADDRSTRLEN
%17 = call i8* @inet_ntop(i32 %15, %struct.in_addr* %6, i8* %12, i32 %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %17)
store i32 0, i32* %3
%19 = load i8*, i8** %7
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@INET_ADDRSTRLEN = global i32 0
@AF_INET = global i32 0
@.str = [14 x i8] c"192.168.8.192\00"
@.str.1 = [20 x i8] c"192.168.8.192 = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.in_addr
%4 = bitcast %struct.in_addr* %3 to i8*
%5 = load i32, i32* @INET_ADDRSTRLEN
%6 = zext i32 %5 to i64
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = load i32, i32* @AF_INET
%10 = call i32 @inet_pton(i32 %9, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %struct.in_addr* %3)
%11 = load i32, i32* @AF_INET
%12 = load i32, i32* @INET_ADDRSTRLEN
%13 = call i8* @inet_ntop(i32 %11, %struct.in_addr* %3, i8* %8, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}