#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*/ minprintf(char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int a = 200;
  char s[] = "Hello there";
  printf("Testing strings:\n");
  minprintf("Well hello %s\n", "mr. ups man");
  minprintf("Well hello %s\n", s);
  printf("Testing ints:\n");
  minprintf("Well hello %d bitch %d\n", a, a);
  printf("Testin octals:\n");
  minprintf("Well hello %o\n", a);
  printf("Testin hexadecimals:\n");
  minprintf("Well hello %x\n", a);
  minprintf("Well hello %X\n", a);
  printf("Well hello %X\n", a);
  printf("Testin character:\n");
  minprintf("Well hello %c\n", 'a');
  printf("Testing addreses:\n");
  minprintf("Well hello %p\n", &a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xc8,-0x14(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeba(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <minprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <minprintf@plt>
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1040 <minprintf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <minprintf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <minprintf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <minprintf@plt>
mov    -0x14(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x61,%esi
mov    $0x0,%al
call   1040 <minprintf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <minprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0xc8,0xc(%rsp)
movabs $0x6874206f6c6c6548,%rax
20 74 68
mov    %rax,0x10(%rsp)
movl   $0x657265,0x18(%rsp)
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rbx
lea    0xead(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <minprintf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <minprintf@plt>
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8d(%rip),%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
xor    %eax,%eax
call   1050 <minprintf@plt>
lea    0xef7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe81(%rip),%rdi
mov    $0xc8,%esi
xor    %eax,%eax
call   1050 <minprintf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe71(%rip),%rdi
mov    $0xc8,%esi
xor    %eax,%eax
call   1050 <minprintf@plt>
lea    0xe6d(%rip),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
xor    %eax,%eax
call   1050 <minprintf@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4b(%rip),%rdi
mov    $0x61,%esi
xor    %eax,%eax
call   1050 <minprintf@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3b(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <minprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [12 x i8] c"Hello there\00"
@.str = [18 x i8] c"Testing strings:\0A\00"
@.str.1 = [15 x i8] c"Well hello %s\0A\00"
@.str.2 = [12 x i8] c"mr. ups man\00"
@.str.3 = [15 x i8] c"Testing ints:\0A\00"
@.str.4 = [24 x i8] c"Well hello %d bitch %d\0A\00"
@.str.5 = [16 x i8] c"Testin octals:\0A\00"
@.str.6 = [15 x i8] c"Well hello %o\0A\00"
@.str.7 = [22 x i8] c"Testin hexadecimals:\0A\00"
@.str.8 = [15 x i8] c"Well hello %x\0A\00"
@.str.9 = [15 x i8] c"Well hello %X\0A\00"
@.str.10 = [19 x i8] c"Testin character:\0A\00"
@.str.11 = [15 x i8] c"Well hello %c\0A\00"
@.str.12 = [19 x i8] c"Testing addreses:\0A\00"
@.str.13 = [15 x i8] c"Well hello %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [12 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 200, i32* %6
%8 = bitcast [12 x i8]* %7 to i8*
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%12 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 %14, i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %6
%24 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %23)
%25 = load i32, i32* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%28 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 97)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0))
%30 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [12 x i8] c"Hello there\00"
@.str.1 = [15 x i8] c"Well hello %s\0A\00"
@.str.2 = [12 x i8] c"mr. ups man\00"
@.str.4 = [24 x i8] c"Well hello %d bitch %d\0A\00"
@.str.6 = [15 x i8] c"Well hello %o\0A\00"
@.str.8 = [15 x i8] c"Well hello %x\0A\00"
@.str.9 = [15 x i8] c"Well hello %X\0A\00"
@.str.11 = [15 x i8] c"Well hello %c\0A\00"
@.str.13 = [15 x i8] c"Well hello %p\0A\00"
@str = [17 x i8] c"Testing strings:\00"
@str.14 = [14 x i8] c"Testing ints:\00"
@str.15 = [15 x i8] c"Testin octals:\00"
@str.16 = [21 x i8] c"Testin hexadecimals:\00"
@str.17 = [18 x i8] c"Testin character:\00"
@str.18 = [18 x i8] c"Testing addreses:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [12 x i8]
%5 = bitcast i32* %3 to i8*
store i32 200, i32* %3
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.14, i64 0, i64 0))
%11 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i32 200, i32 200)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.15, i64 0, i64 0))
%13 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 200)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%15 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 200)
%16 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 200)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 200)
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.17, i64 0, i64 0))
%19 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 97)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.18, i64 0, i64 0))
%21 = call i32 (i8*, ...) @minprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32* %3)
ret i32 0
}