#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*/ svndump_deinit();
scalar_t__ svndump_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ svndump_read(char *, char *, char *);
int /*<<< orphan*/ svndump_reset();
int main(int argc, char **argv) {
  if (svndump_init(NULL))
    return 1;
  svndump_read((argc > 1) ? argv[1] : NULL, "refs/heads/master",
               "refs/notes/svn/revs");
  svndump_deinit();
  svndump_reset();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <svndump_init@plt>
cmp    $0x0,%rax
je     1175 <main+0x35>
movl   $0x1,-0x4(%rbp)
jmp    11c7 <main+0x87>
cmpl   $0x1,-0x8(%rbp)
jle    1190 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    119b <main+0x5b>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    119b <main+0x5b>
mov    -0x18(%rbp),%rdi
lea    0xe5a(%rip),%rsi
lea    0xe65(%rip),%rdx
call   1050 <svndump_read@plt>
mov    $0x0,%al
call   1060 <svndump_deinit@plt>
mov    $0x0,%al
call   1030 <svndump_reset@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %edi,%edi
call   1040 <svndump_init@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    118a <main+0x4a>
xor    %ebx,%ebx
cmp    $0x2,%ebp
jl     1167 <main+0x27>
mov    0x8(%r14),%rdi
jmp    1169 <main+0x29>
xor    %edi,%edi
lea    0xe90(%rip),%rsi
lea    0xe9b(%rip),%rdx
call   1050 <svndump_read@plt>
xor    %eax,%eax
call   1060 <svndump_deinit@plt>
xor    %eax,%eax
call   1030 <svndump_reset@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"refs/heads/master\00"
@.str.1 = [20 x i8] c"refs/notes/svn/revs\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 @svndump_init(i32* null)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %22
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 1
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
br label %17
16: ; preds = %9
br label %17
17: ; preds = %16, %12
%18 = phi i8* [ %15, %12 ], [ null, %16 ]
%19 = call i32 @svndump_read(i8* %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (...) @svndump_deinit()
%21 = call i32 (...) @svndump_reset()
store i32 0, i32* %3
br label %22
22: ; preds = %17, %8
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [18 x i8] c"refs/heads/master\00"
@.str.1 = [20 x i8] c"refs/notes/svn/revs\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @svndump_init(i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = icmp sgt i32 %0, 1
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
br label %10
10: ; preds = %5, %7
%11 = phi i8* [ %9, %7 ], [ null, %5 ]
%12 = tail call i32 @svndump_read(i8* %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 (...) @svndump_deinit()
%14 = tail call i32 (...) @svndump_reset()
br label %15
15: ; preds = %2, %10
%16 = phi i32 [ 0, %10 ], [ 1, %2 ]
ret i32 %16
}