#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*/ free(char *);
char *get_simple_uid(char *);
int /*<<< orphan*/ write(char *, char *, char *);
void function_uname(char *uname) {
  char *uid = get_simple_uid(uname);
  write("msproject.xml", "\t<UID>%s</UID>\n", uid);
  write("msproject.xml", "\t<ID>%s</ID>\n", uid);
  write("msproject.xml", "\t<Name>%s</Name>\n", uname);
  free(uid);
}


x86 assembly (clang, -O0):
<function_uname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_simple_uid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xeac(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <write@plt>
mov    -0x10(%rbp),%rdx
lea    0xe95(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1040 <write@plt>
mov    -0x8(%rbp),%rdx
lea    0xe7e(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1040 <write@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_uname>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <get_simple_uid@plt>
mov    %rax,%rbx
lea    0xeb9(%rip),%r15
lea    0xec0(%rip),%rsi
mov    %r15,%rdi
mov    %rax,%rdx
call   1040 <write@plt>
lea    0xebe(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
call   1040 <write@plt>
lea    0xeba(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1040 <write@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [16 x i8] c"\09<UID>%s</UID>\0A\00"
@.str.2 = [14 x i8] c"\09<ID>%s</ID>\0A\00"
@.str.3 = [18 x i8] c"\09<Name>%s</Name>\0A\00"
define void @function_uname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @get_simple_uid(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"msproject.xml\00"
@.str.1 = [16 x i8] c"\09<UID>%s</UID>\0A\00"
@.str.2 = [14 x i8] c"\09<ID>%s</ID>\0A\00"
@.str.3 = [18 x i8] c"\09<Name>%s</Name>\0A\00"
define void @function_uname(i8* %0) {
%2 = tail call i8* @get_simple_uid(i8* %0)
%3 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%5 = tail call i32 @write(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%6 = tail call i32 @free(i8* %2)
ret void
}