#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*/ printf(char *, ...);
scalar_t__ strlen(char *);
void print_smb_path(char *group, char *path) {
  if ((strlen(group) == 0) && (strlen(path) == 0))
    printf("/\n");
  else if (strlen(path) == 0)
    printf("/%s\n", group);
  else {
    if (strlen(group) == 0)
      group = "(unknown_group)";
    printf("/%s/%s\n", group, path);
  }
}


x86 assembly (clang, -O0):
<print_smb_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1169 <print_smb_path+0x49>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1169 <print_smb_path+0x49>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11cc <print_smb_path+0xac>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    1193 <print_smb_path+0x73>
mov    -0x8(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c7 <print_smb_path+0xa7>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%rax
jne    11b1 <print_smb_path+0x91>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11cc <print_smb_path+0xac>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_smb_path>:
mov    %rsi,%rdx
cmpb   $0x0,(%rdi)
mov    (%rsi),%al
je     113f <print_smb_path+0x1f>
mov    %rdi,%rsi
test   %al,%al
jne    114a <print_smb_path+0x2a>
lea    0xedb(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
test   %al,%al
je     1158 <print_smb_path+0x38>
lea    0xeb6(%rip),%rsi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xeb9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"/\0A\00"
@.str.1 = [5 x i8] c"/%s\0A\00"
@.str.2 = [16 x i8] c"(unknown_group)\00"
@.str.3 = [8 x i8] c"/%s/%s\0A\00"
define void @print_smb_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %31
14: ; preds = %8, %2
%15 = load i8*, i8** %4
%16 = call i64 @strlen(i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %30
21: ; preds = %14
%22 = load i8*, i8** %3
%23 = call i64 @strlen(i8* %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %21
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %26
26: ; preds = %25, %21
%27 = load i8*, i8** %3
%28 = load i8*, i8** %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %27, i8* %28)
br label %30
30: ; preds = %26, %18
br label %31
31: ; preds = %30, %12
ret void
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"/%s\0A\00"
@.str.2 = [16 x i8] c"(unknown_group)\00"
@.str.3 = [8 x i8] c"/%s/%s\0A\00"
@str = [2 x i8] c"/\00"
define void @print_smb_path(i8* %0, i8* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 0
br i1 %4, label %7, label %10
7: ; preds = %2
br i1 %6, label %8, label %13
8: ; preds = %7
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %16
10: ; preds = %2
br i1 %6, label %11, label %13
11: ; preds = %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %16
13: ; preds = %7, %10
%14 = phi i8* [ getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), %7 ], [ %0, %10 ]
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* %14, i8* %1)
br label %16
16: ; preds = %11, %13, %8
ret void
}