#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 */
struct tag_symbol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ blanks();
scalar_t__ cmatch(char);
int /*<<< orphan*/ init(int, int, int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ needchar(char);
int /*<<< orphan*/ str_init(struct tag_symbol *);
void agg_init(int size, int type, int ident, int *dim, int more,
              struct tag_symbol *tag) {
  while (*dim) {
    if (ident == 2 && type == 6) {
      needchar('{');
      str_init(tag);
      --*dim;
      needchar('}');
    } else {
      init(size, ident, dim, more, (ident == 2 && more == 3), 0);
    }
    if (cmatch(',') == 0)
      break;
    blanks();
  }
}


x86 assembly (clang, -O0):
<agg_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1231 <agg_init+0xe1>
cmpl   $0x2,-0xc(%rbp)
jne    11bb <agg_init+0x6b>
cmpl   $0x6,-0x8(%rbp)
jne    11bb <agg_init+0x6b>
mov    $0x7b,%edi
call   1030 <needchar@plt>
mov    -0x28(%rbp),%rdi
call   1070 <str_init@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
mov    $0x7d,%edi
call   1030 <needchar@plt>
jmp    120c <agg_init+0xbc>
mov    -0x4(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jne    11ee <agg_init+0x9e>
cmpl   $0x3,-0x1c(%rbp)
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x30(%rbp),%ecx
mov    -0x38(%rbp),%rdx
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edi
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%r8d
xor    %r9d,%r9d
call   1050 <init@plt>
mov    $0x2c,%edi
call   1060 <cmatch@plt>
cmp    $0x0,%rax
jne    1225 <agg_init+0xd5>
jmp    1231 <agg_init+0xe1>
mov    $0x0,%al
call   1040 <blanks@plt>
jmp    116d <agg_init+0x1d>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agg_init>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
cmpl   $0x0,(%rcx)
je     11f2 <agg_init+0xa2>
mov    %r8d,%r15d
mov    %rcx,%rbx
mov    %edx,%r13d
mov    %edi,%r12d
cmp    $0x2,%edx
sete   %al
cmp    $0x6,%esi
sete   %r14b
and    %al,%r14b
cmp    $0x3,%r8d
sete   %cl
and    %al,%cl
movzbl %cl,%ebp
test   %r14b,%r14b
je     11c0 <agg_init+0x70>
mov    $0x7b,%edi
call   1030 <needchar@plt>
mov    (%rsp),%rdi
call   1070 <str_init@plt>
addl   $0xffffffff,(%rbx)
mov    $0x7d,%edi
call   1030 <needchar@plt>
jmp    11d7 <agg_init+0x87>
nopw   0x0(%rax,%rax,1)
mov    %r12d,%edi
mov    %r13d,%esi
mov    %rbx,%rdx
mov    %r15d,%ecx
mov    %ebp,%r8d
xor    %r9d,%r9d
call   1050 <init@plt>
mov    $0x2c,%edi
call   1060 <cmatch@plt>
test   %rax,%rax
je     11f2 <agg_init+0xa2>
xor    %eax,%eax
call   1040 <blanks@plt>
cmpl   $0x0,(%rbx)
jne    1190 <agg_init+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tag_symbol = type { i32 }
define void @agg_init(i32 %0, i32 %1, i32 %2, i32* %3, i32 %4, %struct.tag_symbol* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32
%12 = alloca %struct.tag_symbol*
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32* %3, i32** %10
store i32 %4, i32* %11
store %struct.tag_symbol* %5, %struct.tag_symbol** %12
br label %13
13: ; preds = %49, %6
%14 = load i32*, i32** %10
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %51
17: ; preds = %13
%18 = load i32, i32* %9
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %31
20: ; preds = %17
%21 = load i32, i32* %8
%22 = icmp eq i32 %21, 6
br i1 %22, label %23, label %31
23: ; preds = %20
%24 = call i32 @needchar(i8 signext 123)
%25 = load %struct.tag_symbol*, %struct.tag_symbol** %12
%26 = call i32 @str_init(%struct.tag_symbol* %25)
%27 = load i32*, i32** %10
%28 = load i32, i32* %27
%29 = add nsw i32 %28, -1
store i32 %29, i32* %27
%30 = call i32 @needchar(i8 signext 125)
br label %45
31: ; preds = %20, %17
%32 = load i32, i32* %7
%33 = load i32, i32* %9
%34 = load i32*, i32** %10
%35 = load i32, i32* %11
%36 = load i32, i32* %9
%37 = icmp eq i32 %36, 2
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = load i32, i32* %11
%40 = icmp eq i32 %39, 3
br label %41
41: ; preds = %38, %31
%42 = phi i1 [ false, %31 ], [ %40, %38 ]
%43 = zext i1 %42 to i32
%44 = call i32 @init(i32 %32, i32 %33, i32* %34, i32 %35, i32 %43, i32 0)
br label %45
45: ; preds = %41, %23
%46 = call i64 @cmatch(i8 signext 44)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %45
br label %51
49: ; preds = %45
%50 = call i32 (...) @blanks()
br label %13
51: ; preds = %48, %13
ret void
}

LLVM IR (-O2):
%struct.tag_symbol = type { i32 }
define void @agg_init(i32 %0, i32 %1, i32 %2, i32* %3, i32 %4, %struct.tag_symbol* %5) {
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %32, label %9
9: ; preds = %6
%10 = icmp eq i32 %2, 2
%11 = icmp eq i32 %1, 6
%12 = and i1 %11, %10
%13 = icmp eq i32 %4, 3
%14 = and i1 %10, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %9, %28
br i1 %12, label %17, label %23
17: ; preds = %16
%18 = tail call i32 @needchar(i8 signext 123)
%19 = tail call i32 @str_init(%struct.tag_symbol* %5)
%20 = load i32, i32* %3
%21 = add nsw i32 %20, -1
store i32 %21, i32* %3
%22 = tail call i32 @needchar(i8 signext 125)
br label %25
23: ; preds = %16
%24 = tail call i32 @init(i32 %0, i32 %2, i32* %3, i32 %4, i32 %15, i32 0)
br label %25
25: ; preds = %23, %17
%26 = tail call i64 @cmatch(i8 signext 44)
%27 = icmp eq i64 %26, 0
br i1 %27, label %32, label %28
28: ; preds = %25
%29 = tail call i32 (...) @blanks()
%30 = load i32, i32* %3
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %16
32: ; preds = %28, %25, %6
ret void
}