#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 check_value_exist(double *, int *, double);
int /*<<< orphan*/ printf(char *, ...);
void TEST_check_value_exist() {
  int size_atributes = 2;
  double atributes[4] = {0.0, 0.5};
  printf("return:%d, size_atributes:%d\n",
         check_value_exist(atributes, &size_atributes, 0.5), size_atributes);
  printf("return:%d, ", check_value_exist(atributes, &size_atributes, 1.0));
  printf("size_atributes:%d\n", size_atributes);
  printf("ok TEST_check_value_exist\n\n");
}


x86 assembly (clang, -O0):
<TEST_check_value_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x2,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x4(%rbp),%rsi
movsd  0xe9d(%rip),%xmm0
call   1040 <check_value_exist@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x4(%rbp),%rsi
movsd  0xe6d(%rip),%xmm0
call   1040 <check_value_exist@plt>
mov    %eax,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEST_check_value_exist>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movl   $0x2,0xc(%rsp)
movaps 0xeda(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%r14
movsd  0xe97(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <check_value_exist@plt>
mov    0xc(%rsp),%edx
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe78(%rip),%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <check_value_exist@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xe85(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.TEST_check_value_exist.atributes = [4 x double] [double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00]
@.str = [30 x i8] c"return:%d, size_atributes:%d\0A\00"
@.str.1 = [12 x i8] c"return:%d, \00"
@.str.2 = [19 x i8] c"size_atributes:%d\0A\00"
@.str.3 = [28 x i8] c"ok TEST_check_value_exist\0A\0A\00"
define void @TEST_check_value_exist() {
%1 = alloca i32
%2 = alloca [4 x double]
store i32 2, i32* %1
%3 = bitcast [4 x double]* %2 to i8*
%4 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%5 = call i32 @check_value_exist(double* %4, i32* %1, double 5.000000e-01)
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%9 = call i32 @check_value_exist(double* %8, i32* %1, double 1.000000e+00)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__const.TEST_check_value_exist.atributes = [4 x double] [double 0.000000e+00, double 5.000000e-01, double 0.000000e+00, double 0.000000e+00]
@.str = [30 x i8] c"return:%d, size_atributes:%d\0A\00"
@.str.1 = [12 x i8] c"return:%d, \00"
@.str.2 = [19 x i8] c"size_atributes:%d\0A\00"
@str = [27 x i8] c"ok TEST_check_value_exist\0A\00"
define void @TEST_check_value_exist() {
%1 = alloca i32
%2 = alloca [4 x double]
%3 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%4 = bitcast [4 x double]* %2 to i8*
%5 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%6 = call i32 @check_value_exist(double* %5, i32* %1, double 5.000000e-01)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = call i32 @check_value_exist(double* %5, i32* %1, double 1.000000e+00)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}