#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*/ time_t;
struct chirp_client {
  int dummy;
};
typedef int /*<<< orphan*/ safepath;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ simple_command(struct chirp_client *, int /*<<< orphan*/,
                                  char *, char *, char const *, char const *);
int /*<<< orphan*/ url_encode(char const *, char *, int);
int64_t chirp_client_setacl(struct chirp_client *c, const char *path,
                            const char *user, const char *acl,
                            time_t stoptime) {
  char safepath[1024];
  url_encode(path, safepath, sizeof(safepath));
  return simple_command(c, stoptime, "setacl %s %s %s\n", safepath, user, acl);
}


x86 assembly (clang, -O0):
<chirp_client_setacl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x430(%rbp),%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x430(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xe8f(%rip),%rdx
call   1030 <simple_command@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chirp_client_setacl>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x400,%rsp
mov    %r8d,%ebp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rdi,%rbx
mov    %rsp,%r12
mov    %rsi,%rdi
mov    %r12,%rsi
mov    $0x400,%edx
call   1040 <url_encode@plt>
lea    0xeab(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
call   1030 <simple_command@plt>
add    $0x400,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.chirp_client = type { i32 }
@.str = [17 x i8] c"setacl %s %s %s\0A\00"
define i32 @chirp_client_setacl(%struct.chirp_client* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca %struct.chirp_client*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca [1024 x i8]
store %struct.chirp_client* %0, %struct.chirp_client** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i8*, i8** %7
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%14 = call i32 @url_encode(i8* %12, i8* %13, i32 1024)
%15 = load %struct.chirp_client*, %struct.chirp_client** %6
%16 = load i32, i32* %10
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%18 = load i8*, i8** %8
%19 = load i8*, i8** %9
%20 = call i32 @simple_command(%struct.chirp_client* %15, i32 %16, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.chirp_client = type { i32 }
@.str = [17 x i8] c"setacl %s %s %s\0A\00"
define i32 @chirp_client_setacl(%struct.chirp_client* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [1024 x i8]
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = call i32 @url_encode(i8* %1, i8* %7, i32 1024)
%9 = call i32 @simple_command(%struct.chirp_client* %0, i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %2, i8* %3)
ret i32 %9
}