#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*/ printf(char *, char *);
char *scan281(char *);
int main(int argc, char **argv) {
  int n = 0;
  char *largv[2];
  if (argc < 2) {
    argc = 2;
    argv = largv;
    argv[1] = "D-128-208-46-51.dhcp4.washington.edu";
  }
  while (++n < argc) {
    char *res = scan281(argv[n]);
    printf("%s\n", res ? res : "<NULL>");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1165 <main+0x45>
movl   $0x2,-0x8(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xe9f(%rip),%rcx
mov    %rcx,0x8(%rax)
jmp    116a <main+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jge    11ce <main+0xae>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <scan281@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11a9 <main+0x89>
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
jmp    11b9 <main+0x99>
lea    0xe79(%rip),%rax
mov    %rax,-0x40(%rbp)
jmp    11b9 <main+0x99>
mov    -0x40(%rbp),%rsi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
jmp    116a <main+0x4a>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r15
cmp    $0x1,%edi
jg     1149 <main+0x29>
mov    %rsp,%r15
lea    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
mov    $0x2,%edi
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r13
lea    0xec6(%rip),%r14
nop
mov    (%r15,%rbx,8),%rdi
call   1040 <scan281@plt>
test   %rax,%rax
cmove  %r13,%rax
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [37 x i8] c"D-128-208-46-51.dhcp4.washington.edu\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [7 x i8] c"<NULL>\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i8*]
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %15
11: ; preds = %2
store i32 2, i32* %4
%12 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
store i8** %12, i8*** %5
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %14
br label %15
15: ; preds = %11, %2
br label %16
16: ; preds = %33, %15
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %36
21: ; preds = %16
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = call i8* @scan281(i8* %26)
store i8* %27, i8** %8
%28 = load i8*, i8** %8
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %32
30: ; preds = %21
%31 = load i8*, i8** %8
br label %33
32: ; preds = %21
br label %33
33: ; preds = %32, %30
%34 = phi i8* [ %31, %30 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %32 ]
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %34)
br label %16
36: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"D-128-208-46-51.dhcp4.washington.edu\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [7 x i8] c"<NULL>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8** %8
br label %9
9: ; preds = %2, %6
%10 = phi i8** [ %7, %6 ], [ %1, %2 ]
%11 = phi i32 [ 2, %6 ], [ %0, %2 ]
%12 = zext i32 %11 to i64
br label %13
13: ; preds = %9, %13
%14 = phi i64 [ 1, %9 ], [ %21, %13 ]
%15 = getelementptr inbounds i8*, i8** %10, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i8* @scan281(i8* %16)
%18 = icmp eq i8* %17, null
%19 = select i1 %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %17
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = add nuw nsw i64 %14, 1
%22 = icmp eq i64 %21, %12
br i1 %22, label %23, label %13
23: ; preds = %13
ret i32 0
}