#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_flag(char *);
int /*<<< orphan*/ free(char *);
char *getenv(char *);
char *strdup(char *);
char *strtok(char *, char *);
void debug_init() {
  char *s = NULL;
  char *t = NULL;
  char *u = NULL;
  s = getenv("INFOCRAWLER_DEBUG");
  if (s == (char *)0)
    return;
  t = strdup(s);
  u = strtok(t, " \t\n");
  do {
    debug_flag(u);
  } while ((u = strtok((char *)0, " \t\n")));
  free(t);
}


x86 assembly (clang, -O0):
<debug_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xe89(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1190 <debug_init+0x40>
jmp    11e1 <debug_init+0x91>
mov    -0x8(%rbp),%rdi
call   1070 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <debug_flag@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe4d(%rip),%rsi
call   1060 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11b1 <debug_init+0x61>
mov    -0x10(%rbp),%rdi
call   1050 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_init>:
push   %r14
push   %rbx
push   %rax
lea    0xea5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     11b6 <debug_init+0x66>
mov    %rax,%rdi
call   1070 <strdup@plt>
mov    %rax,%r14
lea    0xe9b(%rip),%rbx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <strtok@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%rdi
call   1040 <debug_flag@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <strtok@plt>
test   %rax,%rax
jne    1190 <debug_init+0x40>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"INFOCRAWLER_DEBUG\00"
@.str.1 = [4 x i8] c" \09\0A\00"
define void @debug_init() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* null, i8** %1
store i8* null, i8** %2
store i8* null, i8** %3
%4 = call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %1
%5 = load i8*, i8** %1
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %0
br label %22
8: ; preds = %0
%9 = load i8*, i8** %1
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = call i8* @strtok(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %3
br label %13
13: ; preds = %16, %8
%14 = load i8*, i8** %3
%15 = call i32 @debug_flag(i8* %14)
br label %16
16: ; preds = %13
%17 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i8* %17, i8** %3
%18 = icmp ne i8* %17, null
br i1 %18, label %13, label %19
19: ; preds = %16
%20 = load i8*, i8** %2
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %19, %7
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"INFOCRAWLER_DEBUG\00"
@.str.1 = [4 x i8] c" \09\0A\00"
define void @debug_init() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i8* @strdup(i8* %1)
%5 = tail call i8* @strtok(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %6, %3
%7 = phi i8* [ %5, %3 ], [ %9, %6 ]
%8 = tail call i32 @debug_flag(i8* %7)
%9 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6
%12 = tail call i32 @free(i8* %4)
br label %13
13: ; preds = %0, %11
ret void
}