#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*/ Log(int, char *, char *, char *);
int run_rabbitmqctl(char **);
int grant_rabbitmq_permissions(char *username) {
  char *args[] = {"/usr/sbin/rabbitmqctl",
                  "set_permissions",
                  "-p",
                  username,
                  username,
                  ".*",
                  ".*",
                  ".*",
                  NULL};
  Log(7, "Granting permissions on vhost \"%s\" to user \"%s\"", username,
      username);
  return run_rabbitmqctl(args);
}


x86 assembly (clang, -O0):
<grant_rabbitmq_permissions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    0xec5(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x7,%edi
lea    0xe92(%rip),%rsi
call   1040 <Log@plt>
lea    -0x50(%rbp),%rdi
call   1030 <run_rabbitmqctl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grant_rabbitmq_permissions>:
sub    $0x48,%rsp
mov    %rdi,%rcx
lea    0xed2(%rip),%rax
mov    %rax,(%rsp)
lea    0xedd(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xee1(%rip),%rax
mov    %rax,0x10(%rsp)
mov    %rdi,0x18(%rsp)
mov    %rdi,0x20(%rsp)
lea    0xece(%rip),%rax
mov    %rax,0x28(%rsp)
mov    %rax,0x30(%rsp)
mov    %rax,0x38(%rsp)
movq   $0x0,0x40(%rsp)
lea    0xeb2(%rip),%rsi
mov    $0x7,%edi
mov    %rcx,%rdx
call   1040 <Log@plt>
mov    %rsp,%rdi
call   1030 <run_rabbitmqctl@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"/usr/sbin/rabbitmqctl\00"
@.str.1 = [16 x i8] c"set_permissions\00"
@.str.2 = [3 x i8] c"-p\00"
@.str.3 = [3 x i8] c".*\00"
@.str.4 = [48 x i8] c"Granting permissions on vhost \22%s\22 to user \22%s\22\00"
define i32 @grant_rabbitmq_permissions(i8* %0) {
%2 = alloca i8*
%3 = alloca [9 x i8*]
store i8* %0, i8** %2
%4 = getelementptr inbounds [9 x i8*], [9 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds i8*, i8** %4, i64 1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds i8*, i8** %5, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %2
store i8* %8, i8** %7
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %2
store i8* %10, i8** %9
%11 = getelementptr inbounds i8*, i8** %9, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds i8*, i8** %11, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds i8*, i8** %12, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds i8*, i8** %13, i64 1
store i8* null, i8** %14
%15 = load i8*, i8** %2
%16 = load i8*, i8** %2
%17 = call i32 @Log(i32 7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i8* %15, i8* %16)
%18 = getelementptr inbounds [9 x i8*], [9 x i8*]* %3, i64 0, i64 0
%19 = call i32 @run_rabbitmqctl(i8** %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [22 x i8] c"/usr/sbin/rabbitmqctl\00"
@.str.1 = [16 x i8] c"set_permissions\00"
@.str.2 = [3 x i8] c"-p\00"
@.str.3 = [3 x i8] c".*\00"
@.str.4 = [48 x i8] c"Granting permissions on vhost \22%s\22 to user \22%s\22\00"
define i32 @grant_rabbitmq_permissions(i8* %0) {
%2 = alloca [9 x i8*]
%3 = bitcast [9 x i8*]* %2 to i8*
%4 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 3
store i8* %0, i8** %7
%8 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 4
store i8* %0, i8** %8
%9 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 5
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 6
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 7
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 8
store i8* null, i8** %12
%13 = tail call i32 @Log(i32 7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i64 0, i64 0), i8* %0, i8* %0)
%14 = call i32 @run_rabbitmqctl(i8** %4)
ret i32 %14
}