#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*/ EINVAL;
int /*<<< orphan*/ ERANGE;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mx_strtominutes(char *, unsigned long long *);
void test_mx_strtominutes(void) {
  unsigned long long int l;
  assert(mx_strtominutes("123s", &l) == 0);
  assert(l == 2);
  assert(mx_strtominutes("20d", &l) == 0);
  assert(l == 20 * 24 * 60);
  assert(mx_strtominutes("-1", &l) == -ERANGE);
  assert(mx_strtominutes(" -1", &l) == -ERANGE);
  assert(mx_strtominutes("123", &l) == -EINVAL);
  assert(mx_strtominutes("0123", &l) == -EINVAL);
  assert(mx_strtominutes("1.2", &l) == -EINVAL);
  assert(mx_strtominutes("1,2", &l) == -EINVAL);
  assert(mx_strtominutes("test", &l) == -EINVAL);
}


x86 assembly (clang, -O0):
<test_mx_strtominutes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpq   $0x7080,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe74(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2e40(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe49(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2e16(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe24(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2ddc(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdf9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2db2(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdd4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2d88(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xdae(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2d5e(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xd88(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <mx_strtominutes@plt>
xor    %ecx,%ecx
mov    0x2d34(%rip),%rdx
sub    (%rdx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mx_strtominutes>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpq   $0x2,(%rsp)
sete   %dil
call   1040 <assert@plt>
lea    0xeab(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
xor    %edi,%edi
cmpq   $0x7080,(%rsp)
sete   %dil
call   1040 <assert@plt>
lea    0xe81(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
mov    0x2e50(%rip),%rbx
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe5d(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe46(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
mov    0x2e01(%rip),%rbx
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe22(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xe0b(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xdf3(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
lea    0xddb(%rip),%rdi
mov    %r14,%rsi
call   1030 <mx_strtominutes@plt>
xor    %edi,%edi
add    (%rbx),%eax
sete   %dil
call   1040 <assert@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"123s\00"
@.str.1 = [4 x i8] c"20d\00"
@.str.2 = [3 x i8] c"-1\00"
@ERANGE = global i32 0
@.str.3 = [4 x i8] c" -1\00"
@.str.4 = [4 x i8] c"123\00"
@EINVAL = global i32 0
@.str.5 = [5 x i8] c"0123\00"
@.str.6 = [4 x i8] c"1.2\00"
@.str.7 = [4 x i8] c"1,2\00"
@.str.8 = [5 x i8] c"test\00"
define void @test_mx_strtominutes() {
%1 = alloca i64
%2 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = load i64, i64* %1
%7 = icmp eq i64 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i64, i64* %1
%15 = icmp eq i64 %14, 28800
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%19 = load i32, i32* @ERANGE
%20 = sub nsw i32 0, %19
%21 = icmp eq i32 %18, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64* %1)
%25 = load i32, i32* @ERANGE
%26 = sub nsw i32 0, %25
%27 = icmp eq i32 %24, %26
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %1)
%31 = load i32, i32* @EINVAL
%32 = sub nsw i32 0, %31
%33 = icmp eq i32 %30, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64* %1)
%37 = load i32, i32* @EINVAL
%38 = sub nsw i32 0, %37
%39 = icmp eq i32 %36, %38
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i64* %1)
%43 = load i32, i32* @EINVAL
%44 = sub nsw i32 0, %43
%45 = icmp eq i32 %42, %44
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64* %1)
%49 = load i32, i32* @EINVAL
%50 = sub nsw i32 0, %49
%51 = icmp eq i32 %48, %50
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64* %1)
%55 = load i32, i32* @EINVAL
%56 = sub nsw i32 0, %55
%57 = icmp eq i32 %54, %56
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"123s\00"
@.str.1 = [4 x i8] c"20d\00"
@.str.2 = [3 x i8] c"-1\00"
@ERANGE = global i32 0
@.str.3 = [4 x i8] c" -1\00"
@.str.4 = [4 x i8] c"123\00"
@EINVAL = global i32 0
@.str.5 = [5 x i8] c"0123\00"
@.str.6 = [4 x i8] c"1.2\00"
@.str.7 = [4 x i8] c"1,2\00"
@.str.8 = [5 x i8] c"test\00"
define void @test_mx_strtominutes() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* %1
%8 = icmp eq i64 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %1
%16 = icmp eq i64 %15, 28800
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64* %1)
%20 = load i32, i32* @ERANGE
%21 = sub nsw i32 0, %20
%22 = icmp eq i32 %19, %21
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64* %1)
%26 = load i32, i32* @ERANGE
%27 = sub nsw i32 0, %26
%28 = icmp eq i32 %25, %27
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64* %1)
%32 = load i32, i32* @EINVAL
%33 = sub nsw i32 0, %32
%34 = icmp eq i32 %31, %33
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64* %1)
%38 = load i32, i32* @EINVAL
%39 = sub nsw i32 0, %38
%40 = icmp eq i32 %37, %39
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i64* %1)
%44 = load i32, i32* @EINVAL
%45 = sub nsw i32 0, %44
%46 = icmp eq i32 %43, %45
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i64* %1)
%50 = load i32, i32* @EINVAL
%51 = sub nsw i32 0, %50
%52 = icmp eq i32 %49, %51
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 @mx_strtominutes(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64* %1)
%56 = load i32, i32* @EINVAL
%57 = sub nsw i32 0, %56
%58 = icmp eq i32 %55, %57
%59 = zext i1 %58 to i32
%60 = call i32 @assert(i32 %59)
ret void
}