#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 */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int, ...);
int sscanf(char *, char *, int *, int *, int *, int *, int *);
char *point() {
  int major1, major2, major3, major4, minor;
  char *version_string;
  version_string = (char *)malloc(12);
  if (sscanf("1499-6", "%c%c%c%c-%d", &major1, &major2, &major3, &major4,
             &minor) > 4) {
    sprintf(version_string, "%c%c.%c%c.%d.0", major1, major2, major3, major4,
            minor);
  } else {
    sprintf(version_string, "%c%c.%c%c.0.0", major1, major2, major3, major4);
  }
  return version_string;
}


x86 assembly (clang, -O0):
<point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeb3(%rip),%rsi
lea    -0x4(%rbp),%rdx
lea    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%r8
lea    -0x10(%rbp),%r9
lea    -0x14(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <sscanf@plt>
cmp    $0x4,%eax
jle    11a5 <point+0x75>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%eax
lea    0xe7d(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    11c5 <point+0x95>
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xe64(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<point>:
push   %rbx
sub    $0x20,%rsp
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rax
mov    %rax,(%rsp)
lea    0xeae(%rip),%rdi
lea    0xeae(%rip),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x14(%rsp),%r8
lea    0x10(%rsp),%r9
call   1040 <sscanf@plt>
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    0x10(%rsp),%r9d
cmp    $0x5,%eax
jl     1199 <point+0x69>
mov    0xc(%rsp),%eax
mov    %eax,(%rsp)
lea    0xe7c(%rip),%rsi
jmp    11a0 <point+0x70>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"1499-6\00"
@.str.1 = [12 x i8] c"%c%c%c%c-%d\00"
@.str.2 = [15 x i8] c"%c%c.%c%c.%d.0\00"
@.str.3 = [14 x i8] c"%c%c.%c%c.0.0\00"
define i8* @point() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = call i64 @malloc(i32 12)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = call i32 @sscanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
%10 = icmp sgt i32 %9, 4
br i1 %10, label %11, label %19
11: ; preds = %0
%12 = load i8*, i8** %6
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 (i8*, i8*, i32, i32, i32, i32, ...) @sprintf(i8* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14, i32 %15, i32 %16, i32 %17)
br label %26
19: ; preds = %0
%20 = load i8*, i8** %6
%21 = load i32, i32* %1
%22 = load i32, i32* %2
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 (i8*, i8*, i32, i32, i32, i32, ...) @sprintf(i8* %20, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %21, i32 %22, i32 %23, i32 %24)
br label %26
26: ; preds = %19, %11
%27 = load i8*, i8** %6
ret i8* %27
}

LLVM IR (-O2):
@.str = [7 x i8] c"1499-6\00"
@.str.1 = [12 x i8] c"%c%c%c%c-%d\00"
@.str.2 = [15 x i8] c"%c%c.%c%c.%d.0\00"
@.str.3 = [14 x i8] c"%c%c.%c%c.0.0\00"
define i8* @point() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = tail call i64 @malloc(i32 12)
%12 = inttoptr i64 %11 to i8*
%13 = call i32 @sscanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4, i32* %5)
%14 = icmp sgt i32 %13, 4
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
br i1 %14, label %19, label %22
19: ; preds = %0
%20 = load i32, i32* %5
%21 = call i32 (i8*, i8*, i32, i32, i32, i32, ...) @sprintf(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %20)
br label %24
22: ; preds = %0
%23 = call i32 (i8*, i8*, i32, i32, i32, i32, ...) @sprintf(i8* dereferenceable(1) %12, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18)
br label %24
24: ; preds = %22, %19
ret i8* %12
}