#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*/ myprintf(char *, char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char const *argv[]) {
  int i = 65;
  char str[] = "This is my string";
  myprintf("\nMessage = %s%d%x", str, i, i);
  printf("\n\n");
  printf("\nMessage = %s%d%x", str, i, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x41,-0x14(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x20(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xea3(%rip),%rdi
call   1040 <myprintf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movaps 0xec2(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x67,0x10(%rsp)
lea    0xec2(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x41,%edx
mov    $0x41,%ecx
call   1050 <myprintf@plt>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x41,%edx
mov    $0x41,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.str = [18 x i8] c"This is my string\00"
@.str = [18 x i8] c"\0AMessage = %s%d%x\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [18 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 65, i32* %6
%8 = bitcast [18 x i8]* %7 to i8*
%9 = getelementptr inbounds [18 x i8], [18 x i8]* %7, i64 0, i64 0
%10 = load i32, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @myprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [18 x i8], [18 x i8]* %7, i64 0, i64 0
%15 = load i32, i32* %6
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [18 x i8] c"This is my string\00"
@.str = [18 x i8] c"\0AMessage = %s%d%x\00"
@str = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [18 x i8]
%4 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%5 = call i32 @myprintf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i32 65, i32 65)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i32 65, i32 65)
ret i32 0
}