#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*/ g(int, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int scanf(char *, int *);
int main(int argc, char **argv) {
  int dw, a[2];
  while (scanf("%d", &dw) == 1) {
    g(dw, a);
    printf("%d %d %d\n", dw, a[0], a[1]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1185 <main+0x55>
mov    -0x14(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1040 <g@plt>
mov    -0x14(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xebe(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    11a0 <main+0x70>
lea    0x10(%rsp),%r14
lea    0xea6(%rip),%r15
lea    0xe9c(%rip),%r12
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
mov    %r14,%rsi
call   1040 <g@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %11, %2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %6
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%14 = call i32 @g(i32 %12, i32* %13)
%15 = load i32, i32* %6
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%17 = load i32, i32* %16
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%19 = load i32, i32* %18
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17, i32 %19)
br label %8
21: ; preds = %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = bitcast i32* %3 to i8*
%6 = bitcast [2 x i32]* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %21
9: ; preds = %2
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
br label %12
12: ; preds = %9, %12
%13 = load i32, i32* %3
%14 = call i32 @g(i32 %13, i32* %10)
%15 = load i32, i32* %3
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%20 = icmp eq i32 %19, 1
br i1 %20, label %12, label %21
21: ; preds = %12, %2
ret i32 0
}