#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*/ snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ text_ban_setconfig(char *);
int /*<<< orphan*/ text_mode_setconfig(char *);
int /*<<< orphan*/ text_note_setconfig(char *);
int /*<<< orphan*/ text_userdb_setconfig(char *);
int /*<<< orphan*/ text_var_setconfig(char *);
int db_text_init(const char *path, const char *host, const char *user,
                 const char *pass, const char *name,
                 void (*error_func)(const char *msg)) {
  char filename[1024];
  snprintf(filename, 1024, "%s/bans.conf", path);
  text_ban_setconfig(filename);
  snprintf(filename, 1024, "%s/modes.conf", path);
  text_mode_setconfig(filename);
  snprintf(filename, 1024, "%s/notes.conf", path);
  text_note_setconfig(filename);
  snprintf(filename, 1024, "%s/users.conf", path);
  text_userdb_setconfig(filename);
  snprintf(filename, 1024, "%s/vars.conf", path);
  text_var_setconfig(filename);
  return 0;
}


x86 assembly (clang, -O0):
<db_text_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    -0x430(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x400,%esi
lea    0xe66(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x430(%rbp),%rdi
call   1030 <text_ban_setconfig@plt>
lea    -0x430(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x400,%esi
lea    0xe4b(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x430(%rbp),%rdi
call   1080 <text_mode_setconfig@plt>
lea    -0x430(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x400,%esi
lea    0xe31(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x430(%rbp),%rdi
call   1070 <text_note_setconfig@plt>
lea    -0x430(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x400,%esi
lea    0xe17(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x430(%rbp),%rdi
call   1040 <text_userdb_setconfig@plt>
lea    -0x430(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x400,%esi
lea    0xdfd(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x430(%rbp),%rdi
call   1060 <text_var_setconfig@plt>
xor    %eax,%eax
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_text_init>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
lea    0xe8c(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1030 <text_ban_setconfig@plt>
lea    0xe77(%rip),%rdx
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1080 <text_mode_setconfig@plt>
lea    0xe66(%rip),%rdx
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1070 <text_note_setconfig@plt>
lea    0xe55(%rip),%rdx
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1040 <text_userdb_setconfig@plt>
lea    0xe44(%rip),%rdx
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %r14,%rdi
call   1060 <text_var_setconfig@plt>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%s/bans.conf\00"
@.str.1 = [14 x i8] c"%s/modes.conf\00"
@.str.2 = [14 x i8] c"%s/notes.conf\00"
@.str.3 = [14 x i8] c"%s/users.conf\00"
@.str.4 = [13 x i8] c"%s/vars.conf\00"
define i32 @db_text_init(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, void (i8*)* %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca void (i8*)*
%13 = alloca [1024 x i8]
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store void (i8*)* %5, void (i8*)** %12
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%15 = load i8*, i8** %7
%16 = call i32 @snprintf(i8* %14, i32 1024, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%18 = call i32 @text_ban_setconfig(i8* %17)
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%20 = load i8*, i8** %7
%21 = call i32 @snprintf(i8* %19, i32 1024, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%23 = call i32 @text_mode_setconfig(i8* %22)
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%25 = load i8*, i8** %7
%26 = call i32 @snprintf(i8* %24, i32 1024, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%28 = call i32 @text_note_setconfig(i8* %27)
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%30 = load i8*, i8** %7
%31 = call i32 @snprintf(i8* %29, i32 1024, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%33 = call i32 @text_userdb_setconfig(i8* %32)
%34 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%35 = load i8*, i8** %7
%36 = call i32 @snprintf(i8* %34, i32 1024, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %35)
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%38 = call i32 @text_var_setconfig(i8* %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s/bans.conf\00"
@.str.1 = [14 x i8] c"%s/modes.conf\00"
@.str.2 = [14 x i8] c"%s/notes.conf\00"
@.str.3 = [14 x i8] c"%s/users.conf\00"
@.str.4 = [13 x i8] c"%s/vars.conf\00"
define i32 @db_text_init(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, void (i8*)* nocapture readnone %5) {
%7 = alloca [1024 x i8]
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%10 = call i32 @text_ban_setconfig(i8* %8)
%11 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%12 = call i32 @text_mode_setconfig(i8* %8)
%13 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%14 = call i32 @text_note_setconfig(i8* %8)
%15 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%16 = call i32 @text_userdb_setconfig(i8* %8)
%17 = call i32 @snprintf(i8* %8, i32 1024, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %0)
%18 = call i32 @text_var_setconfig(i8* %8)
ret i32 0
}