#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 atoi(char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char, char);
int getNombreSeconde(char *horaire1, char *horaire2) {
  char *heure1 = malloc(2 * sizeof(char));
  char *heure2 = malloc(2 * sizeof(char));
  char *minute1 = malloc(2 * sizeof(char));
  char *minute2 = malloc(2 * sizeof(char));
  sprintf(heure1, "%c%c", horaire1[0], horaire1[1]);
  sprintf(minute1, "%c%c", horaire1[3], horaire1[4]);
  sprintf(heure2, "%c%c", horaire2[0], horaire2[1]);
  sprintf(minute2, "%c%c", horaire2[3], horaire2[4]);
  int nbSec = (atoi(heure2) * 3600 + atoi(minute2) * 60) -
              (atoi(heure1) * 3600 + atoi(minute1) * 60);
  free(heure1);
  free(minute1);
  free(heure2);
  free(minute2);
  return nbSec;
}


x86 assembly (clang, -O0):
<getNombreSeconde>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xe63(%rip),%rsi
movsbl %cl,%edx
movsbl 0x1(%rax),%ecx
call   1060 <sprintf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xe41(%rip),%rsi
movsbl %cl,%edx
movsbl 0x4(%rax),%ecx
call   1060 <sprintf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xe20(%rip),%rsi
movsbl %cl,%edx
movsbl 0x1(%rax),%ecx
call   1060 <sprintf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xdfe(%rip),%rsi
movsbl %cl,%edx
movsbl 0x4(%rax),%ecx
call   1060 <sprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <atoi@plt>
imul   $0xe10,%eax,%eax
mov    %eax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
imul   $0x3c,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <atoi@plt>
imul   $0xe10,%eax,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <atoi@plt>
mov    -0x3c(%rbp),%ecx
mov    %eax,%edx
mov    -0x38(%rbp),%eax
imul   $0x3c,%edx,%edx
add    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNombreSeconde>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,(%rsp)
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%r13
mov    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%r12
movsbl 0x0(%rbp),%edx
movsbl 0x1(%rbp),%ecx
lea    0xe6b(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <sprintf@plt>
movsbl 0x3(%rbp),%edx
movsbl 0x4(%rbp),%ecx
mov    %r13,%rdi
mov    %r14,%rsi
call   1060 <sprintf@plt>
movsbl (%rbx),%edx
movsbl 0x1(%rbx),%ecx
mov    (%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <sprintf@plt>
movsbl 0x3(%rbx),%edx
movsbl 0x4(%rbx),%ecx
mov    %r12,%rdi
mov    %r14,%rsi
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    %r13,%rdi
call   1050 <atoi@plt>
sub    %eax,%ebp
imul   $0x3c,%ebp,%eax
sub    %r14d,%ebx
imul   $0xe10,%ebx,%ebx
add    %eax,%ebx
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define i32 @getNombreSeconde(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%4 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%5 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%6 = tail call dereferenceable_or_null(2) i8* @malloc(i32 2)
%7 = load i8, i8* %0
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %7, i8 signext %9)
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = load i8, i8* %13
%15 = tail call i32 @sprintf(i8* dereferenceable(1) %5, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %12, i8 signext %14)
%16 = load i8, i8* %1
%17 = getelementptr inbounds i8, i8* %1, i64 1
%18 = load i8, i8* %17
%19 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %16, i8 signext %18)
%20 = getelementptr inbounds i8, i8* %1, i64 3
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %1, i64 4
%23 = load i8, i8* %22
%24 = tail call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %21, i8 signext %23)
%25 = tail call i32 @atoi(i8* %4)
%26 = tail call i32 @atoi(i8* %6)
%27 = tail call i32 @atoi(i8* %3)
%28 = tail call i32 @atoi(i8* %5)
%29 = sub i32 %26, %28
%30 = mul i32 %29, 60
%31 = sub i32 %25, %27
%32 = mul i32 %31, 3600
%33 = add i32 %30, %32
%34 = tail call i32 @free(i8* %3)
%35 = tail call i32 @free(i8* %5)
%36 = tail call i32 @free(i8* %4)
%37 = tail call i32 @free(i8* %6)
ret i32 %33
}