#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 benchmark_args {
  int dummy;
};
struct benchmark {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ map_common_exit(struct benchmark *, struct benchmark_args *);
int map_common_init(struct benchmark *, struct benchmark_args *);
int map_keys_init(struct benchmark *, struct benchmark_args *);
int map_bench_get_init(struct benchmark *bench, struct benchmark_args *args) {
  int ret = map_common_init(bench, args);
  if (ret)
    return ret;
  ret = map_keys_init(bench, args);
  if (ret)
    goto err_exit_common;
  return 0;
err_exit_common:
  map_common_exit(bench, args);
  return -1;
}


x86 assembly (clang, -O0):
<map_bench_get_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <map_common_init@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1165 <map_bench_get_init+0x35>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <map_bench_get_init+0x74>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <map_keys_init@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1184 <map_bench_get_init+0x54>
jmp    1190 <map_bench_get_init+0x60>
movl   $0x0,-0x4(%rbp)
jmp    11a4 <map_bench_get_init+0x74>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <map_common_exit@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_bench_get_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <map_common_init@plt>
test   %eax,%eax
jne    1166 <map_bench_get_init+0x36>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <map_keys_init@plt>
test   %eax,%eax
je     1164 <map_bench_get_init+0x34>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <map_common_exit@plt>
mov    $0xffffffff,%eax
jmp    1166 <map_bench_get_init+0x36>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.benchmark = type { i32 }
%struct.benchmark_args = type { i32 }
define i32 @map_bench_get_init(%struct.benchmark* %0, %struct.benchmark_args* %1) {
%3 = alloca i32
%4 = alloca %struct.benchmark*
%5 = alloca %struct.benchmark_args*
%6 = alloca i32
store %struct.benchmark* %0, %struct.benchmark** %4
store %struct.benchmark_args* %1, %struct.benchmark_args** %5
%7 = load %struct.benchmark*, %struct.benchmark** %4
%8 = load %struct.benchmark_args*, %struct.benchmark_args** %5
%9 = call i32 @map_common_init(%struct.benchmark* %7, %struct.benchmark_args* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i32, i32* %6
store i32 %13, i32* %3
br label %26
14: ; preds = %2
%15 = load %struct.benchmark*, %struct.benchmark** %4
%16 = load %struct.benchmark_args*, %struct.benchmark_args** %5
%17 = call i32 @map_keys_init(%struct.benchmark* %15, %struct.benchmark_args* %16)
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %14
br label %22
21: ; preds = %14
store i32 0, i32* %3
br label %26
22: ; preds = %20
%23 = load %struct.benchmark*, %struct.benchmark** %4
%24 = load %struct.benchmark_args*, %struct.benchmark_args** %5
%25 = call i32 @map_common_exit(%struct.benchmark* %23, %struct.benchmark_args* %24)
store i32 -1, i32* %3
br label %26
26: ; preds = %22, %21, %12
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
%struct.benchmark = type { i32 }
%struct.benchmark_args = type { i32 }
define i32 @map_bench_get_init(%struct.benchmark* %0, %struct.benchmark_args* %1) {
%3 = tail call i32 @map_common_init(%struct.benchmark* %0, %struct.benchmark_args* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @map_keys_init(%struct.benchmark* %0, %struct.benchmark_args* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @map_common_exit(%struct.benchmark* %0, %struct.benchmark_args* %1)
br label %10
10: ; preds = %5, %2, %8
%11 = phi i32 [ -1, %8 ], [ %3, %2 ], [ 0, %5 ]
ret i32 %11
}