#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*/ getlocalip(char *);
int /*<<< orphan*/ setup();
int /*<<< orphan*/ showip(char *);
int main() {
  char ip[20];
  int i;
  setup();
  for (i = 0; i < 10; ++i) {
    getlocalip(ip);
    showip(ip);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <setup@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    1177 <main+0x47>
lea    -0x20(%rbp),%rdi
call   1040 <getlocalip@plt>
lea    -0x20(%rbp),%rdi
call   1030 <showip@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1050 <setup@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
mov    %rbx,%rdi
call   1040 <getlocalip@plt>
mov    %rbx,%rdi
call   1030 <showip@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @setup()
store i32 0, i32* %3
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = call i32 @getlocalip(i8* %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%12 = call i32 @showip(i8* %11)
br label %13
13: ; preds = %8
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @setup()
%4 = call i32 @getlocalip(i8* %2)
%5 = call i32 @showip(i8* %2)
%6 = call i32 @getlocalip(i8* %2)
%7 = call i32 @showip(i8* %2)
%8 = call i32 @getlocalip(i8* %2)
%9 = call i32 @showip(i8* %2)
%10 = call i32 @getlocalip(i8* %2)
%11 = call i32 @showip(i8* %2)
%12 = call i32 @getlocalip(i8* %2)
%13 = call i32 @showip(i8* %2)
%14 = call i32 @getlocalip(i8* %2)
%15 = call i32 @showip(i8* %2)
%16 = call i32 @getlocalip(i8* %2)
%17 = call i32 @showip(i8* %2)
%18 = call i32 @getlocalip(i8* %2)
%19 = call i32 @showip(i8* %2)
%20 = call i32 @getlocalip(i8* %2)
%21 = call i32 @showip(i8* %2)
%22 = call i32 @getlocalip(i8* %2)
%23 = call i32 @showip(i8* %2)
ret i32 0
}