#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 */
char *db_get_configpath_from_project(char const *);
int /*<<< orphan*/
db_move_all_process_from_active_to_shutdown_list(char const *);
int /*<<< orphan*/ db_move_all_process_from_init_to_shutdown_list(char const *);
int /*<<< orphan*/ db_remove_project(char const *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printlog(char *, char const *);
int /*<<< orphan*/ qgis_inotify_delete_watch(char const *, char *);
void project_manager_shutdown_project(const char *project_name) {
  printlog("shutdown project '%s'", project_name);
  char *path = db_get_configpath_from_project(project_name);
  qgis_inotify_delete_watch(project_name, path);
  free(path);
  db_move_all_process_from_init_to_shutdown_list(project_name);
  db_move_all_process_from_active_to_shutdown_list(project_name);
  db_remove_project(project_name);
}


x86 assembly (clang, -O0):
<project_manager_shutdown_project>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe79(%rip),%rdi
call   1080 <printlog@plt>
mov    -0x8(%rbp),%rdi
call   1040 <db_get_configpath_from_project@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <qgis_inotify_delete_watch@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1060 <db_move_all_process_from_init_to_shutdown_list@plt>
mov    -0x8(%rbp),%rdi
call   1070 <db_move_all_process_from_active_to_shutdown_list@plt>
mov    -0x8(%rbp),%rdi
call   1090 <db_remove_project@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<project_manager_shutdown_project>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xe82(%rip),%rdi
mov    %rbx,%rsi
call   1080 <printlog@plt>
mov    %rbx,%rdi
call   1040 <db_get_configpath_from_project@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %rax,%rsi
call   1050 <qgis_inotify_delete_watch@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1060 <db_move_all_process_from_init_to_shutdown_list@plt>
mov    %rbx,%rdi
call   1070 <db_move_all_process_from_active_to_shutdown_list@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1090 <db_remove_project@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"shutdown project '%s'\00"
define void @project_manager_shutdown_project(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printlog(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %2
%7 = call i8* @db_get_configpath_from_project(i8* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @qgis_inotify_delete_watch(i8* %8, i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @free(i8* %11)
%13 = load i8*, i8** %2
%14 = call i32 @db_move_all_process_from_init_to_shutdown_list(i8* %13)
%15 = load i8*, i8** %2
%16 = call i32 @db_move_all_process_from_active_to_shutdown_list(i8* %15)
%17 = load i8*, i8** %2
%18 = call i32 @db_remove_project(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"shutdown project '%s'\00"
define void @project_manager_shutdown_project(i8* %0) {
%2 = tail call i32 @printlog(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8* @db_get_configpath_from_project(i8* %0)
%4 = tail call i32 @qgis_inotify_delete_watch(i8* %0, i8* %3)
%5 = tail call i32 @free(i8* %3)
%6 = tail call i32 @db_move_all_process_from_init_to_shutdown_list(i8* %0)
%7 = tail call i32 @db_move_all_process_from_active_to_shutdown_list(i8* %0)
%8 = tail call i32 @db_remove_project(i8* %0)
ret void
}