#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*/ assertStringsEqual(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, ...);
void test_space_flag() {
  char buffer[100];
  sprintf(buffer, "% d", 42);
  assertStringsEqual(buffer, " 42");
  sprintf(buffer, "% d", -42);
  assertStringsEqual(buffer, "-42");
  sprintf(buffer, "% 5d", 42);
  assertStringsEqual(buffer, "   42");
  sprintf(buffer, "% 5d", -42);
  assertStringsEqual(buffer, "  -42");
  sprintf(buffer, "% 15d", 42);
  assertStringsEqual(buffer, "             42");
  sprintf(buffer, "% 15d", -42);
  assertStringsEqual(buffer, "            -42");
  sprintf(buffer, "% 15d", -42);
  assertStringsEqual(buffer, "            -42");
  sprintf(buffer, "% 15.3f", -42.987);
  assertStringsEqual(buffer, "        -42.987");
  sprintf(buffer, "% 15.3f", 42.987);
  assertStringsEqual(buffer, "         42.987");
  sprintf(buffer, "% s", "Hello testing");
  assertStringsEqual(buffer, "Hello testing");
  sprintf(buffer, "% d", 1024);
  assertStringsEqual(buffer, " 1024");
  sprintf(buffer, "% d", -1024);
  assertStringsEqual(buffer, "-1024");
  sprintf(buffer, "% i", 1024);
  assertStringsEqual(buffer, " 1024");
  sprintf(buffer, "% i", -1024);
  assertStringsEqual(buffer, "-1024");
  sprintf(buffer, "% u", 1024);
  assertStringsEqual(buffer, "1024");
  sprintf(buffer, "% u", 4294966272U);
  assertStringsEqual(buffer, "4294966272");
  sprintf(buffer, "% o", 511);
  assertStringsEqual(buffer, "777");
  sprintf(buffer, "% o", 4294966785U);
  assertStringsEqual(buffer, "37777777001");
  sprintf(buffer, "% x", 305441741);
  assertStringsEqual(buffer, "1234abcd");
  sprintf(buffer, "% x", 3989525555U);
  assertStringsEqual(buffer, "edcb5433");
  sprintf(buffer, "% X", 305441741);
  assertStringsEqual(buffer, "1234ABCD");
  sprintf(buffer, "% X", 3989525555U);
  assertStringsEqual(buffer, "EDCB5433");
  sprintf(buffer, "% c", 'x');
  assertStringsEqual(buffer, "x");
}


