#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*/ test_printf(char *, ...);
int main(void) {
  test_printf("Hello, %10s!\n", "world");
  test_printf("%d + %d = %d\n", 2, 2, 4);
  test_printf("%4.8d\n", 22);
  test_printf("%8.4d\n", 22);
  test_printf("%4.8d\n", -22);
  test_printf("%*.*d\n", 8, 4, -22);
  test_printf("%+4.8d\n", 1234567890);
  test_printf("%+8.4d\n", 1234567890);
  test_printf("%-12.6x\n", 0xc0ffee);
  test_printf("%0.6X\n", 0xc0ffee);
  test_printf("%u\n", 0xFFFFFFFF);
  ;
  test_printf("%p\n", 0x80000000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x2,%edx
mov    $0x4,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x16,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x16,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xea7(%rip),%rdi
mov    $0xffffffea,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xea2(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
mov    $0xffffffea,%ecx
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x499602d2,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xe81(%rip),%rdi
mov    $0x499602d2,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xe76(%rip),%rdi
mov    $0xc0ffee,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0xc0ffee,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xe60(%rip),%rdi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
lea    0xe51(%rip),%rdi
mov    $0x80000000,%esi
mov    $0x0,%al
call   1030 <test_printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeef(%rip),%rsi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xec9(%rip),%rdi
mov    $0x16,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
mov    %rbx,%rdi
mov    $0xffffffea,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xeae(%rip),%rdi
mov    $0x8,%esi
mov    $0x4,%edx
mov    $0xffffffea,%ecx
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xe98(%rip),%rdi
mov    $0x499602d2,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x499602d2,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xe82(%rip),%rdi
mov    $0xc0ffee,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xe78(%rip),%rdi
mov    $0xc0ffee,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
lea    0xe5d(%rip),%rdi
mov    $0x80000000,%esi
xor    %eax,%eax
call   1030 <test_printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, %10s!\0A\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [14 x i8] c"%d + %d = %d\0A\00"
@.str.3 = [7 x i8] c"%4.8d\0A\00"
@.str.4 = [7 x i8] c"%8.4d\0A\00"
@.str.5 = [7 x i8] c"%*.*d\0A\00"
@.str.6 = [8 x i8] c"%+4.8d\0A\00"
@.str.7 = [8 x i8] c"%+8.4d\0A\00"
@.str.8 = [9 x i8] c"%-12.6x\0A\00"
@.str.9 = [7 x i8] c"%0.6X\0A\00"
@.str.10 = [4 x i8] c"%u\0A\00"
@.str.11 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 2, i32 4)
%4 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 22)
%5 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 22)
%6 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 -22)
%7 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 8, i32 4, i32 -22)
%8 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 1234567890)
%9 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 1234567890)
%10 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 12648430)
%11 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 12648430)
%12 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 -1)
%13 = call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 -2147483648)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, %10s!\0A\00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [14 x i8] c"%d + %d = %d\0A\00"
@.str.3 = [7 x i8] c"%4.8d\0A\00"
@.str.4 = [7 x i8] c"%8.4d\0A\00"
@.str.5 = [7 x i8] c"%*.*d\0A\00"
@.str.6 = [8 x i8] c"%+4.8d\0A\00"
@.str.7 = [8 x i8] c"%+8.4d\0A\00"
@.str.8 = [9 x i8] c"%-12.6x\0A\00"
@.str.9 = [7 x i8] c"%0.6X\0A\00"
@.str.10 = [4 x i8] c"%u\0A\00"
@.str.11 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 2, i32 2, i32 4)
%3 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 22)
%4 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 22)
%5 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 -22)
%6 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 8, i32 4, i32 -22)
%7 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 1234567890)
%8 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i32 1234567890)
%9 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 12648430)
%10 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 12648430)
%11 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 -1)
%12 = tail call i32 (i8*, ...) @test_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 -2147483648)
ret i32 0
}