#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*/ memcmp(char *, char *, int);
unsigned fix_60_problem(char *buff) {
  unsigned rval = 0;
  if (!memcmp(buff + 22, "60.0000", 7)) {
    buff[16] = buff[0];
    buff[17] = buff[1];
    buff[19] = buff[2];
    buff[20] = buff[3];
    buff[22] = ' ';
    buff[23] = buff[5];
    rval++;
  }
  if (!memcmp(buff + 37, "60.000", 6)) {
    buff[31] = buff[9];
    buff[32] = buff[10];
    buff[34] = buff[11];
    buff[35] = buff[12];
    buff[37] = ' ';
    buff[38] = buff[14];
    rval++;
  }
  return (rval);
}


x86 assembly (clang, -O0):
<fix_60_problem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x16,%rdi
lea    0xece(%rip),%rsi
mov    $0x7,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    119b <fix_60_problem+0x8b>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x10(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x11(%rax)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x13(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x14(%rax)
mov    -0x8(%rbp),%rax
movb   $0x20,0x16(%rax)
mov    -0x8(%rbp),%rax
mov    0x5(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x17(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x25,%rdi
lea    0xe5e(%rip),%rsi
mov    $0x6,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
jne    1214 <fix_60_problem+0x104>
mov    -0x8(%rbp),%rax
mov    0x9(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1f(%rax)
mov    -0x8(%rbp),%rax
mov    0xa(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x20(%rax)
mov    -0x8(%rbp),%rax
mov    0xb(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x22(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x23(%rax)
mov    -0x8(%rbp),%rax
movb   $0x20,0x25(%rax)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x26(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_60_problem>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x16,%rdi
lea    0xedf(%rip),%rsi
mov    $0x7,%edx
call   1030 <memcmp@plt>
xor    %ebp,%ebp
test   %eax,%eax
jne    114f <fix_60_problem+0x3f>
movzwl (%rbx),%eax
movzwl 0x2(%rbx),%ecx
mov    %ax,0x10(%rbx)
mov    %cx,0x13(%rbx)
movb   $0x20,0x16(%rbx)
mov    0x5(%rbx),%al
mov    %al,0x17(%rbx)
mov    $0x1,%ebp
lea    0x25(%rbx),%rdi
lea    0xeae(%rip),%rsi
mov    $0x6,%edx
call   1030 <memcmp@plt>
test   %eax,%eax
jne    1185 <fix_60_problem+0x75>
movzwl 0x9(%rbx),%eax
movzwl 0xb(%rbx),%ecx
mov    %ax,0x1f(%rbx)
mov    %cx,0x22(%rbx)
movb   $0x20,0x25(%rbx)
mov    0xe(%rbx),%al
mov    %al,0x26(%rbx)
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"60.0000\00"
@.str.1 = [7 x i8] c"60.000\00"
define i32 @fix_60_problem(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 22
%6 = call i32 @memcmp(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%7 = icmp ne i32 %6, 0
br i1 %7, label %38, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 16
store i8 %11, i8* %13
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8, i8* %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i64 17
store i8 %16, i8* %18
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 19
store i8 %21, i8* %23
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 20
store i8 %26, i8* %28
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i64 22
store i8 32, i8* %30
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 5
%33 = load i8, i8* %32
%34 = load i8*, i8** %2
%35 = getelementptr inbounds i8, i8* %34, i64 23
store i8 %33, i8* %35
%36 = load i32, i32* %3
%37 = add i32 %36, 1
store i32 %37, i32* %3
br label %38
38: ; preds = %8, %1
%39 = load i8*, i8** %2
%40 = getelementptr inbounds i8, i8* %39, i64 37
%41 = call i32 @memcmp(i8* %40, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%42 = icmp ne i32 %41, 0
br i1 %42, label %73, label %43
43: ; preds = %38
%44 = load i8*, i8** %2
%45 = getelementptr inbounds i8, i8* %44, i64 9
%46 = load i8, i8* %45
%47 = load i8*, i8** %2
%48 = getelementptr inbounds i8, i8* %47, i64 31
store i8 %46, i8* %48
%49 = load i8*, i8** %2
%50 = getelementptr inbounds i8, i8* %49, i64 10
%51 = load i8, i8* %50
%52 = load i8*, i8** %2
%53 = getelementptr inbounds i8, i8* %52, i64 32
store i8 %51, i8* %53
%54 = load i8*, i8** %2
%55 = getelementptr inbounds i8, i8* %54, i64 11
%56 = load i8, i8* %55
%57 = load i8*, i8** %2
%58 = getelementptr inbounds i8, i8* %57, i64 34
store i8 %56, i8* %58
%59 = load i8*, i8** %2
%60 = getelementptr inbounds i8, i8* %59, i64 12
%61 = load i8, i8* %60
%62 = load i8*, i8** %2
%63 = getelementptr inbounds i8, i8* %62, i64 35
store i8 %61, i8* %63
%64 = load i8*, i8** %2
%65 = getelementptr inbounds i8, i8* %64, i64 37
store i8 32, i8* %65
%66 = load i8*, i8** %2
%67 = getelementptr inbounds i8, i8* %66, i64 14
%68 = load i8, i8* %67
%69 = load i8*, i8** %2
%70 = getelementptr inbounds i8, i8* %69, i64 38
store i8 %68, i8* %70
%71 = load i32, i32* %3
%72 = add i32 %71, 1
store i32 %72, i32* %3
br label %73
73: ; preds = %43, %38
%74 = load i32, i32* %3
ret i32 %74
}

LLVM IR (-O2):
@.str = [8 x i8] c"60.0000\00"
@.str.1 = [7 x i8] c"60.000\00"
define i32 @fix_60_problem(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 22
%3 = tail call i32 @memcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %20
5: ; preds = %1
%6 = load i8, i8* %0
%7 = getelementptr inbounds i8, i8* %0, i64 16
store i8 %6, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 17
store i8 %9, i8* %10
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 19
store i8 %12, i8* %13
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %0, i64 20
store i8 %15, i8* %16
store i8 32, i8* %2
%17 = getelementptr inbounds i8, i8* %0, i64 5
%18 = load i8, i8* %17
%19 = getelementptr inbounds i8, i8* %0, i64 23
store i8 %18, i8* %19
br label %20
20: ; preds = %5, %1
%21 = phi i32 [ 0, %1 ], [ 1, %5 ]
%22 = getelementptr inbounds i8, i8* %0, i64 37
%23 = tail call i32 @memcmp(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %42
25: ; preds = %20
%26 = getelementptr inbounds i8, i8* %0, i64 9
%27 = load i8, i8* %26
%28 = getelementptr inbounds i8, i8* %0, i64 31
store i8 %27, i8* %28
%29 = getelementptr inbounds i8, i8* %0, i64 10
%30 = load i8, i8* %29
%31 = getelementptr inbounds i8, i8* %0, i64 32
store i8 %30, i8* %31
%32 = getelementptr inbounds i8, i8* %0, i64 11
%33 = load i8, i8* %32
%34 = getelementptr inbounds i8, i8* %0, i64 34
store i8 %33, i8* %34
%35 = getelementptr inbounds i8, i8* %0, i64 12
%36 = load i8, i8* %35
%37 = getelementptr inbounds i8, i8* %0, i64 35
store i8 %36, i8* %37
store i8 32, i8* %22
%38 = getelementptr inbounds i8, i8* %0, i64 14
%39 = load i8, i8* %38
%40 = getelementptr inbounds i8, i8* %0, i64 38
store i8 %39, i8* %40
%41 = add nuw nsw i32 %21, 1
br label %42
42: ; preds = %25, %20
%43 = phi i32 [ %21, %20 ], [ %41, %25 ]
ret i32 %43
}