#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*/ bmount(char *);
int /*<<< orphan*/ bumount(char *);
int /*<<< orphan*/ mi_creat(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int main(int argc, char **argv) {
  char buffer[50];
  int t_size, i = 0;
  bmount("prova");
  sprintf(buffer, "%s%s", argv[1], "/");
  mi_creat(buffer);
  bumount("prova");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x58(%rbp)
lea    0xea3(%rip),%rdi
call   1050 <bmount@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe91(%rip),%rsi
lea    0xe8f(%rip),%rcx
call   1060 <sprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <mi_creat@plt>
lea    0xe6f(%rip),%rdi
call   1040 <bumount@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
lea    0xeaf(%rip),%r14
mov    %r14,%rdi
call   1050 <bmount@plt>
mov    0x8(%rbx),%rdx
lea    0xea2(%rip),%rsi
lea    0xea0(%rip),%rcx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <mi_creat@plt>
mov    %r14,%rdi
call   1040 <bumount@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"prova\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [50 x i8]
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %7
%8 = call i32 @bmount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%15 = call i32 @mi_creat(i8* %14)
%16 = call i32 @bumount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"prova\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [50 x i8]
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @bmount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @mi_creat(i8* %4)
%10 = call i32 @bumount(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}