#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*/ cdep_add_command(char const *, char const *);
int /*<<< orphan*/ cdep_add_dependency(char const *, char const *);
int /*<<< orphan*/ cdep_add_path(char const *, char const *);
int /*<<< orphan*/ cdep_add_target(char const *);
scalar_t__ strcmp(char const *, char *);
int handler(void *user, const char *section, const char *name,
            const char *value) {
  cdep_add_target(section);
  if (strcmp(name, "cmd") == 0) {
    cdep_add_command(section, value);
  } else if (strcmp(name, "dep") == 0) {
    cdep_add_dependency(section, value);
  } else if (strcmp(name, "path") == 0) {
    cdep_add_path(section, value);
  } else {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <cdep_add_target@plt>
mov    -0x20(%rbp),%rdi
lea    0xe84(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119d <handler+0x4d>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <cdep_add_command@plt>
jmp    120b <handler+0xbb>
mov    -0x20(%rbp),%rdi
lea    0xe5c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c9 <handler+0x79>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <cdep_add_dependency@plt>
jmp    1206 <handler+0xb6>
mov    -0x20(%rbp),%rdi
lea    0xe34(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f5 <handler+0xa5>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <cdep_add_path@plt>
jmp    1201 <handler+0xb1>
movl   $0x0,-0x4(%rbp)
jmp    1212 <handler+0xc2>
jmp    1206 <handler+0xb6>
jmp    120b <handler+0xbb>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rsi,%rdi
call   1050 <cdep_add_target@plt>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b4 <handler+0x64>
lea    0xe83(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11c1 <handler+0x71>
lea    0xe73(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    11d1 <handler+0x81>
mov    %r15,%rdi
mov    %r14,%rsi
call   1070 <cdep_add_path@plt>
jmp    11cc <handler+0x7c>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <cdep_add_command@plt>
jmp    11cc <handler+0x7c>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <cdep_add_dependency@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cmd\00"
@.str.1 = [4 x i8] c"dep\00"
@.str.2 = [5 x i8] c"path\00"
define i32 @handler(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = load i8*, i8** %7
%11 = call i32 @cdep_add_target(i8* %10)
%12 = load i8*, i8** %8
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = load i8*, i8** %9
%18 = call i32 @cdep_add_command(i8* %16, i8* %17)
br label %38
19: ; preds = %4
%20 = load i8*, i8** %8
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %7
%25 = load i8*, i8** %9
%26 = call i32 @cdep_add_dependency(i8* %24, i8* %25)
br label %37
27: ; preds = %19
%28 = load i8*, i8** %8
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i8*, i8** %7
%33 = load i8*, i8** %9
%34 = call i32 @cdep_add_path(i8* %32, i8* %33)
br label %36
35: ; preds = %27
store i32 0, i32* %5
br label %39
36: ; preds = %31
br label %37
37: ; preds = %36, %23
br label %38
38: ; preds = %37, %15
store i32 1, i32* %5
br label %39
39: ; preds = %38, %35
%40 = load i32, i32* %5
ret i32 %40
}

LLVM IR (-O2):
@.str = [4 x i8] c"cmd\00"
@.str.1 = [4 x i8] c"dep\00"
@.str.2 = [5 x i8] c"path\00"
define i32 @handler(i8* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @cdep_add_target(i8* %1)
%6 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @cdep_add_command(i8* %1, i8* %3)
br label %20
10: ; preds = %4
%11 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @cdep_add_dependency(i8* %1, i8* %3)
br label %20
15: ; preds = %10
%16 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @cdep_add_path(i8* %1, i8* %3)
br label %20
20: ; preds = %8, %18, %13, %15
%21 = phi i32 [ 0, %15 ], [ 1, %13 ], [ 1, %18 ], [ 1, %8 ]
ret i32 %21
}