#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*/ move_into_directory(char const *, char *);
int /*<<< orphan*/ move_up_directory(char *);
scalar_t__ strcmp(char const *, char *);
void process_path_part(const char *dname, char *abs_path) {
  if (strcmp(dname, ".") == 0) {
    return;
  } else if (strcmp(dname, "..") == 0) {
    move_up_directory(abs_path);
    return;
  } else {
    move_into_directory(dname, abs_path);
    return;
  }
}


x86 assembly (clang, -O0):
<process_path_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115f <process_path_part+0x2f>
jmp    1194 <process_path_part+0x64>
mov    -0x8(%rbp),%rdi
lea    0xe96(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1187 <process_path_part+0x57>
mov    -0x10(%rbp),%rdi
call   1040 <move_up_directory@plt>
jmp    1194 <process_path_part+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <move_into_directory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_path_part>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec0(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1171 <process_path_part+0x41>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1179 <process_path_part+0x49>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <move_into_directory@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <move_up_directory@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define void @process_path_part(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 @strcmp(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
br label %20
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = call i32 @move_up_directory(i8* %14)
br label %20
16: ; preds = %9
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = call i32 @move_into_directory(i8* %17, i8* %18)
br label %20
20: ; preds = %16, %13, %8
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define void @process_path_part(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @move_up_directory(i8* %1)
br label %12
10: ; preds = %5
%11 = tail call i32 @move_into_directory(i8* %0, i8* %1)
br label %12
12: ; preds = %2, %10, %8
ret void
}