#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*/ add_pars_per_file(char *, int /*<<< orphan*/ *, int, int,
                                     int, int, int, char *);
int /*<<< orphan*/ config_error_exit(int, char *);
char *find_next_par(char *);
char *strchr(char *, char);
void set_default_convert(int linenr, char *cmd, char *par) {
  char *re;
  char *cur_cv = par;
  if ((re = find_next_par(par)) == NULL)
    config_error_exit(linenr, "default_convert entry malformed: scheme name or "
                              "regular expression missing.\n");
  for (;;) {
    char *colon = strchr(cur_cv, ',');
    if (colon)
      *colon = 0x00;
    add_pars_per_file(re, NULL, -1, -1, -1, -1, -1, cur_cv);
    if (!colon)
      break;
    cur_cv = colon + 1;
  }
}


x86 assembly (clang, -O0):
<set_default_convert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <find_next_par@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1181 <set_default_convert+0x41>
mov    -0x4(%rbp),%edi
lea    0xe84(%rip),%rsi
call   1060 <config_error_exit@plt>
jmp    1186 <set_default_convert+0x46>
mov    -0x28(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     11aa <set_default_convert+0x6a>
mov    -0x30(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%esi
mov    $0xffffffff,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0xffffffff,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <add_pars_per_file@plt>
cmpq   $0x0,-0x30(%rbp)
jne    11e6 <set_default_convert+0xa6>
jmp    11f7 <set_default_convert+0xb7>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1186 <set_default_convert+0x46>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_convert>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1050 <find_next_par@plt>
mov    %rax,%r14
test   %rax,%rax
jne    116a <set_default_convert+0x2a>
lea    0xe9d(%rip),%rsi
mov    %ebp,%edi
call   1060 <config_error_exit@plt>
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     11c7 <set_default_convert+0x87>
mov    %rax,%r15
nop
movb   $0x0,(%r15)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
mov    $0xffffffff,%r9d
push   %rbx
push   $0xffffffffffffffff
call   1040 <add_pars_per_file@plt>
add    $0x10,%rsp
mov    %r15,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <strchr@plt>
mov    %rax,%r15
test   %rax,%rax
jne    1180 <set_default_convert+0x40>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
mov    $0xffffffff,%r8d
mov    $0xffffffff,%r9d
push   %rbx
push   $0xffffffffffffffff
call   1040 <add_pars_per_file@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [77 x i8] c"default_convert entry malformed: scheme name or regular expression missing.\0A\00"
define void @set_default_convert(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %6
store i8* %10, i8** %8
%11 = load i8*, i8** %6
%12 = call i8* @find_next_par(i8* %11)
store i8* %12, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = load i32, i32* %4
%16 = call i32 @config_error_exit(i32 %15, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %14, %3
br label %18
18: ; preds = %32, %17
%19 = load i8*, i8** %8
%20 = call i8* @strchr(i8* %19, i8 signext 44)
store i8* %20, i8** %9
%21 = load i8*, i8** %9
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i8*, i8** %9
store i8 0, i8* %24
br label %25
25: ; preds = %23, %18
%26 = load i8*, i8** %7
%27 = load i8*, i8** %8
%28 = call i32 @add_pars_per_file(i8* %26, i32* null, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i8* %27)
%29 = load i8*, i8** %9
%30 = icmp ne i8* %29, null
br i1 %30, label %32, label %31
31: ; preds = %25
br label %35
32: ; preds = %25
%33 = load i8*, i8** %9
%34 = getelementptr inbounds i8, i8* %33, i64 1
store i8* %34, i8** %8
br label %18
35: ; preds = %31
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"default_convert entry malformed: scheme name or regular expression missing.\0A\00"
define void @set_default_convert(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = tail call i8* @find_next_par(i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @config_error_exit(i32 %0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 44)
%10 = icmp eq i8* %9, null
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %16, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %2, %8 ]
store i8 0, i8* %12
%14 = tail call i32 @add_pars_per_file(i8* %4, i32* null, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i8* %13)
%15 = getelementptr inbounds i8, i8* %12, i64 1
%16 = tail call i8* @strchr(i8* dereferenceable(1) %15, i8 signext 44)
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %11
18: ; preds = %11, %8
%19 = phi i8* [ %2, %8 ], [ %15, %11 ]
%20 = tail call i32 @add_pars_per_file(i8* %4, i32* null, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i8* %19)
ret void
}