#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 */
float abs(float);
int /*<<< orphan*/ getid(float);
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(float);
float sin(float);
void main() {
  float step, eps, y, x1, s1, x2, s2, x;
  getid(x1);
  printid(x1);
  getid(x2);
  printid(x2);
  eps = 1e-4;
  step = 0.5;
  do {
    x = x1;
    s1 = 0;
    do {
      x += step;
      s1 += sin(x) * step;
    } while (x < x2);
    printid(s1);
    x = x1;
    step /= 5;
    s2 = 0;
    do {
      x += step;
      s2 += sin(x) * step;
    } while (x < x2);
    step /= 5;
    printid(s2);
    printid(step);
  } while (abs(s2 - s1) > eps);
  print("Ответ");
  printid(s2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  -0x10(%rbp),%xmm0
call   1040 <getid@plt>
movss  -0x10(%rbp),%xmm0
call   1070 <printid@plt>
movss  -0x18(%rbp),%xmm0
call   1040 <getid@plt>
movss  -0x18(%rbp),%xmm0
call   1070 <printid@plt>
movss  0xe7c(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe6b(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x4(%rbp),%xmm2
movss  -0x14(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     11ac <main+0x5c>
movss  -0x14(%rbp),%xmm0
call   1070 <printid@plt>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xdf8(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <sin@plt>
movss  -0x4(%rbp),%xmm2
movss  -0x1c(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x20(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
ja     1221 <main+0xd1>
movss  -0x4(%rbp),%xmm0
movss  0xd97(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x1c(%rbp),%xmm0
call   1070 <printid@plt>
movss  -0x4(%rbp),%xmm0
call   1070 <printid@plt>
movss  -0x1c(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
call   1030 <abs@plt>
ucomiss -0x8(%rbp),%xmm0
ja     119a <main+0x4a>
lea    0xd5e(%rip),%rdi
call   1050 <print@plt>
movss  -0x1c(%rbp),%xmm0
call   1070 <printid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
call   1040 <getid@plt>
call   1070 <printid@plt>
call   1040 <getid@plt>
call   1070 <printid@plt>
movss  0xe90(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
cs nopw 0x0(%rax,%rax,1)
movss  0xe7c(%rip),%xmm0
call   1060 <sin@plt>
mulss  0xc(%rsp),%xmm0
xorps  %xmm1,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,0x14(%rsp)
call   1070 <printid@plt>
movss  0xe5b(%rip),%xmm1
movss  0xc(%rsp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
movss  0xe3f(%rip),%xmm0
call   1060 <sin@plt>
movss  0xc(%rsp),%xmm1
mulss  %xmm1,%xmm0
addss  0xe34(%rip),%xmm0
movss  %xmm0,0x10(%rsp)
divss  0xe1e(%rip),%xmm1
movss  %xmm1,0xc(%rsp)
call   1070 <printid@plt>
movss  0xc(%rsp),%xmm0
call   1070 <printid@plt>
movss  0x10(%rsp),%xmm0
subss  0x14(%rsp),%xmm0
call   1030 <abs@plt>
ucomiss 0xdf4(%rip),%xmm0
ja     1180 <main+0x30>
lea    0xdef(%rip),%rdi
call   1050 <print@plt>
movss  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1070 <printid@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\D0\9E\D1\82\D0\B2\D0\B5\D1\82\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = load float, float* %4
%10 = call i32 @getid(float %9)
%11 = load float, float* %4
%12 = call i32 @printid(float %11)
%13 = load float, float* %6
%14 = call i32 @getid(float %13)
%15 = load float, float* %6
%16 = call i32 @printid(float %15)
store float 0x3F1A36E2E0000000, float* %2
store float 5.000000e-01, float* %1
br label %17
17: ; preds = %58, %0
%18 = load float, float* %4
store float %18, float* %8
store float 0.000000e+00, float* %5
br label %19
19: ; preds = %28, %17
%20 = load float, float* %1
%21 = load float, float* %8
%22 = fadd float %21, %20
store float %22, float* %8
%23 = load float, float* %8
%24 = call float @sin(float %23)
%25 = load float, float* %1
%26 = load float, float* %5
%27 = call float @llvm.fmuladd.f32(float %24, float %25, float %26)
store float %27, float* %5
br label %28
28: ; preds = %19
%29 = load float, float* %8
%30 = load float, float* %6
%31 = fcmp olt float %29, %30
br i1 %31, label %19, label %32
32: ; preds = %28
%33 = load float, float* %5
%34 = call i32 @printid(float %33)
%35 = load float, float* %4
store float %35, float* %8
%36 = load float, float* %1
%37 = fdiv float %36, 5.000000e+00
store float %37, float* %1
store float 0.000000e+00, float* %7
br label %38
38: ; preds = %47, %32
%39 = load float, float* %1
%40 = load float, float* %8
%41 = fadd float %40, %39
store float %41, float* %8
%42 = load float, float* %8
%43 = call float @sin(float %42)
%44 = load float, float* %1
%45 = load float, float* %7
%46 = call float @llvm.fmuladd.f32(float %43, float %44, float %45)
store float %46, float* %7
br label %47
47: ; preds = %38
%48 = load float, float* %8
%49 = load float, float* %6
%50 = fcmp olt float %48, %49
br i1 %50, label %38, label %51
51: ; preds = %47
%52 = load float, float* %1
%53 = fdiv float %52, 5.000000e+00
store float %53, float* %1
%54 = load float, float* %7
%55 = call i32 @printid(float %54)
%56 = load float, float* %1
%57 = call i32 @printid(float %56)
br label %58
58: ; preds = %51
%59 = load float, float* %7
%60 = load float, float* %5
%61 = fsub float %59, %60
%62 = call float @abs(float %61)
%63 = load float, float* %2
%64 = fcmp ogt float %62, %63
br i1 %64, label %17, label %65
65: ; preds = %58
%66 = call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%67 = load float, float* %7
%68 = call i32 @printid(float %67)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\D0\9E\D1\82\D0\B2\D0\B5\D1\82\00"
define void @main() {
%1 = tail call i32 @getid(float undef)
%2 = tail call i32 @printid(float undef)
%3 = tail call i32 @getid(float undef)
%4 = tail call i32 @printid(float undef)
br label %5
5: ; preds = %5, %0
%6 = phi float [ 5.000000e-01, %0 ], [ %13, %5 ]
%7 = tail call float @sin(float 0x7FF8000000000000)
%8 = tail call float @llvm.fmuladd.f32(float %7, float %6, float 0.000000e+00)
%9 = tail call i32 @printid(float %8)
%10 = fdiv float %6, 5.000000e+00
%11 = tail call float @sin(float 0x7FF8000000000000)
%12 = tail call float @llvm.fmuladd.f32(float %11, float %10, float 0.000000e+00)
%13 = fdiv float %10, 5.000000e+00
%14 = tail call i32 @printid(float %12)
%15 = tail call i32 @printid(float %13)
%16 = fsub float %12, %8
%17 = tail call float @abs(float %16)
%18 = fcmp ogt float %17, 0x3F1A36E2E0000000
br i1 %18, label %5, label %19
19: ; preds = %5
%20 = tail call i32 @print(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @printid(float %12)
ret void
}