#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 /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ gfw_resolve(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  char real_ip[256];
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <domain> ...\n", argv[0]);
    return -1;
  }
  while (--argc > 0) {
    gfw_resolve(*++argv, real_ip);
    printf("The %s real ip is: %s\n", *argv, real_ip);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    117b <main+0x4b>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe96(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11d7 <main+0xa7>
jmp    1180 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    11d0 <main+0xa0>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    -0x110(%rbp),%rsi
call   1050 <gfw_resolve@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    -0x110(%rbp),%rdx
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jge    1164 <main+0x34>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    11a7 <main+0x77>
mov    %edi,%ebp
add    $0x8,%rbx
add    $0x1,%ebp
mov    %rsp,%r14
lea    0xea1(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rdi
mov    %r14,%rsi
call   1050 <gfw_resolve@plt>
mov    (%rbx),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1030 <printf@plt>
add    $0x8,%rbx
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
ja     1180 <main+0x50>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <domain> ...\0A\00"
@.str.1 = [23 x i8] c"The %s real ip is: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 -1, i32* %3
br label %31
15: ; preds = %2
br label %16
16: ; preds = %20, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, -1
store i32 %18, i32* %4
%19 = icmp sgt i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %5
%23 = load i8*, i8** %22
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%25 = call i32 @gfw_resolve(i8* %23, i8* %24)
%26 = load i8**, i8*** %5
%27 = load i8*, i8** %26
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%29 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %28)
br label %16
30: ; preds = %16
store i32 0, i32* %3
br label %31
31: ; preds = %30, %9
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <domain> ...\0A\00"
@.str.1 = [23 x i8] c"The %s real ip is: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %20
10: ; preds = %2, %10
%11 = phi i8** [ %14, %10 ], [ %1, %2 ]
%12 = phi i32 [ %13, %10 ], [ %0, %2 ]
%13 = add nsw i32 %12, -1
%14 = getelementptr inbounds i8*, i8** %11, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @gfw_resolve(i8* %15, i8* %4)
%17 = load i8*, i8** %14
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* %4)
%19 = icmp ugt i32 %12, 2
br i1 %19, label %10, label %20
20: ; preds = %10, %6
%21 = phi i32 [ -1, %6 ], [ 0, %10 ]
ret i32 %21
}