#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 /*<<< orphan*/ quiz1();
int /*<<< orphan*/ quiz2();
int /*<<< orphan*/ str();
int /*<<< orphan*/ test(int *, int);
int main() {
  int a = 1, b = 3, *x;
  x = &a;
  *x = 2;
  printf("%d\n", a);
  printf("%p\t%p\t%p\n", x, &a, &x);
  test(x, b);
  printf("%d\t%p\t%p\n", *x, &b, &x);
  str();
  quiz2();
  quiz1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x8(%rbp),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe69(%rip),%rdi
lea    -0x8(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1070 <test@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe4b(%rip),%rdi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <str@plt>
mov    $0x0,%al
call   1030 <quiz2@plt>
mov    $0x0,%al
call   1050 <quiz1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movl   $0x3,0x10(%rsp)
lea    0x14(%rsp),%rbx
mov    %rbx,0x8(%rsp)
movl   $0x2,0x14(%rsp)
lea    0xe88(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe79(%rip),%rdi
lea    0x8(%rsp),%r14
mov    %rbx,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1070 <test@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%esi
lea    0xe51(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <str@plt>
xor    %eax,%eax
call   1030 <quiz2@plt>
xor    %eax,%eax
call   1050 <quiz1@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [10 x i8] c"%p\09%p\09%p\0A\00"
@.str.2 = [10 x i8] c"%d\09%p\09%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 1, i32* %2
store i32 3, i32* %3
store i32* %2, i32** %4
%5 = load i32*, i32** %4
store i32 2, i32* %5
%6 = load i32, i32* %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32*, i32** %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %2, i32** %4)
%10 = load i32*, i32** %4
%11 = load i32, i32* %3
%12 = call i32 @test(i32* %10, i32 %11)
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %14, i32* %3, i32** %4)
%16 = call i32 (...) @str()
%17 = call i32 (...) @quiz2()
%18 = call i32 (...) @quiz1()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [10 x i8] c"%p\09%p\09%p\0A\00"
@.str.2 = [10 x i8] c"%d\09%p\09%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
store i32 3, i32* %2
%6 = bitcast i32** %3 to i8*
store i32* %1, i32** %3
store i32 2, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %1, i32** %3)
%9 = load i32*, i32** %3
%10 = call i32 @test(i32* %9, i32 3)
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32* %2, i32** %3)
%14 = call i32 (...) @str()
%15 = call i32 (...) @quiz2()
%16 = call i32 (...) @quiz1()
ret i32 0
}