#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int A = 5, count_one, count_two;
  printf("The number of bytes written up to this point X%n is being stored in "
         "count_one, 			\nand the number of bytes up to here "
         "X%n is being stored in count_two.\n",
         &count_one, &count_two);
  printf("count_one: %d\n", count_one);
  printf("count_two: %d\n", count_two);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
  printf("A is %d and is at %p. B is %x.\n", A, (void *)&A);
#pragma GCC diagnostic pop
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    0xec3(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xf43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xf41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    -0x8(%rbp),%rdx
lea    0xf3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x5,0x14(%rsp)
lea    0xecd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
lea    0xf4a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xf47(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf48(%rip),%rdi
lea    0x14(%rsp),%rdx
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [153 x i8] c"The number of bytes written up to this point X%n is being stored in count_one, \09\09\09\0Aand the number of bytes up to here X%n is being stored in count_two.\0A\00"
@.str.1 = [15 x i8] c"count_one: %d\0A\00"
@.str.2 = [15 x i8] c"count_two: %d\0A\00"
@.str.3 = [32 x i8] c"A is %d and is at %p. B is %x.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = bitcast i32* %2 to i8*
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %10, i8* %11)
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [153 x i8] c"The number of bytes written up to this point X%n is being stored in count_one, \09\09\09\0Aand the number of bytes up to here X%n is being stored in count_two.\0A\00"
@.str.1 = [15 x i8] c"count_one: %d\0A\00"
@.str.2 = [15 x i8] c"count_two: %d\0A\00"
@.str.3 = [32 x i8] c"A is %d and is at %p. B is %x.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 5, i32* %1)
%13 = call i32 @exit(i32 0)
unreachable
}