#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*/ change_owner(char *, char *, char *);
int check_file(char *);
int /*<<< orphan*/ move_file(char *, char *);
int /*<<< orphan*/ restart_app();
void handle_config() {
  if (check_file("/tmp/new_config") != -1) {
    move_file("/tmp/new_config", "/usr/application/configuration.config");
    change_owner("/usr/application/configuration.config", "user", "users");
    restart_app();
  }
}


x86 assembly (clang, -O0):
<handle_config>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1050 <check_file@plt>
cmp    $0xffffffff,%eax
je     118d <handle_config+0x4d>
lea    0xea0(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1030 <move_file@plt>
lea    0xe9d(%rip),%rdi
lea    0xebc(%rip),%rsi
lea    0xeba(%rip),%rdx
call   1040 <change_owner@plt>
mov    $0x0,%al
call   1060 <restart_app@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_config>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1050 <check_file@plt>
cmp    $0xffffffff,%eax
je     1186 <handle_config+0x46>
lea    0xea7(%rip),%rdi
lea    0xeb0(%rip),%rbx
mov    %rbx,%rsi
call   1030 <move_file@plt>
lea    0xec7(%rip),%rsi
lea    0xec5(%rip),%rdx
mov    %rbx,%rdi
call   1040 <change_owner@plt>
xor    %eax,%eax
pop    %rbx
jmp    1060 <restart_app@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/new_config\00"
@.str.1 = [38 x i8] c"/usr/application/configuration.config\00"
@.str.2 = [5 x i8] c"user\00"
@.str.3 = [6 x i8] c"users\00"
define void @handle_config() {
%1 = call i32 @check_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @move_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @change_owner(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%6 = call i32 (...) @restart_app()
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/new_config\00"
@.str.1 = [38 x i8] c"/usr/application/configuration.config\00"
@.str.2 = [5 x i8] c"user\00"
@.str.3 = [6 x i8] c"users\00"
define void @handle_config() {
%1 = tail call i32 @check_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @move_file(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @change_owner(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 (...) @restart_app()
br label %7
7: ; preds = %3, %0
ret void
}