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

/* Variables and functions */
int _keystore_set_timestamp_property(struct properties *, char *);
int properties_set(struct properties *, char *, char *);
int _keystore_set_default_properties(struct properties *key_props) {
  int rc;
  rc = properties_set(key_props, "cipher", "paes");
  if (rc != 0)
    return rc;
  rc = properties_set(key_props, "iv-mode", "plain64");
  if (rc != 0)
    return rc;
  rc = _keystore_set_timestamp_property(key_props, "creation-time");
  if (rc != 0)
    return rc;
  return 0;
}


x86 assembly (clang, -O0):
<_keystore_set_default_properties>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
lea    0xec9(%rip),%rdx
call   1030 <properties_set@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115b <_keystore_set_default_properties+0x3b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b9 <_keystore_set_default_properties+0x99>
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
lea    0xea7(%rip),%rdx
call   1030 <properties_set@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     118a <_keystore_set_default_properties+0x6a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b9 <_keystore_set_default_properties+0x99>
mov    -0x10(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <_keystore_set_timestamp_property@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11b2 <_keystore_set_default_properties+0x92>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11b9 <_keystore_set_default_properties+0x99>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_keystore_set_default_properties>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
lea    0xed5(%rip),%rdx
call   1030 <properties_set@plt>
test   %eax,%eax
jne    1155 <_keystore_set_default_properties+0x35>
lea    0xeca(%rip),%rsi
lea    0xecb(%rip),%rdx
mov    %rbx,%rdi
call   1030 <properties_set@plt>
test   %eax,%eax
je     1157 <_keystore_set_default_properties+0x37>
pop    %rbx
ret
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <_keystore_set_timestamp_property@plt>

LLVM IR (-O0):
%struct.properties = type { i32 }
@.str = [7 x i8] c"cipher\00"
@.str.1 = [5 x i8] c"paes\00"
@.str.2 = [8 x i8] c"iv-mode\00"
@.str.3 = [8 x i8] c"plain64\00"
@.str.4 = [14 x i8] c"creation-time\00"
define i32 @_keystore_set_default_properties(%struct.properties* %0) {
%2 = alloca i32
%3 = alloca %struct.properties*
%4 = alloca i32
store %struct.properties* %0, %struct.properties** %3
%5 = load %struct.properties*, %struct.properties** %3
%6 = call i32 @properties_set(%struct.properties* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %26
11: ; preds = %1
%12 = load %struct.properties*, %struct.properties** %3
%13 = call i32 @properties_set(%struct.properties* %12, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %26
18: ; preds = %11
%19 = load %struct.properties*, %struct.properties** %3
%20 = call i32 @_keystore_set_timestamp_property(%struct.properties* %19, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 %20, i32* %4
%21 = load i32, i32* %4
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %26
25: ; preds = %18
store i32 0, i32* %2
br label %26
26: ; preds = %25, %23, %16, %9
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
%struct.properties = type { i32 }
@.str = [7 x i8] c"cipher\00"
@.str.1 = [5 x i8] c"paes\00"
@.str.2 = [8 x i8] c"iv-mode\00"
@.str.3 = [8 x i8] c"plain64\00"
@.str.4 = [14 x i8] c"creation-time\00"
define i32 @_keystore_set_default_properties(%struct.properties* %0) {
%2 = tail call i32 @properties_set(%struct.properties* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 @properties_set(%struct.properties* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @_keystore_set_timestamp_property(%struct.properties* %0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %9
9: ; preds = %7, %4, %1
%10 = phi i32 [ %2, %1 ], [ %5, %4 ], [ %8, %7 ]
ret i32 %10
}