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

/* Variables and functions */
scalar_t__ tls_config_set_cert_file(struct tls_config *, char const *);
scalar_t__ tls_config_set_key_file(struct tls_config *, char const *);
int tls_config_set_keypair_file(struct tls_config *config,
                                const char *cert_file, const char *key_file) {
  if (tls_config_set_cert_file(config, cert_file) != 0)
    return (-1);
  if (tls_config_set_key_file(config, key_file) != 0)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<tls_config_set_keypair_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <tls_config_set_cert_file@plt>
cmp    $0x0,%rax
je     1157 <tls_config_set_keypair_file+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <tls_config_set_keypair_file+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <tls_config_set_key_file@plt>
cmp    $0x0,%rax
je     117a <tls_config_set_keypair_file+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1181 <tls_config_set_keypair_file+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tls_config_set_keypair_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <tls_config_set_cert_file@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    114c <tls_config_set_keypair_file+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <tls_config_set_key_file@plt>
neg    %rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.tls_config = type { i32 }
define i32 @tls_config_set_keypair_file(%struct.tls_config* %0, i8* %1, i8* %2) {
%4 = tail call i64 @tls_config_set_cert_file(%struct.tls_config* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i64 @tls_config_set_key_file(%struct.tls_config* %0, i8* %2)
%8 = icmp ne i64 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ -1, %3 ], [ %9, %6 ]
ret i32 %11
}