#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 uint32_t;
struct in_addr {
  int member_0;
};

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *inet_ntoa(struct in_addr);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr,
            "Convert integer to string IP addresses\n\n"
            "Usage: %s IntegerIpAddr ...\n",
            argv[0]);
    exit(1);
  }
  for (int i = 1; i < argc; ++i) {
    uint32_t value = atoi(argv[i]);
    struct in_addr addr = {value};
    printf("%-12u %s\n", value, inet_ntoa(addr));
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jge    1196 <main+0x46>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe79(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f1 <main+0xa1>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%edi
call   1030 <inet_ntoa@plt>
mov    -0x24(%rbp),%esi
mov    %rax,%rdx
lea    0xe67(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <main+0x4d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
cmp    $0x2,%edi
jl     11a3 <main+0x53>
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed6(%rip),%r14
nop
mov    (%r15,%rbx,8),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <inet_ntoa@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1170 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xe4a(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@stderr = global i32 0
@.str = [69 x i8] c"Convert integer to string IP addresses\0A\0AUsage: %s IntegerIpAddr ...\0A\00"
@.str.1 = [10 x i8] c"%-12u %s\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 %struct.in_addr
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 0
%15 = load i8*, i8** %14
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; preds = %2
store i32 1, i32* %6
br label %19
19: ; preds = %37, %18
%20 = load i32, i32* %6
%21 = load i32, i32* %4
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %40
23: ; preds = %19
%24 = load i8**, i8*** %5
%25 = load i32, i32* %6
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %7
%30 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
%31 = load i32, i32* %7
store i32 %31, i32* %30
%32 = load i32, i32* %7
%33 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %8, i32 0, i32 0
%34 = load i32, i32* %33
%35 = call i8* @inet_ntoa(i32 %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %32, i8* %35)
br label %37
37: ; preds = %23
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %19
40: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [69 x i8] c"Convert integer to string IP addresses\0A\0AUsage: %s IntegerIpAddr ...\0A\00"
@.str.1 = [10 x i8] c"%-12u %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %12
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %12
ret i32 0
12: ; preds = %4, %12
%13 = phi i64 [ 1, %4 ], [ %19, %12 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @atoi(i8* %15)
%17 = tail call i8* @inet_ntoa(i32 %16)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %16, i8* %17)
%19 = add nuw nsw i64 %13, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %11, label %12
}