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

/* Variables and functions */
int /*<<< orphan*/ have_closing_bracket(struct cfg_t *);
int /*<<< orphan*/ have_delimiter(struct cfg_t *);
int /*<<< orphan*/ read_character_err(struct cfg_t *, char *, char *);
int /*<<< orphan*/ write_dynamic(struct cfg_t *, char);
void in_dynamic(struct cfg_t *cfg) {
  char character;
  read_character_err(cfg, &character, "Unmatched [[");

  if (character == '|') {
    have_delimiter(cfg);
  } else if (character == ']') {
    have_closing_bracket(cfg);
  } else {
    write_dynamic(cfg, character);
    in_dynamic(cfg);
  }
  return;
}


x86 assembly (clang, -O0):
<in_dynamic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
lea    0xe95(%rip),%rdx
call   1070 <read_character_err@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x7c,%eax
jne    118b <in_dynamic+0x3b>
mov    -0x8(%rbp),%rdi
call   1030 <have_delimiter@plt>
jmp    11c1 <in_dynamic+0x71>
movsbl -0x9(%rbp),%eax
cmp    $0x5d,%eax
jne    11a6 <in_dynamic+0x56>
mov    -0x8(%rbp),%rdi
call   1040 <have_closing_bracket@plt>
jmp    11bc <in_dynamic+0x6c>
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1050 <write_dynamic@plt>
mov    -0x8(%rbp),%rdi
call   1060 <in_dynamic@plt>
jmp    11c1 <in_dynamic+0x71>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_dynamic>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xea1(%rip),%rdx
lea    0xf(%rsp),%rsi
call   1070 <read_character_err@plt>
mov    0xf(%rsp),%al
cmp    $0x5d,%al
je     117f <in_dynamic+0x2f>
cmp    $0x7c,%al
jne    1189 <in_dynamic+0x39>
mov    %rbx,%rdi
call   1030 <have_delimiter@plt>
jmp    119c <in_dynamic+0x4c>
mov    %rbx,%rdi
call   1040 <have_closing_bracket@plt>
jmp    119c <in_dynamic+0x4c>
movsbl %al,%esi
mov    %rbx,%rdi
call   1050 <write_dynamic@plt>
mov    %rbx,%rdi
call   1060 <in_dynamic@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.cfg_t = type { i32 }
@.str = [13 x i8] c"Unmatched [[\00"
define void @in_dynamic(%struct.cfg_t* %0) {
%2 = alloca %struct.cfg_t*
%3 = alloca i8
store %struct.cfg_t* %0, %struct.cfg_t** %2
%4 = load %struct.cfg_t*, %struct.cfg_t** %2
%5 = call i32 @read_character_err(%struct.cfg_t* %4, i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 124
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load %struct.cfg_t*, %struct.cfg_t** %2
%11 = call i32 @have_delimiter(%struct.cfg_t* %10)
br label %25
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 93
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load %struct.cfg_t*, %struct.cfg_t** %2
%18 = call i32 @have_closing_bracket(%struct.cfg_t* %17)
br label %24
19: ; preds = %12
%20 = load %struct.cfg_t*, %struct.cfg_t** %2
%21 = load i8, i8* %3
%22 = call i32 @write_dynamic(%struct.cfg_t* %20, i8 signext %21)
%23 = load %struct.cfg_t*, %struct.cfg_t** %2
br label %24
24: ; preds = %19, %16
br label %25
25: ; preds = %24, %9
ret void
}

LLVM IR (-O2):
%struct.cfg_t = type { i32 }
@.str = [13 x i8] c"Unmatched [[\00"
define void @in_dynamic(%struct.cfg_t* %0) {
%2 = alloca i8
%3 = call i32 @read_character_err(%struct.cfg_t* %0, i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i8, i8* %2
switch i8 %4, label %9 [
i8 124, label %5
i8 93, label %7
]
5: ; preds = %1
%6 = call i32 @have_delimiter(%struct.cfg_t* %0)
br label %11
7: ; preds = %1
%8 = call i32 @have_closing_bracket(%struct.cfg_t* %0)
br label %11
9: ; preds = %1
%10 = call i32 @write_dynamic(%struct.cfg_t* %0, i8 signext %4)
br label %11
11: ; preds = %7, %9, %5
ret void
}