#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ Var_exists(char const *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, float);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, int *, float *);
int /*<<< orphan*/ remove(char *);
scalar_t__ strcmp(char *, char const *);
int Var_remove(const char *name1) {
  if (Var_exists(name1)) {
    FILE *f1 = fopen("values.tmp", "r");
    FILE *wpp = fopen("wpp", "w+");
    float value = 0;
    int type = 0;
    char name[30];
    while (!feof(f1)) {
      fscanf(f1, "%s %d %f\n", name, &type, &value);
      if (strcmp(name, name1) != 0)
        fprintf(wpp, "%s %d %f\n", name, type, value);
    }
    fclose(f1);
    fclose(wpp);
    f1 = fopen("values.tmp", "w+");
    wpp = fopen("wpp", "r");
    while (!feof(wpp)) {
      fscanf(wpp, "%s %d %f\n", name, &type, &value);
      fprintf(f1, "%s %d %f\n", name, type, value);
    }
    fclose(f1);
    fclose(wpp);
    remove("wpp");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Var_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <Var_exists@plt>
cmp    $0x0,%rax
je     1313 <Var_remove+0x193>
lea    0xe5a(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe50(%rip),%rdi
lea    0xe4d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11fa <Var_remove+0x7a>
jmp    124e <Var_remove+0xce>
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe0b(%rip),%rsi
lea    -0x28(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1050 <fscanf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
je     1249 <Var_remove+0xc9>
mov    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rdx
mov    -0x28(%rbp),%ecx
movss  -0x24(%rbp),%xmm0
lea    0xdd0(%rip),%rsi
call   1070 <fprintf@plt>
jmp    11dc <Var_remove+0x5c>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd99(%rip),%rdi
lea    0xda3(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xd8f(%rip),%rdi
lea    0xd86(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    12ac <Var_remove+0x12c>
jmp    12e9 <Var_remove+0x169>
mov    -0x20(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xd59(%rip),%rsi
lea    -0x28(%rbp),%rcx
lea    -0x24(%rbp),%r8
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rdx
mov    -0x28(%rbp),%ecx
movss  -0x24(%rbp),%xmm0
lea    0xd35(%rip),%rsi
call   1070 <fprintf@plt>
jmp    128e <Var_remove+0x10e>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd0b(%rip),%rdi
call   1030 <remove@plt>
movl   $0x1,-0x4(%rbp)
jmp    131a <Var_remove+0x19a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Var_remove>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%r14
call   1090 <Var_exists@plt>
test   %rax,%rax
je     12ab <Var_remove+0x12b>
lea    0xe5a(%rip),%rdi
lea    0xe5e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xe51(%rip),%rdi
lea    0xe4e(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r15
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     12bc <Var_remove+0x13c>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
lea    0xdfe(%rip),%rdi
lea    0xe08(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r14
lea    0xdf5(%rip),%rdi
lea    0xdec(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1288 <Var_remove+0x108>
lea    0xdda(%rip),%r15
lea    0x10(%rsp),%rbp
lea    0x8(%rsp),%r12
lea    0xc(%rsp),%r13
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12,%rcx
mov    %r13,%r8
call   1050 <fscanf@plt>
mov    0x8(%rsp),%ecx
movss  0xc(%rsp),%xmm0
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
je     1250 <Var_remove+0xd0>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
lea    0xd6e(%rip),%rdi
call   1030 <remove@plt>
mov    $0x1,%eax
jmp    12ad <Var_remove+0x12d>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd51(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbp
jmp    12e0 <Var_remove+0x160>
nop
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    11eb <Var_remove+0x6b>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
lea    0x8(%rsp),%rcx
mov    %rbp,%r8
call   1050 <fscanf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12d0 <Var_remove+0x150>
mov    0x8(%rsp),%ecx
movss  0xc(%rsp),%xmm0
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1070 <fprintf@plt>
jmp    12d0 <Var_remove+0x150>

LLVM IR (-O0):
@.str = [11 x i8] c"values.tmp\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"wpp\00"
@.str.3 = [3 x i8] c"w+\00"
@.str.4 = [10 x i8] c"%s %d %f\0A\00"
define i32 @Var_remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca float
%7 = alloca i32
%8 = alloca [30 x i8]
store i8* %0, i8** %3
%9 = load i8*, i8** %3
%10 = call i64 @Var_exists(i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %62
12: ; preds = %1
%13 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %4
%14 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %14, i32** %5
store float 0.000000e+00, float* %6
store i32 0, i32* %7
br label %15
15: ; preds = %34, %12
%16 = load i32*, i32** %4
%17 = call i32 @feof(i32* %16)
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
br i1 %19, label %20, label %35
20: ; preds = %15
%21 = load i32*, i32** %4
%22 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%23 = call i32 @fscanf(i32* %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %22, i32* %7, float* %6)
%24 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%25 = load i8*, i8** %3
%26 = call i64 @strcmp(i8* %24, i8* %25)
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %20
%29 = load i32*, i32** %5
%30 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%31 = load i32, i32* %7
%32 = load float, float* %6
%33 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %30, i32 %31, float %32)
br label %34
34: ; preds = %28, %20
br label %15
35: ; preds = %15
%36 = load i32*, i32** %4
%37 = call i32 @fclose(i32* %36)
%38 = load i32*, i32** %5
%39 = call i32 @fclose(i32* %38)
%40 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %40, i32** %4
%41 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %41, i32** %5
br label %42
42: ; preds = %47, %35
%43 = load i32*, i32** %5
%44 = call i32 @feof(i32* %43)
%45 = icmp ne i32 %44, 0
%46 = xor i1 %45, true
br i1 %46, label %47, label %56
47: ; preds = %42
%48 = load i32*, i32** %5
%49 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%50 = call i32 @fscanf(i32* %48, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %49, i32* %7, float* %6)
%51 = load i32*, i32** %4
%52 = getelementptr inbounds [30 x i8], [30 x i8]* %8, i64 0, i64 0
%53 = load i32, i32* %7
%54 = load float, float* %6
%55 = call i32 @fprintf(i32* %51, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %52, i32 %53, float %54)
br label %42
56: ; preds = %42
%57 = load i32*, i32** %4
%58 = call i32 @fclose(i32* %57)
%59 = load i32*, i32** %5
%60 = call i32 @fclose(i32* %59)
%61 = call i32 @remove(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %63
62: ; preds = %1
store i32 0, i32* %2
br label %63
63: ; preds = %62, %56
%64 = load i32, i32* %2
ret i32 %64
}

LLVM IR (-O2):
@.str = [11 x i8] c"values.tmp\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"wpp\00"
@.str.3 = [3 x i8] c"w+\00"
@.str.4 = [10 x i8] c"%s %d %f\0A\00"
define i32 @Var_remove(i8* %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca [30 x i8]
%5 = tail call i64 @Var_exists(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %44, label %7
7: ; preds = %1
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%10 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%11 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%13 = call i32 @feof(i32* %8)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %7, %23
%16 = call i32 @fscanf(i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %12, i32* %3, float* %2)
%17 = call i64 @strcmp(i8* %12, i8* %0)
%18 = icmp eq i64 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i32, i32* %3
%21 = load float, float* %2
%22 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %12, i32 %20, float %21)
br label %23
23: ; preds = %19, %15
%24 = call i32 @feof(i32* %8)
%25 = icmp eq i32 %24, 0
br i1 %25, label %15, label %26
26: ; preds = %23, %7
%27 = call i32 @fclose(i32* %8)
%28 = call i32 @fclose(i32* %9)
%29 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%30 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%31 = call i32 @feof(i32* %30)
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %40
33: ; preds = %26, %33
%34 = call i32 @fscanf(i32* %30, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %12, i32* %3, float* %2)
%35 = load i32, i32* %3
%36 = load float, float* %2
%37 = call i32 @fprintf(i32* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %12, i32 %35, float %36)
%38 = call i32 @feof(i32* %30)
%39 = icmp eq i32 %38, 0
br i1 %39, label %33, label %40
40: ; preds = %33, %26
%41 = call i32 @fclose(i32* %29)
%42 = call i32 @fclose(i32* %30)
%43 = call i32 @remove(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %1, %40
%45 = phi i32 [ 1, %40 ], [ 0, %1 ]
ret i32 %45
}