#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 config_setting_t {
  int dummy;
};

/* Variables and functions */
int __config_setting_get_int(struct config_setting_t *, int *);
struct config_setting_t *
config_setting_get_member(struct config_setting_t const *, char const *);
int config_setting_lookup_int(const struct config_setting_t *setting,
                              const char *name, int *value) {
  struct config_setting_t *member = config_setting_get_member(setting, name);
  if (!member)
    return ((0));
  return (__config_setting_get_int(member, value));
}


x86 assembly (clang, -O0):
<config_setting_lookup_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <config_setting_get_member@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115c <config_setting_lookup_int+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    116c <config_setting_lookup_int+0x4c>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <__config_setting_get_int@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_setting_lookup_int>:
push   %rbx
mov    %rdx,%rbx
call   1030 <config_setting_get_member@plt>
test   %rax,%rax
je     113a <config_setting_lookup_int+0x1a>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <__config_setting_get_int@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.config_setting_t = type { i32 }
define i32 @config_setting_lookup_int(%struct.config_setting_t* %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.config_setting_t*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca %struct.config_setting_t*
store %struct.config_setting_t* %0, %struct.config_setting_t** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%9 = load %struct.config_setting_t*, %struct.config_setting_t** %5
%10 = load i8*, i8** %6
%11 = call %struct.config_setting_t* @config_setting_get_member(%struct.config_setting_t* %9, i8* %10)
store %struct.config_setting_t* %11, %struct.config_setting_t** %8
%12 = load %struct.config_setting_t*, %struct.config_setting_t** %8
%13 = icmp ne %struct.config_setting_t* %12, null
br i1 %13, label %15, label %14
14: ; preds = %3
store i32 0, i32* %4
br label %19
15: ; preds = %3
%16 = load %struct.config_setting_t*, %struct.config_setting_t** %8
%17 = load i32*, i32** %7
%18 = call i32 @__config_setting_get_int(%struct.config_setting_t* %16, i32* %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %14
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.config_setting_t = type { i32 }
define i32 @config_setting_lookup_int(%struct.config_setting_t* %0, i8* %1, i32* %2) {
%4 = tail call %struct.config_setting_t* @config_setting_get_member(%struct.config_setting_t* %0, i8* %1)
%5 = icmp eq %struct.config_setting_t* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @__config_setting_get_int(%struct.config_setting_t* %4, i32* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}