#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*/ g();
main() {
  typedef unsigned short buf[f()];
  for (int i = 0; i < 10; i++) {
    buf b, c;
    g();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%eax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    117c <main+0x5c>
mov    -0x28(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <g@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <main+0x23>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
mov    %rsp,%rbx
xor    %eax,%eax
call   1040 <g@plt>
mov    %rbx,%rsp
xor    %eax,%eax
call   1040 <g@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
%6 = call i32 (...) @f()
%7 = zext i32 %6 to i64
store i32 0, i32* %2
br label %8
8: ; preds = %17, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %3
%13 = alloca i16, i64 %7
store i64 %7, i64* %4
%14 = alloca i16, i64 %7
store i64 %7, i64* %5
%15 = call i32 (...) @g()
%16 = load i8*, i8** %3
br label %17
17: ; preds = %11
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %8
20: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i8* @llvm.stacksave()
%3 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %2)
%4 = tail call i8* @llvm.stacksave()
%5 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %4)
%6 = tail call i8* @llvm.stacksave()
%7 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %6)
%8 = tail call i8* @llvm.stacksave()
%9 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %8)
%10 = tail call i8* @llvm.stacksave()
%11 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %10)
%12 = tail call i8* @llvm.stacksave()
%13 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %12)
%14 = tail call i8* @llvm.stacksave()
%15 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %14)
%16 = tail call i8* @llvm.stacksave()
%17 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %16)
%18 = tail call i8* @llvm.stacksave()
%19 = tail call i32 (...) @g()
tail call void @llvm.stackrestore(i8* %18)
%20 = tail call i32 (...) @g()
ret i32 0
}