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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int parse_version(char *, struct beeversion *);
int /*<<< orphan*/ stderr;
int parse_argument(char *text, struct beeversion *versionsnummer) {
  int p;
  if ((p = parse_version(text, versionsnummer))) {
    fprintf(stderr, "beeversion: syntax error at position %d in '%s'\n", p,
            text);
    return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<parse_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <parse_version@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1171 <parse_argument+0x51>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xea0(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1178 <parse_argument+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_argument>:
push   %rbx
mov    %rdi,%rbx
call   1040 <parse_version@plt>
test   %eax,%eax
je     114b <parse_argument+0x2b>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%edi
lea    0xec3(%rip),%rsi
mov    %eax,%edx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.beeversion = type { i32 }
@stderr = global i32 0
@.str = [49 x i8] c"beeversion: syntax error at position %d in '%s'\0A\00"
define i32 @parse_argument(i8* %0, %struct.beeversion* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.beeversion*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.beeversion* %1, %struct.beeversion** %5
%7 = load i8*, i8** %4
%8 = load %struct.beeversion*, %struct.beeversion** %5
%9 = call i32 @parse_version(i8* %7, %struct.beeversion* %8)
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %6
%14 = load i8*, i8** %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %13, i8* %14)
store i32 0, i32* %3
br label %17
16: ; preds = %2
store i32 1, i32* %3
br label %17
17: ; preds = %16, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.beeversion = type { i32 }
@stderr = global i32 0
@.str = [49 x i8] c"beeversion: syntax error at position %d in '%s'\0A\00"
define i32 @parse_argument(i8* %0, %struct.beeversion* %1) {
%3 = tail call i32 @parse_version(i8* %0, %struct.beeversion* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %3, i8* %0)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}