#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*/ padding(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char const *);
void unit_test_int(const char *msg, long long attendu, long long obtenu) {
  int len = strlen(msg);
  printf("%s", msg);
  if (attendu == obtenu) {
    padding(80 - len - 4);
    printf("[OK]\n");
  } else {
    padding(80 - len - 7);
    printf("[ERROR]\n");
    printf("Attendu : %ld, Obtenu : %ld\n", attendu, obtenu);
  }
}


x86 assembly (clang, -O0):
<unit_test_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1193 <unit_test_int+0x63>
mov    $0x50,%edi
sub    -0x1c(%rbp),%edi
sub    $0x4,%edi
call   1050 <padding@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11c7 <unit_test_int+0x97>
mov    $0x50,%edi
sub    -0x1c(%rbp),%edi
sub    $0x7,%edi
call   1050 <padding@plt>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unit_test_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%r15
jne    118f <unit_test_int+0x4f>
mov    $0x4c,%edi
sub    %ebp,%edi
call   1060 <padding@plt>
lea    0xea8(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>
mov    $0x49,%edi
sub    %ebp,%edi
call   1060 <padding@plt>
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe55(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"[OK]\0A\00"
@.str.2 = [9 x i8] c"[ERROR]\0A\00"
@.str.3 = [29 x i8] c"Attendu : %ld, Obtenu : %ld\0A\00"
define void @unit_test_int(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i64, i64* %5
%13 = load i64, i64* %6
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load i32, i32* %7
%17 = sub nsw i32 80, %16
%18 = sub nsw i32 %17, 4
%19 = call i32 @padding(i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %30
21: ; preds = %3
%22 = load i32, i32* %7
%23 = sub nsw i32 80, %22
%24 = sub nsw i32 %23, 7
%25 = call i32 @padding(i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%27 = load i64, i64* %5
%28 = load i64, i64* %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i64 %27, i64 %28)
br label %30
30: ; preds = %21, %15
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.3 = [29 x i8] c"Attendu : %ld, Obtenu : %ld\0A\00"
@str = [8 x i8] c"[ERROR]\00"
@str.4 = [5 x i8] c"[OK]\00"
define void @unit_test_int(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = icmp eq i64 %1, %2
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = sub i32 76, %4
%9 = tail call i32 @padding(i32 %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.4, i64 0, i64 0))
br label %16
11: ; preds = %3
%12 = sub i32 73, %4
%13 = tail call i32 @padding(i32 %12)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i64 %1, i64 %2)
br label %16
16: ; preds = %11, %7
ret void
}