#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, B = 7, 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);
  printf("A is %d and is at %p. B is %x.\n", A, (void *)&A, B);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x7,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xf3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xf3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xf31(%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
mov    $0x7,%ecx
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
%5 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 7, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5)
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = bitcast i32* %2 to i8*
%13 = load i32, i32* %3
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i32 %11, i8* %12, i32 %13)
%15 = 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, i32 7)
%13 = call i32 @exit(i32 0)
unreachable
}