#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 get_conf_value(char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char getva[128] = {0};
  char pathname_key[] = "Path";
  char profilename[] = "/home/ufo/.mozilla/firefox/profiles.ini";
  int ret = get_conf_value(profilename, pathname_key, getva);
  if (ret == 0)
    printf("get pathname_key's value from profile:%s is %s\n", profilename,
           getva);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1050 <memset@plt>
mov    0xe95(%rip),%eax
mov    %eax,-0x95(%rbp)
mov    0xe8d(%rip),%al
mov    %al,-0x91(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xeb5(%rip),%rsi
mov    $0x28,%edx
call   1060 <memcpy@plt>
lea    -0xc0(%rbp),%rdi
lea    -0x95(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   1030 <get_conf_value@plt>
mov    %eax,-0xc4(%rbp)
cmpl   $0x0,-0xc4(%rbp)
jne    11dc <main+0x9c>
lea    -0xc0(%rbp),%rsi
lea    -0x90(%rbp),%rdx
lea    0xe2e(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xc0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movb   $0x0,0xc(%rsp)
movl   $0x68746150,0x8(%rsp)
68
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x696e692e73656c,%rax
mov    %rax,0x30(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x40(%rsp),%rdx
call   1030 <get_conf_value@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    11c3 <main+0xa3>
lea    0xe51(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x40(%rsp),%rdx
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0xc0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.pathname_key = [5 x i8] c"Path\00"
@__const.main.profilename = [40 x i8] c"/home/ufo/.mozilla/firefox/profiles.ini\00"
@.str = [48 x i8] c"get pathname_key's value from profile:%s is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [5 x i8]
%4 = alloca [40 x i8]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [128 x i8]* %2 to i8*
%7 = bitcast [5 x i8]* %3 to i8*
%8 = bitcast [40 x i8]* %4 to i8*
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%12 = call i32 @get_conf_value(i8* %9, i8* %10, i8* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %0
%16 = getelementptr inbounds [40 x i8], [40 x i8]* %4, i64 0, i64 0
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
br label %19
19: ; preds = %15, %0
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@__const.main.pathname_key = [5 x i8] c"Path\00"
@__const.main.profilename = [40 x i8] c"/home/ufo/.mozilla/firefox/profiles.ini\00"
@.str = [48 x i8] c"get pathname_key's value from profile:%s is %s\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [5 x i8]
%3 = alloca [40 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%7 = call i32 @get_conf_value(i8* %6, i8* %5, i8* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %4)
br label %11
11: ; preds = %9, %0
ret i32 %7
}