#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 */
struct node_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __dfsDisplayRec(struct node_t *, int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
graph_dfs_display(struct node_t *gorig, int n) {
  int *status = (int *)malloc(n * sizeof(int));
  memset(status, 0, n * sizeof(int));
  printf("N = %d\n", n);
  __dfsDisplayRec(gorig, status);
  free(status);
}


x86 assembly (clang, -O0):
<graph_dfs_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x14(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <__dfsDisplayRec@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<graph_dfs_display>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x0(,%r15,4),%ebp
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <memset@plt>
lea    0xe7e(%rip),%rdi
mov    %r15d,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <__dfsDisplayRec@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.node_t = type { i32 }
@.str = [8 x i8] c"N = %d\0A\00"
define i32 @graph_dfs_display(%struct.node_t* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.node_t*
%5 = alloca i32
%6 = alloca i32*
store %struct.node_t* %0, %struct.node_t** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = mul i64 %8, 4
%10 = trunc i64 %9 to i32
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %6
%13 = load i32*, i32** %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 4
%17 = trunc i64 %16 to i32
%18 = call i32 @memset(i32* %13, i32 0, i32 %17)
%19 = load i32, i32* %5
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load %struct.node_t*, %struct.node_t** %4
%22 = load i32*, i32** %6
%23 = call i32 @__dfsDisplayRec(%struct.node_t* %21, i32* %22)
%24 = load i32*, i32** %6
%25 = call i32 @free(i32* %24)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
%struct.node_t = type { i32 }
@.str = [8 x i8] c"N = %d\0A\00"
define i32 @graph_dfs_display(%struct.node_t* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @memset(i32* %5, i32 0, i32 %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %1)
%8 = tail call i32 @__dfsDisplayRec(%struct.node_t* %0, i32* %5)
%9 = tail call i32 @free(i32* %5)
ret i32 undef
}