#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*/ gfw_resolve(char const *, char *);
int /*<<< orphan*/ printf(char *, char const *);
int main(int argc, char const *argv[]) {
  if (argc < 2) {
    printf("Usage: %s domain\n", argv[0]);
  } else {
    char ip[256];
    gfw_resolve(argv[1], ip);
    printf("The real ip is: %s\n", 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    115b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1182 <main+0x62>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x110(%rbp),%rsi
call   1040 <gfw_resolve@plt>
lea    -0x110(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
cmp    $0x1,%edi
jg     1139 <main+0x19>
mov    (%rsi),%rsi
lea    0xec9(%rip),%rdi
jmp    1152 <main+0x32>
mov    0x8(%rsi),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <gfw_resolve@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s domain\0A\00"
@.str.1 = [20 x i8] c"The 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 %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %22
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%19 = call i32 @gfw_resolve(i8* %17, i8* %18)
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%21 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %14, %9
ret i32 0
}

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