#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 glist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ check_gl(char *);
struct glist *create_gl(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ print_gl(struct glist *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char s[40];
  struct glist *gl;
  strcpy(s, "((),(),(1,2,(3,4),()),(6,7))");
  if (!check_gl(s))
    exit(1);
  gl = create_gl(s);
  print_gl(gl);
  putchar('\n');
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xe86(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x30(%rbp),%rdi
call   1040 <check_gl@plt>
cmp    $0x0,%eax
jne    119b <main+0x3b>
mov    $0x1,%edi
call   1080 <exit@plt>
lea    -0x30(%rbp),%rdi
call   1070 <create_gl@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1060 <print_gl@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xe94(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <check_gl@plt>
test   %eax,%eax
jne    118d <main+0x2d>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    %rsp,%rdi
call   1070 <create_gl@plt>
mov    %rax,%rdi
call   1060 <print_gl@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
%struct.glist = type { i32 }
@.str = [29 x i8] c"((),(),(1,2,(3,4),()),(6,7))\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca %struct.glist*
store i32 0, i32* %1
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = call i32 @check_gl(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%13 = call %struct.glist* @create_gl(i8* %12)
store %struct.glist* %13, %struct.glist** %3
%14 = load %struct.glist*, %struct.glist** %3
%15 = call i32 @print_gl(%struct.glist* %14)
%16 = call i32 @putchar(i8 signext 10)
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.glist = type { i32 }
@.str = [29 x i8] c"((),(),(1,2,(3,4),()),(6,7))\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @check_gl(i8* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 1)
unreachable
8: ; preds = %0
%9 = call %struct.glist* @create_gl(i8* %2)
%10 = call i32 @print_gl(%struct.glist* %9)
%11 = call i32 @putchar(i8 signext 10)
%12 = call i32 @exit(i32 0)
unreachable
}