#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*/ f();
scalar_t__ r1;
scalar_t__ r10;
scalar_t__ r2;
scalar_t__ r3;
scalar_t__ r4;
scalar_t__ r5;
scalar_t__ r6;
scalar_t__ r7;
scalar_t__ r8;
scalar_t__ r9;
f3(int i, int *p) {
  register r1 = 0, r2 = 0, r3 = 0, r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0,
           r9 = 0, r10 = 0;
  *p++ = i ? f() : 0;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     117e <f3+0x6e>
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x3c(%rbp)
jmp    1188 <f3+0x78>
xor    %eax,%eax
mov    %eax,-0x3c(%rbp)
jmp    1188 <f3+0x78>
mov    -0x3c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
je     1121 <f3+0x11>
xor    %eax,%eax
call   1030 <f@plt>
jmp    1123 <f3+0x13>
xor    %eax,%eax
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@r1 = global i64 0
@r10 = global i64 0
@r2 = global i64 0
@r3 = global i64 0
@r4 = global i64 0
@r5 = global i64 0
@r6 = global i64 0
@r7 = global i64 0
@r8 = global i64 0
@r9 = global i64 0
define i32 @f3(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @f()
br label %21
20: ; preds = %2
br label %21
21: ; preds = %20, %18
%22 = phi i32 [ %19, %18 ], [ 0, %20 ]
%23 = load i32*, i32** %5
%24 = getelementptr inbounds i32, i32* %23, i32 1
store i32* %24, i32** %5
store i32 %22, i32* %23
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
@r1 = global i64 0
@r10 = global i64 0
@r2 = global i64 0
@r3 = global i64 0
@r4 = global i64 0
@r5 = global i64 0
@r6 = global i64 0
@r7 = global i64 0
@r8 = global i64 0
@r9 = global i64 0
define i32 @f3(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @f()
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ 0, %2 ]
store i32 %7, i32* %1
ret i32 undef
}