#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*/ test_basic_in_loop(int volatile);
int /*<<< orphan*/ test_basic_vla(int volatile);
int /*<<< orphan*/ test_two_in_loops(int volatile);
int /*<<< orphan*/ test_two_recursion(int volatile);
int main(int argc, char *argv[]) {
  volatile int one_iter = 1;
  volatile int ten_iters = 10;
  test_basic_vla(one_iter);
  test_basic_vla(ten_iters);
  test_basic_in_loop(one_iter);
  test_basic_in_loop(ten_iters);
  test_two_in_loops(one_iter);
  test_two_in_loops(ten_iters);
  test_two_recursion(one_iter);
  test_two_recursion(ten_iters);
  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)
movl   $0x1,-0x14(%rbp)
movl   $0xa,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1060 <test_basic_vla@plt>
mov    -0x18(%rbp),%edi
call   1060 <test_basic_vla@plt>
mov    -0x14(%rbp),%edi
call   1030 <test_basic_in_loop@plt>
mov    -0x18(%rbp),%edi
call   1030 <test_basic_in_loop@plt>
mov    -0x14(%rbp),%edi
call   1040 <test_two_in_loops@plt>
mov    -0x18(%rbp),%edi
call   1040 <test_two_in_loops@plt>
mov    -0x14(%rbp),%edi
call   1050 <test_two_recursion@plt>
mov    -0x18(%rbp),%edi
call   1050 <test_two_recursion@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
movl   $0xa,(%rsp)
mov    0x4(%rsp),%edi
call   1060 <test_basic_vla@plt>
mov    (%rsp),%edi
call   1060 <test_basic_vla@plt>
mov    0x4(%rsp),%edi
call   1030 <test_basic_in_loop@plt>
mov    (%rsp),%edi
call   1030 <test_basic_in_loop@plt>
mov    0x4(%rsp),%edi
call   1040 <test_two_in_loops@plt>
mov    (%rsp),%edi
call   1040 <test_two_in_loops@plt>
mov    0x4(%rsp),%edi
call   1050 <test_two_recursion@plt>
mov    (%rsp),%edi
call   1050 <test_two_recursion@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store volatile i32 1, i32* %6
store volatile i32 10, i32* %7
%8 = load volatile i32, i32* %6
%9 = call i32 @test_basic_vla(i32 %8)
%10 = load volatile i32, i32* %7
%11 = call i32 @test_basic_vla(i32 %10)
%12 = load volatile i32, i32* %6
%13 = call i32 @test_basic_in_loop(i32 %12)
%14 = load volatile i32, i32* %7
%15 = call i32 @test_basic_in_loop(i32 %14)
%16 = load volatile i32, i32* %6
%17 = call i32 @test_two_in_loops(i32 %16)
%18 = load volatile i32, i32* %7
%19 = call i32 @test_two_in_loops(i32 %18)
%20 = load volatile i32, i32* %6
%21 = call i32 @test_two_recursion(i32 %20)
%22 = load volatile i32, i32* %7
%23 = call i32 @test_two_recursion(i32 %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
store volatile i32 1, i32* %3
%6 = bitcast i32* %4 to i8*
store volatile i32 10, i32* %4
%7 = load volatile i32, i32* %3
%8 = tail call i32 @test_basic_vla(i32 %7)
%9 = load volatile i32, i32* %4
%10 = tail call i32 @test_basic_vla(i32 %9)
%11 = load volatile i32, i32* %3
%12 = tail call i32 @test_basic_in_loop(i32 %11)
%13 = load volatile i32, i32* %4
%14 = tail call i32 @test_basic_in_loop(i32 %13)
%15 = load volatile i32, i32* %3
%16 = tail call i32 @test_two_in_loops(i32 %15)
%17 = load volatile i32, i32* %4
%18 = tail call i32 @test_two_in_loops(i32 %17)
%19 = load volatile i32, i32* %3
%20 = tail call i32 @test_two_recursion(i32 %19)
%21 = load volatile i32, i32* %4
%22 = tail call i32 @test_two_recursion(i32 %21)
ret i32 0
}