#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*/ debug_newline(int);
size_t str_chr(char *, char const);
void debug_field(const char *s, int depth) {
  if (s[str_chr(", ", *s)]) {
    if (*s == ',')
      ;
    if (depth >= 0)
      debug_newline(depth);
    else
      ;
    if (*s == ',')
      s++;
    if (*s == ' ')
      s++;
  };
  ;
  ;
  ;
}


x86 assembly (clang, -O0):
<debug_field>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
lea    0xebe(%rip),%rdi
movsbl (%rax),%esi
call   1040 <str_chr@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax,%rcx,1)
je     11c9 <debug_field+0xa9>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    1170 <debug_field+0x50>
jmp    1170 <debug_field+0x50>
cmpl   $0x0,-0xc(%rbp)
jl     1187 <debug_field+0x67>
mov    -0xc(%rbp),%edi
call   1030 <debug_newline@plt>
jmp    118c <debug_field+0x6c>
jmp    118c <debug_field+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    11a8 <debug_field+0x88>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    11c4 <debug_field+0xa4>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11c9 <debug_field+0xa9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_field>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsbl (%rdi),%esi
lea    0xece(%rip),%rdi
call   1040 <str_chr@plt>
test   %ebp,%ebp
js     114e <debug_field+0x2e>
cmpb   $0x0,(%rbx,%rax,1)
je     114e <debug_field+0x2e>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <debug_newline@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c", \00"
define void @debug_field(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @str_chr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %7)
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %42
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 44
br i1 %16, label %17, label %18
17: ; preds = %12
br label %18
18: ; preds = %17, %12
%19 = load i32, i32* %4
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %4
%23 = call i32 @debug_newline(i32 %22)
br label %25
24: ; preds = %18
br label %25
25: ; preds = %24, %21
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 44
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %3
br label %33
33: ; preds = %30, %25
%34 = load i8*, i8** %3
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 32
br i1 %37, label %38, label %41
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %3
br label %41
41: ; preds = %38, %33
br label %42
42: ; preds = %41, %2
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c", \00"
define void @debug_field(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = tail call i64 @str_chr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
%8 = icmp sgt i32 %1, -1
%9 = and i1 %8, %7
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 @debug_newline(i32 %1)
br label %12
12: ; preds = %10, %2
ret void
}