x86 assembly (clang, -O0):
<test_space_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x2a,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xee1(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0xffffffd6,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xeca(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe93(%rip),%rsi
mov    $0x2a,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe6c(%rip),%rsi
mov    $0xffffffd6,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe7a(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe4a(%rip),%rsi
mov    $0x2a,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xe23(%rip),%rsi
mov    $0xffffffd6,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xdfc(%rip),%rsi
mov    $0xffffffd6,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xdfb(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xdfb(%rip),%rsi
movsd  0xdbc(%rip),%xmm0
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xde9(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xdd1(%rip),%rsi
movsd  0xd8a(%rip),%xmm0
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xdcf(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xdcf(%rip),%rsi
lea    0xdcc(%rip),%rdx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xd4f(%rip),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xda1(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xd28(%rip),%rsi
mov    $0xfffffc00,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xd80(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xd76(%rip),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xd53(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xd4f(%rip),%rsi
mov    $0xfffffc00,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xd32(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xd2c(%rip),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xd06(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xd05(%rip),%rsi
mov    $0xfffffc00,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xcf2(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xced(%rip),%rsi
mov    $0x1ff,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xcda(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xcc6(%rip),%rsi
mov    $0xfffffe01,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xcb7(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xcb3(%rip),%rsi
mov    $0x1234abcd,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xca0(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xc8c(%rip),%rsi
mov    $0xedcb5433,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xc82(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xc7b(%rip),%rsi
mov    $0x1234abcd,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xc68(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xc54(%rip),%rsi
mov    $0xedcb5433,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xc4a(%rip),%rsi
call   1030 <assertStringsEqual@plt>
lea    -0x70(%rbp),%rdi
lea    0xc43(%rip),%rsi
mov    $0x78,%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rdi
lea    0xc02(%rip),%rsi
call   1030 <assertStringsEqual@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_space_flag>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xede(%rip),%r14
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2a,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xedd(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffd6,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xe96(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2a,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xffffffd6,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xe52(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x2a,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xe3f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xffffffd6,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xe2e(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0xffffffd6,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <assertStringsEqual@plt>
lea    0xe0f(%rip),%r15
movsd  0xdc8(%rip),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    0xdfb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
movsd  0xdac(%rip),%xmm0
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%al
call   1040 <sprintf@plt>
lea    0xde7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xde8(%rip),%rsi
lea    0xde5(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xdc2(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfffffc00,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xda4(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <assertStringsEqual@plt>
lea    0xd98(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x400,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0xfffffc00,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <assertStringsEqual@plt>
lea    0xd5b(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x400,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xd33(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfffffc00,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xd25(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xd21(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1ff,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xd0c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xfffffe01,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xcef(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xcec(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1234abcd,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xcd7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xedcb5433,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xcbf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xcb9(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1234abcd,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xca4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xedcb5433,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xc8c(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
lea    0xc86(%rip),%rsi
mov    %rbx,%rdi
mov    $0x78,%edx
xor    %eax,%eax
call   1040 <sprintf@plt>
lea    0xc46(%rip),%rsi
mov    %rbx,%rdi
call   1030 <assertStringsEqual@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"% d\00"
@.str.1 = [4 x i8] c" 42\00"
@.str.2 = [4 x i8] c"-42\00"
@.str.3 = [5 x i8] c"% 5d\00"
@.str.4 = [6 x i8] c" 42\00"
@.str.5 = [6 x i8] c" -42\00"
@.str.6 = [6 x i8] c"% 15d\00"
@.str.7 = [16 x i8] c" 42\00"
@.str.8 = [16 x i8] c" -42\00"
@.str.9 = [8 x i8] c"% 15.3f\00"
@.str.10 = [16 x i8] c" -42.987\00"
@.str.11 = [16 x i8] c" 42.987\00"
@.str.12 = [4 x i8] c"% s\00"
@.str.13 = [14 x i8] c"Hello testing\00"
@.str.14 = [6 x i8] c" 1024\00"
@.str.15 = [6 x i8] c"-1024\00"
@.str.16 = [4 x i8] c"% i\00"
@.str.17 = [4 x i8] c"% u\00"
@.str.18 = [5 x i8] c"1024\00"
@.str.19 = [11 x i8] c"4294966272\00"
@.str.20 = [4 x i8] c"% o\00"
@.str.21 = [4 x i8] c"777\00"
@.str.22 = [12 x i8] c"37777777001\00"
@.str.23 = [4 x i8] c"% x\00"
@.str.24 = [9 x i8] c"1234abcd\00"
@.str.25 = [9 x i8] c"edcb5433\00"
@.str.26 = [4 x i8] c"% X\00"
@.str.27 = [9 x i8] c"1234ABCD\00"
@.str.28 = [9 x i8] c"EDCB5433\00"
@.str.29 = [4 x i8] c"% c\00"
@.str.30 = [2 x i8] c"x\00"
define void @test_space_flag() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @assertStringsEqual(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -42)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = call i32 @assertStringsEqual(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 42)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%13 = call i32 @assertStringsEqual(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 -42)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%17 = call i32 @assertStringsEqual(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 42)
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%21 = call i32 @assertStringsEqual(i8* %20, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 -42)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%25 = call i32 @assertStringsEqual(i8* %24, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 -42)
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%29 = call i32 @assertStringsEqual(i8* %28, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%31 = call i32 (i8*, i8*, ...) @sprintf(i8* %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), double -4.298700e+01)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%33 = call i32 @assertStringsEqual(i8* %32, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%35 = call i32 (i8*, i8*, ...) @sprintf(i8* %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), double 4.298700e+01)
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%37 = call i32 @assertStringsEqual(i8* %36, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%40 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%41 = call i32 @assertStringsEqual(i8* %40, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%43 = call i32 (i8*, i8*, ...) @sprintf(i8* %42, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1024)
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%45 = call i32 @assertStringsEqual(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%47 = call i32 (i8*, i8*, ...) @sprintf(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1024)
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%49 = call i32 @assertStringsEqual(i8* %48, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%51 = call i32 (i8*, i8*, ...) @sprintf(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 1024)
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%53 = call i32 @assertStringsEqual(i8* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%54 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%55 = call i32 (i8*, i8*, ...) @sprintf(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 -1024)
%56 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%57 = call i32 @assertStringsEqual(i8* %56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%59 = call i32 (i8*, i8*, ...) @sprintf(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 1024)
%60 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%61 = call i32 @assertStringsEqual(i8* %60, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%62 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%63 = call i32 (i8*, i8*, ...) @sprintf(i8* %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 -1024)
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%65 = call i32 @assertStringsEqual(i8* %64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0))
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%67 = call i32 (i8*, i8*, ...) @sprintf(i8* %66, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32 511)
%68 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%69 = call i32 @assertStringsEqual(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%71 = call i32 (i8*, i8*, ...) @sprintf(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32 -511)
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%73 = call i32 @assertStringsEqual(i8* %72, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%75 = call i32 (i8*, i8*, ...) @sprintf(i8* %74, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0), i32 305441741)
%76 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%77 = call i32 @assertStringsEqual(i8* %76, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0))
%78 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%79 = call i32 (i8*, i8*, ...) @sprintf(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0), i32 -305441741)
%80 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%81 = call i32 @assertStringsEqual(i8* %80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0))
%82 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%83 = call i32 (i8*, i8*, ...) @sprintf(i8* %82, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0), i32 305441741)
%84 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%85 = call i32 @assertStringsEqual(i8* %84, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0))
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%87 = call i32 (i8*, i8*, ...) @sprintf(i8* %86, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0), i32 -305441741)
%88 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%89 = call i32 @assertStringsEqual(i8* %88, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.28, i64 0, i64 0))
%90 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%91 = call i32 (i8*, i8*, ...) @sprintf(i8* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 120)
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%93 = call i32 @assertStringsEqual(i8* %92, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.30, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"% d\00"
@.str.1 = [4 x i8] c" 42\00"
@.str.2 = [4 x i8] c"-42\00"
@.str.3 = [5 x i8] c"% 5d\00"
@.str.4 = [6 x i8] c" 42\00"
@.str.5 = [6 x i8] c" -42\00"
@.str.6 = [6 x i8] c"% 15d\00"
@.str.7 = [16 x i8] c" 42\00"
@.str.8 = [16 x i8] c" -42\00"
@.str.9 = [8 x i8] c"% 15.3f\00"
@.str.10 = [16 x i8] c" -42.987\00"
@.str.11 = [16 x i8] c" 42.987\00"
@.str.12 = [4 x i8] c"% s\00"
@.str.13 = [14 x i8] c"Hello testing\00"
@.str.14 = [6 x i8] c" 1024\00"
@.str.15 = [6 x i8] c"-1024\00"
@.str.16 = [4 x i8] c"% i\00"
@.str.17 = [4 x i8] c"% u\00"
@.str.18 = [5 x i8] c"1024\00"
@.str.19 = [11 x i8] c"4294966272\00"
@.str.20 = [4 x i8] c"% o\00"
@.str.21 = [4 x i8] c"777\00"
@.str.22 = [12 x i8] c"37777777001\00"
@.str.23 = [4 x i8] c"% x\00"
@.str.24 = [9 x i8] c"1234abcd\00"
@.str.25 = [9 x i8] c"edcb5433\00"
@.str.26 = [4 x i8] c"% X\00"
@.str.27 = [9 x i8] c"1234ABCD\00"
@.str.28 = [9 x i8] c"EDCB5433\00"
@.str.29 = [4 x i8] c"% c\00"
@.str.30 = [2 x i8] c"x\00"
define void @test_space_flag() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 42)
%4 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -42)
%6 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 42)
%8 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 -42)
%10 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 42)
%12 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 -42)
%14 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 -42)
%16 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), double -4.298700e+01)
%18 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), double 4.298700e+01)
%20 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.11, i64 0, i64 0))
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%22 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0))
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1024)
%24 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%25 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -1024)
%26 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 1024)
%28 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%29 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i64 0, i64 0), i32 -1024)
%30 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%31 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 1024)
%32 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%33 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0), i32 -1024)
%34 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0))
%35 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32 511)
%36 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i64 0, i64 0))
%37 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i32 -511)
%38 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.22, i64 0, i64 0))
%39 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0), i32 305441741)
%40 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.24, i64 0, i64 0))
%41 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i64 0, i64 0), i32 -305441741)
%42 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0))
%43 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0), i32 305441741)
%44 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0))
%45 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.26, i64 0, i64 0), i32 -305441741)
%46 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.28, i64 0, i64 0))
%47 = call i32 (i8*, i8*, ...) @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.29, i64 0, i64 0), i32 120)
%48 = call i32 @assertStringsEqual(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.30, i64 0, i64 0))
ret void
}