int main(void) {
  int array[5], array2[5];
  int return_value = 0;
  int ii = 0;
  int argc = 1;
  __asm volatile("" : "+r"(argc));
  for (ii = 0; ii < 5; ii++) {
    array[ii] = argc;
    array2[ii] = argc * argc + argc;
  }
  return_value = func1(array, array2);
  if (return_value != (2 + 2 + 2 + 2 + 2))
    return 1;
  return_value = func2(array2, array);
  if (return_value != (3 * 3 * 3 * 3 * 3) + (2 + 2 + 2 + 2 + 2))
    return 2;
  return_value = func3(array, array2);
  if (return_value != 4)
    return 3;
  return_value = func4(array, array2);
  if (return_value != 16)
    return 4;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x1,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    11a6 <main+0x66>
mov    -0x4c(%rbp),%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x4c(%rbp),%ecx
imul   -0x4c(%rbp),%ecx
add    -0x4c(%rbp),%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1171 <main+0x31>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <func1@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
je     11ce <main+0x8e>
movl   $0x1,-0x4(%rbp)
jmp    1250 <main+0x110>
lea    -0x40(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1060 <func2@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xfd,-0x44(%rbp)
je     11f9 <main+0xb9>
movl   $0x2,-0x4(%rbp)
jmp    1250 <main+0x110>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1030 <func3@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x4,-0x44(%rbp)
je     1221 <main+0xe1>
movl   $0x3,-0x4(%rbp)
jmp    1250 <main+0x110>
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1050 <func4@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x10,-0x44(%rbp)
je     1249 <main+0x109>
movl   $0x4,-0x4(%rbp)
jmp    1250 <main+0x110>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    $0x1,%ebx
mov    $0x1,%eax
mov    %eax,%ecx
imul   %eax,%ecx
add    %eax,%ecx
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,0x20(%rsp)
movd   %ecx,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,(%rsp)
mov    %eax,0x30(%rsp)
mov    %ecx,0x10(%rsp)
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <func1@plt>
cmp    $0xa,%eax
jne    11dd <main+0x9d>
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1060 <func2@plt>
mov    $0x2,%ebx
cmp    $0xfd,%eax
jne    11dd <main+0x9d>
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <func3@plt>
mov    $0x3,%ebx
cmp    $0x4,%eax
jne    11dd <main+0x9d>
lea    0x20(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <func4@plt>
xor    %ebx,%ebx
cmp    $0x10,%eax
setne  %bl
shl    $0x2,%ebx
mov    %ebx,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [5 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 %7)
store i32 %8, i32* %6
store i32 0, i32* %5
br label %9
9: ; preds = %25, %0
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 5
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %15
store i32 %13, i32* %16
%17 = load i32, i32* %6
%18 = load i32, i32* %6
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %6
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %23
store i32 %21, i32* %24
br label %25
25: ; preds = %12
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %9
28: ; preds = %9
%29 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%31 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func1 to i32 (i32*, i32*, ...)*)(i32* %29, i32* %30)
store i32 %31, i32* %4
%32 = load i32, i32* %4
%33 = icmp ne i32 %32, 10
br i1 %33, label %34, label %35
34: ; preds = %28
store i32 1, i32* %1
br label %57
35: ; preds = %28
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%38 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func2 to i32 (i32*, i32*, ...)*)(i32* %36, i32* %37)
store i32 %38, i32* %4
%39 = load i32, i32* %4
%40 = icmp ne i32 %39, 253
br i1 %40, label %41, label %42
41: ; preds = %35
store i32 2, i32* %1
br label %57
42: ; preds = %35
%43 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%44 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%45 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func3 to i32 (i32*, i32*, ...)*)(i32* %43, i32* %44)
store i32 %45, i32* %4
%46 = load i32, i32* %4
%47 = icmp ne i32 %46, 4
br i1 %47, label %48, label %49
48: ; preds = %42
store i32 3, i32* %1
br label %57
49: ; preds = %42
%50 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%51 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%52 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func4 to i32 (i32*, i32*, ...)*)(i32* %50, i32* %51)
store i32 %52, i32* %4
%53 = load i32, i32* %4
%54 = icmp ne i32 %53, 16
br i1 %54, label %55, label %56
55: ; preds = %49
store i32 4, i32* %1
br label %57
56: ; preds = %49
store i32 0, i32* %1
br label %57
57: ; preds = %56, %55, %48, %41, %34
%58 = load i32, i32* %1
ret i32 %58
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = bitcast [5 x i32]* %1 to i8*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = tail call i32 asm sideeffect "", "=r,0,~{dirflag},~{fpsr},~{flags}"(i32 1)
%6 = mul nsw i32 %5, %5
%7 = add nsw i32 %6, %5
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%10 = insertelement <4 x i32> poison, i32 %5, i64 0
%11 = shufflevector <4 x i32> %10, <4 x i32> poison, <4 x i32> zeroinitializer
%12 = bitcast [5 x i32]* %1 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %12
%13 = insertelement <4 x i32> poison, i32 %7, i64 0
%14 = shufflevector <4 x i32> %13, <4 x i32> poison, <4 x i32> zeroinitializer
%15 = bitcast [5 x i32]* %2 to <4 x i32>*
store <4 x i32> %14, <4 x i32>* %15
%16 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 4
store i32 %5, i32* %16
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 4
store i32 %7, i32* %17
%18 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func1 to i32 (i32*, i32*, ...)*)(i32* %8, i32* %9)
%19 = icmp eq i32 %18, 10
br i1 %19, label %20, label %30
20: ; preds = %0
%21 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func2 to i32 (i32*, i32*, ...)*)(i32* %9, i32* %8)
%22 = icmp eq i32 %21, 253
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func3 to i32 (i32*, i32*, ...)*)(i32* %8, i32* %9)
%25 = icmp eq i32 %24, 4
br i1 %25, label %26, label %30
26: ; preds = %23
%27 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @func4 to i32 (i32*, i32*, ...)*)(i32* %8, i32* %9)
%28 = icmp eq i32 %27, 16
%29 = select i1 %28, i32 0, i32 4
br label %30
30: ; preds = %26, %23, %20, %0
%31 = phi i32 [ 1, %0 ], [ 2, %20 ], [ 3, %23 ], [ %29, %26 ]
ret i32 %31
}