#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 */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ note_daemon(int /*<<< orphan*/, char *);
int /*<<< orphan*/ note_process(int /*<<< orphan*/, char *);
int /*<<< orphan*/ pounder_fprintf(int /*<<< orphan*/, char *, char *, char);
int /*<<< orphan*/ stdout;
void note_child(pid_t pid, char *fname, char type) {
  if (type == 'T') {
    note_process(pid, fname);
  } else if (type == 'D') {
    note_daemon(pid, fname);
  } else {
    pounder_fprintf(stdout,
                    "Don't know what to do with child `%s' of type %c.\n",
                    fname, type);
  }
}


x86 assembly (clang, -O0):
<note_child>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x54,%eax
jne    1162 <note_child+0x32>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <note_process@plt>
jmp    11a2 <note_child+0x72>
movsbl -0x11(%rbp),%eax
cmp    $0x44,%eax
jne    1180 <note_child+0x50>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <note_daemon@plt>
jmp    119d <note_child+0x6d>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe6c(%rip),%rsi
movsbl -0x11(%rbp),%ecx
call   1030 <pounder_fprintf@plt>
jmp    11a2 <note_child+0x72>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_child>:
mov    %rsi,%rax
cmp    $0x44,%dl
je     1145 <note_child+0x15>
cmp    $0x54,%dl
jne    114d <note_child+0x1d>
mov    %rax,%rsi
jmp    1050 <note_process@plt>
mov    %rax,%rsi
jmp    1040 <note_daemon@plt>
mov    0x2e8c(%rip),%rcx
mov    (%rcx),%edi
movsbl %dl,%ecx
lea    0xea0(%rip),%rsi
mov    %rax,%rdx
jmp    1030 <pounder_fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [51 x i8] c"Don't know what to do with child `%s' of type %c.\0A\00"
define void @note_child(i32 %0, i8* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 84
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = call i32 @note_process(i32 %11, i8* %12)
br label %28
14: ; preds = %3
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 68
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %4
%20 = load i8*, i8** %5
%21 = call i32 @note_daemon(i32 %19, i8* %20)
br label %27
22: ; preds = %14
%23 = load i32, i32* @stdout
%24 = load i8*, i8** %5
%25 = load i8, i8* %6
%26 = call i32 @pounder_fprintf(i32 %23, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %24, i8 signext %25)
br label %27
27: ; preds = %22, %18
br label %28
28: ; preds = %27, %10
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [51 x i8] c"Don't know what to do with child `%s' of type %c.\0A\00"
define void @note_child(i32 %0, i8* %1, i8 signext %2) {
switch i8 %2, label %8 [
i8 84, label %4
i8 68, label %6
]
4: ; preds = %3
%5 = tail call i32 @note_process(i32 %0, i8* %1)
br label %11
6: ; preds = %3
%7 = tail call i32 @note_daemon(i32 %0, i8* %1)
br label %11
8: ; preds = %3
%9 = load i32, i32* @stdout
%10 = tail call i32 @pounder_fprintf(i32 %9, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %1, i8 signext %2)
br label %11
11: ; preds = %6, %8, %4
ret void
}