#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 setConfigIntValue(char *, int);
int setConfigTextValue(char *, char *);
int setDbVersion(int);
int upgrade7() {
  int status = setDbVersion(7);
  if (status == 0) {
    return 0;
  }
  status = setConfigTextValue("web.rss.host", "");
  if (status == 0) {
    return 0;
  }
  status = setConfigIntValue("web.rss.freq", 1);
  if (status == 0) {
    return 0;
  }
  status = setConfigIntValue("web.rss.items", 10);
  if (status == 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<upgrade7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7,%edi
call   1030 <setDbVersion@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    115b <upgrade7+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <upgrade7+0xb2>
lea    0xe9e(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1050 <setConfigTextValue@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1187 <upgrade7+0x57>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <upgrade7+0xb2>
lea    0xe7f(%rip),%rdi
mov    $0x1,%esi
call   1040 <setConfigIntValue@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11b1 <upgrade7+0x81>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <upgrade7+0xb2>
lea    0xe62(%rip),%rdi
mov    $0xa,%esi
call   1040 <setConfigIntValue@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11db <upgrade7+0xab>
movl   $0x0,-0x4(%rbp)
jmp    11e2 <upgrade7+0xb2>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upgrade7>:
push   %rbx
mov    $0x7,%edi
call   1030 <setDbVersion@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     1185 <upgrade7+0x55>
lea    0xeb8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <setConfigTextValue@plt>
test   %eax,%eax
je     1185 <upgrade7+0x55>
lea    0xeae(%rip),%rdi
mov    $0x1,%esi
call   1040 <setConfigIntValue@plt>
test   %eax,%eax
je     1185 <upgrade7+0x55>
lea    0xea6(%rip),%rdi
mov    $0xa,%esi
call   1040 <setConfigIntValue@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"web.rss.host\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"web.rss.freq\00"
@.str.3 = [14 x i8] c"web.rss.items\00"
define i32 @upgrade7() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @setDbVersion(i32 7)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %23
7: ; preds = %0
%8 = call i32 @setConfigTextValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %1
br label %23
12: ; preds = %7
%13 = call i32 @setConfigIntValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %1
br label %23
17: ; preds = %12
%18 = call i32 @setConfigIntValue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 10)
store i32 %18, i32* %2
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %17
store i32 0, i32* %1
br label %23
22: ; preds = %17
store i32 1, i32* %1
br label %23
23: ; preds = %22, %21, %16, %11, %6
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
@.str = [13 x i8] c"web.rss.host\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"web.rss.freq\00"
@.str.3 = [14 x i8] c"web.rss.items\00"
define i32 @upgrade7() {
%1 = tail call i32 @setDbVersion(i32 7)
%2 = icmp eq i32 %1, 0
br i1 %2, label %13, label %3
3: ; preds = %0
%4 = tail call i32 @setConfigTextValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i32 @setConfigIntValue(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = tail call i32 @setConfigIntValue(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 10)
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %6, %3, %0
%14 = phi i32 [ 0, %0 ], [ 0, %3 ], [ 0, %6 ], [ %12, %9 ]
ret i32 %14
}