#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, char const *);
int main(void) {
  const uint8_t value = 42;
  const char *string = "test";
  printf("Logging value '%d' and string '%s'\n", value, string);
  printf("Logging value '%d' and string '%s'\n", value, string);
  printf("Logging value '%d' and string '%s'\n", value, string);
  printf("Logging value '%d' and string '%s'\n", value, string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2a,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    0xec9(%rip),%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xe9f(%rip),%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rdi
mov    $0x2a,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeea(%rip),%rbx
lea    0xede(%rip),%r14
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2a,%esi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [36 x i8] c"Logging value '%d' and string '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 42, i32* %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* %4)
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [36 x i8] c"Logging value '%d' and string '%s'\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}