#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 */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int spe_printf(char *, char *, ...);
int main() {
  char msg[] = "Hello World";
  long lv = 1231232312L;
  uint8_t other = 123;
  int r;
  r = spe_printf("Percent:%% string:%s \n", msg);
  assert(r == 0);
  r = spe_printf("unsigned int(6.4):[%6.4u] and long:%ld\n", other, lv);
  assert(r == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
movq   $0x49631d38,-0x18(%rbp)
49
movl   $0x7b,-0x1c(%rbp)
lea    -0x10(%rbp),%rsi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <spe_printf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movslq -0x1c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <spe_printf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f57206f6c6c6548,%rax
20 57 6f
mov    %rax,0x8(%rsp)
movl   $0x646c72,0x10(%rsp)
lea    0xeca(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <spe_printf@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
lea    0xec1(%rip),%rdi
mov    $0x7b,%esi
mov    $0x49631d38,%edx
xor    %eax,%eax
call   1040 <spe_printf@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [12 x i8] c"Hello World\00"
@.str = [23 x i8] c"Percent:%% string:%s \0A\00"
@.str.1 = [40 x i8] c"unsigned int(6.4):[%6.4u] and long:%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [12 x i8]
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [12 x i8]* %2 to i8*
store i64 1231232312, i64* %3
store i32 123, i32* %4
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @spe_printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = load i64, i64* %3
%17 = call i32 (i8*, i8*, ...) @spe_printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %15, i64 %16)
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [12 x i8] c"Hello World\00"
@.str = [23 x i8] c"Percent:%% string:%s \0A\00"
@.str.1 = [40 x i8] c"unsigned int(6.4):[%6.4u] and long:%ld\0A\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @spe_printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i32 (i8*, i8*, ...) @spe_printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* inttoptr (i64 123 to i8*), i64 1231232312)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}