#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*/ printf(char *, int, unsigned int);
int main() {
  char ch1 = 'A', ch2 = 'B';
  int n1 = 100, n2 = 100000;
  unsigned int address1 = &ch1;
  unsigned int address2 = &ch2;
  unsigned int address3 = &n1;
  unsigned int address4 = &n2;
  printf("%c, %u\n", ch1, address1);
  printf("%c, %u\n", ch2, address2);
  printf("%d, %u\n", n1, address3);
  printf("%d, %u\n", n2, address4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movb   $0x42,-0x6(%rbp)
movl   $0x64,-0xc(%rbp)
movl   $0x186a0,-0x10(%rbp)
lea    -0x5(%rbp),%rax
mov    %eax,-0x14(%rbp)
lea    -0x6(%rbp),%rax
mov    %eax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %eax,-0x1c(%rbp)
lea    -0x10(%rbp),%rax
mov    %eax,-0x20(%rbp)
movsbl -0x5(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x6(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movb   $0x41,0xf(%rsp)
movb   $0x42,0xe(%rsp)
movl   $0x64,0x14(%rsp)
movl   $0x186a0,0x10(%rsp)
lea    0xf(%rsp),%rdx
lea    0xe(%rsp),%r12
lea    0x14(%rsp),%r14
lea    0x10(%rsp),%r15
lea    0xeb0(%rip),%rbx
mov    %rbx,%rdi
mov    $0x41,%esi
call   1030 <printf@plt>
movsbl 0xe(%rsp),%esi
mov    %rbx,%rdi
mov    %r12d,%edx
call   1030 <printf@plt>
mov    0x14(%rsp),%esi
lea    0xe90(%rip),%rbx
mov    %rbx,%rdi
mov    %r14d,%edx
call   1030 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
mov    %r15d,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%c, %u\0A\00"
@.str.1 = [8 x i8] c"%d, %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i8 65, i8* %2
store i8 66, i8* %3
store i32 100, i32* %4
store i32 100000, i32* %5
%10 = ptrtoint i8* %2 to i32
store i32 %10, i32* %6
%11 = ptrtoint i8* %3 to i32
store i32 %11, i32* %7
%12 = ptrtoint i32* %4 to i32
store i32 %12, i32* %8
%13 = ptrtoint i32* %5 to i32
store i32 %13, i32* %9
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = load i32, i32* %6
%17 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = load i32, i32* %7
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i32, i32* %4
%23 = load i32, i32* %8
%24 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %23)
%25 = load i32, i32* %5
%26 = load i32, i32* %9
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %25, i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%c, %u\0A\00"
@.str.1 = [8 x i8] c"%d, %u\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 65, i8* %1
store i8 66, i8* %2
%5 = bitcast i32* %3 to i8*
store i32 100, i32* %3
%6 = bitcast i32* %4 to i8*
store i32 100000, i32* %4
%7 = ptrtoint i8* %1 to i64
%8 = trunc i64 %7 to i32
%9 = ptrtoint i8* %2 to i64
%10 = trunc i64 %9 to i32
%11 = ptrtoint i32* %3 to i64
%12 = trunc i64 %11 to i32
%13 = ptrtoint i32* %4 to i64
%14 = trunc i64 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 65, i32 %8)
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %10)
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 %12)
%21 = load i32, i32* %4
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %21, i32 %14)
ret i32 0
}