#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*/ ExternFunc(int, int /*<<< orphan*/, short, int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  unsigned i;
  puts("Hello world!\n");
  ExternFunc(-1, 0, (short)argc, 2);
  for (i = 0; i < 10; i++)
    puts(argv[3]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x2,%ecx
movswl %ax,%edx
call   1040 <ExternFunc@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jae    1185 <main+0x65>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
movswl %bp,%edx
mov    $0xffffffff,%edi
xor    %esi,%esi
mov    $0x2,%ecx
call   1040 <ExternFunc@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
mov    0x18(%rbx),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i16
%10 = call i32 @ExternFunc(i32 -1, i32 0, i16 signext %9, i32 2)
store i32 0, i32* %6
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %6
%13 = icmp ult i32 %12, 10
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 3
%17 = load i8*, i8** %16
%18 = call i32 @puts(i8* %17)
br label %19
19: ; preds = %14
%20 = load i32, i32* %6
%21 = add i32 %20, 1
store i32 %21, i32* %6
br label %11
22: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = trunc i32 %0 to i16
%5 = tail call i32 @ExternFunc(i32 -1, i32 0, i16 signext %4, i32 2)
%6 = getelementptr inbounds i8*, i8** %1, i64 3
%7 = load i8*, i8** %6
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
%9 = load i8*, i8** %6
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = load i8*, i8** %6
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
%13 = load i8*, i8** %6
%14 = tail call i32 @puts(i8* dereferenceable(1) %13)
%15 = load i8*, i8** %6
%16 = tail call i32 @puts(i8* dereferenceable(1) %15)
%17 = load i8*, i8** %6
%18 = tail call i32 @puts(i8* dereferenceable(1) %17)
%19 = load i8*, i8** %6
%20 = tail call i32 @puts(i8* dereferenceable(1) %19)
%21 = load i8*, i8** %6
%22 = tail call i32 @puts(i8* dereferenceable(1) %21)
%23 = load i8*, i8** %6
%24 = tail call i32 @puts(i8* dereferenceable(1) %23)
%25 = load i8*, i8** %6
%26 = tail call i32 @puts(i8* dereferenceable(1) %25)
ret i32 0
}