#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*/ assert(int);
double config_get_double_value(char *);
int config_get_long_value(char *);
int /*<<< orphan*/ config_get_value(char *);
int /*<<< orphan*/ config_read_file(char *);
int /*<<< orphan*/ config_set_value(char *, char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
void test_config(void) {
  config_set_value("default", "default");
  config_set_value("string_value", "xx");
  config_read_file("ticker/tests/config.data");
  assert(strcmp(config_get_value("default"), "default") == 0);
  assert(strcmp(config_get_value("string_value"), "foobar") == 0);
  assert(config_get_long_value("long_value") == 42);
  assert(config_get_double_value("double_value") == -17.2);
}


x86 assembly (clang, -O0):
<test_config>:
push   %rbp
mov    %rsp,%rbp
lea    0xe8d(%rip),%rsi
mov    %rsi,%rdi
call   1090 <config_set_value@plt>
lea    0xe86(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1090 <config_set_value@plt>
lea    0xe83(%rip),%rdi
call   1030 <config_read_file@plt>
lea    0xe5f(%rip),%rdi
call   1040 <config_get_value@plt>
mov    %eax,%edi
lea    0xe51(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe3c(%rip),%rdi
call   1040 <config_get_value@plt>
mov    %eax,%edi
lea    0xe57(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe41(%rip),%rdi
call   1070 <config_get_long_value@plt>
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe30(%rip),%rdi
call   1080 <config_get_double_value@plt>
movsd  0xdd8(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_config>:
push   %r14
push   %rbx
push   %rax
lea    0xe8d(%rip),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1090 <config_set_value@plt>
lea    0xe83(%rip),%r14
lea    0xe89(%rip),%rsi
mov    %r14,%rdi
call   1090 <config_set_value@plt>
lea    0xe7d(%rip),%rdi
call   1030 <config_read_file@plt>
mov    %rbx,%rdi
call   1040 <config_get_value@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %r14,%rdi
call   1040 <config_get_value@plt>
lea    0xe62(%rip),%rsi
mov    %eax,%edi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    0xe4d(%rip),%rdi
call   1070 <config_get_long_value@plt>
xor    %edi,%edi
cmp    $0x2a,%eax
sete   %dil
call   1060 <assert@plt>
lea    0xe3e(%rip),%rdi
call   1080 <config_get_double_value@plt>
cmpeqsd 0xde5(%rip),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <assert@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"default\00"
@.str.1 = [13 x i8] c"string_value\00"
@.str.2 = [3 x i8] c"xx\00"
@.str.3 = [25 x i8] c"ticker/tests/config.data\00"
@.str.4 = [7 x i8] c"foobar\00"
@.str.5 = [11 x i8] c"long_value\00"
@.str.6 = [13 x i8] c"double_value\00"
define void @test_config() {
%1 = call i32 @config_set_value(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @config_set_value(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 @config_read_file(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 @config_get_value(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i64 @strcmp(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 @config_get_value(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = call i64 @strcmp(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32 @config_get_long_value(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%15 = icmp eq i32 %14, 42
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call double @config_get_double_value(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%19 = fcmp oeq double %18, -1.720000e+01
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"default\00"
@.str.1 = [13 x i8] c"string_value\00"
@.str.2 = [3 x i8] c"xx\00"
@.str.3 = [25 x i8] c"ticker/tests/config.data\00"
@.str.4 = [7 x i8] c"foobar\00"
@.str.5 = [11 x i8] c"long_value\00"
@.str.6 = [13 x i8] c"double_value\00"
define void @test_config() {
%1 = tail call i32 @config_set_value(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @config_set_value(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @config_read_file(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32 @config_get_value(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = tail call i64 @strcmp(i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @config_get_value(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i64 @strcmp(i32 %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @config_get_long_value(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%15 = icmp eq i32 %14, 42
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call double @config_get_double_value(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%19 = fcmp oeq double %18, -1.720000e+01
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
ret void
}