void set_quality(int quantizer[], int quality) {
  int i;
  for (i = 0; i < 64; i++)
    quantizer[i] = (((((((((100 - quality) / 50.0 * quantizer[i])) > ((1)))
                            ? (((100 - quality) / 50.0 * quantizer[i]))
                            : ((1))))) < ((255)))
                        ? (((((((100 - quality) / 50.0 * quantizer[i])) > ((1)))
                                 ? (((100 - quality) / 50.0 * quantizer[i]))
                                 : ((1)))))
                        : ((255)));
}


x86 assembly (clang, -O0):
<set_quality>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    1276 <set_quality+0x176>
mov    $0x64,%eax
sub    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118a <set_quality+0x8a>
mov    $0x64,%eax
sub    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe9d(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    119c <set_quality+0x9c>
movsd  0xe6e(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    119c <set_quality+0x9c>
movsd  -0x18(%rbp),%xmm1
movsd  0xe67(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1242 <set_quality+0x142>
mov    $0x64,%eax
sub    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe41(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1c(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1221 <set_quality+0x121>
mov    $0x64,%eax
sub    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xe06(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1233 <set_quality+0x133>
movsd  0xdd7(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    1233 <set_quality+0x133>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1254 <set_quality+0x154>
movsd  0xdc6(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    1254 <set_quality+0x154>
movsd  -0x28(%rbp),%xmm0
cvttsd2si %xmm0,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <set_quality+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_quality>:
mov    $0x64,%eax
sub    %esi,%eax
cvtsi2sd %eax,%xmm8
divsd  0xeeb(%rip),%xmm8
unpcklpd %xmm8,%xmm8
xor    %eax,%eax
movapd 0xeec(%rip),%xmm1
movapd 0xef3(%rip),%xmm9
nopl   (%rax)
movdqu (%rdi,%rax,4),%xmm0
pshufd $0xee,%xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
cvtdq2pd %xmm0,%xmm0
movdqu 0x10(%rdi,%rax,4),%xmm10
mulpd  %xmm8,%xmm0
mulpd  %xmm8,%xmm2
movapd %xmm1,%xmm5
cmpnltpd %xmm2,%xmm5
movapd %xmm1,%xmm6
cmpnltpd %xmm0,%xmm6
movapd %xmm0,%xmm4
maxpd  %xmm1,%xmm4
movapd %xmm2,%xmm7
maxpd  %xmm1,%xmm7
cmpnltpd %xmm9,%xmm7
cmpnltpd %xmm9,%xmm4
orpd   %xmm4,%xmm6
orpd   %xmm7,%xmm5
movapd %xmm9,%xmm3
andpd  %xmm4,%xmm3
andnpd %xmm1,%xmm4
orpd   %xmm3,%xmm4
movapd %xmm9,%xmm3
andpd  %xmm7,%xmm3
andnpd %xmm1,%xmm7
orpd   %xmm3,%xmm7
andpd  %xmm5,%xmm7
andnpd %xmm2,%xmm5
andpd  %xmm6,%xmm4
andnpd %xmm0,%xmm6
orpd   %xmm4,%xmm6
cvttpd2dq %xmm6,%xmm0
orpd   %xmm7,%xmm5
cvttpd2dq %xmm5,%xmm2
unpcklpd %xmm2,%xmm0
movupd %xmm0,(%rdi,%rax,4)
pshufd $0xee,%xmm10,%xmm0
cvtdq2pd %xmm0,%xmm6
cvtdq2pd %xmm10,%xmm3
mulpd  %xmm8,%xmm3
mulpd  %xmm8,%xmm6
movapd %xmm1,%xmm4
cmpnltpd %xmm6,%xmm4
movapd %xmm1,%xmm5
cmpnltpd %xmm3,%xmm5
movapd %xmm3,%xmm0
maxpd  %xmm1,%xmm0
movapd %xmm6,%xmm2
maxpd  %xmm1,%xmm2
cmpnltpd %xmm9,%xmm2
cmpnltpd %xmm9,%xmm0
orpd   %xmm0,%xmm5
orpd   %xmm2,%xmm4
movapd %xmm9,%xmm7
andpd  %xmm0,%xmm7
andnpd %xmm1,%xmm0
orpd   %xmm7,%xmm0
movapd %xmm9,%xmm7
andpd  %xmm2,%xmm7
andnpd %xmm1,%xmm2
orpd   %xmm7,%xmm2
andpd  %xmm4,%xmm2
andnpd %xmm6,%xmm4
orpd   %xmm2,%xmm4
andpd  %xmm5,%xmm0
andnpd %xmm3,%xmm5
orpd   %xmm0,%xmm5
cvttpd2dq %xmm5,%xmm0
cvttpd2dq %xmm4,%xmm2
unpcklpd %xmm2,%xmm0
movupd %xmm0,0x10(%rdi,%rax,4)
add    $0x8,%rax
cmp    $0x40,%rax
jne    1130 <set_quality+0x30>
ret

LLVM IR (-O0):
define void @set_quality(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %74, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 64
br i1 %8, label %9, label %77
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sub nsw i32 100, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, 5.000000e+01
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = fmul double %13, %19
%21 = fcmp ogt double %20, 1.000000e+00
br i1 %21, label %22, label %34
22: ; preds = %9
%23 = load i32, i32* %4
%24 = sub nsw i32 100, %23
%25 = sitofp i32 %24 to double
%26 = fdiv double %25, 5.000000e+01
%27 = load i32*, i32** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %27, i64 %29
%31 = load i32, i32* %30
%32 = sitofp i32 %31 to double
%33 = fmul double %26, %32
br label %35
34: ; preds = %9
br label %35
35: ; preds = %34, %22
%36 = phi double [ %33, %22 ], [ 1.000000e+00, %34 ]
%37 = fcmp olt double %36, 2.550000e+02
br i1 %37, label %38, label %66
38: ; preds = %35
%39 = load i32, i32* %4
%40 = sub nsw i32 100, %39
%41 = sitofp i32 %40 to double
%42 = fdiv double %41, 5.000000e+01
%43 = load i32*, i32** %3
%44 = load i32, i32* %5
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %43, i64 %45
%47 = load i32, i32* %46
%48 = sitofp i32 %47 to double
%49 = fmul double %42, %48
%50 = fcmp ogt double %49, 1.000000e+00
br i1 %50, label %51, label %63
51: ; preds = %38
%52 = load i32, i32* %4
%53 = sub nsw i32 100, %52
%54 = sitofp i32 %53 to double
%55 = fdiv double %54, 5.000000e+01
%56 = load i32*, i32** %3
%57 = load i32, i32* %5
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %56, i64 %58
%60 = load i32, i32* %59
%61 = sitofp i32 %60 to double
%62 = fmul double %55, %61
br label %64
63: ; preds = %38
br label %64
64: ; preds = %63, %51
%65 = phi double [ %62, %51 ], [ 1.000000e+00, %63 ]
br label %67
66: ; preds = %35
br label %67
67: ; preds = %66, %64
%68 = phi double [ %65, %64 ], [ 2.550000e+02, %66 ]
%69 = fptosi double %68 to i32
%70 = load i32*, i32** %3
%71 = load i32, i32* %5
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %70, i64 %72
store i32 %69, i32* %73
br label %74
74: ; preds = %67
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %5
br label %6
77: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @set_quality(i32* nocapture %0, i32 %1) {
%3 = sub nsw i32 100, %1
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 5.000000e+01
%6 = insertelement <4 x double> poison, double %5, i64 0
%7 = shufflevector <4 x double> %6, <4 x double> poison, <4 x i32> zeroinitializer
br label %8
8: ; preds = %8, %2
%9 = phi i64 [ 0, %2 ], [ %39, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = bitcast i32* %10 to <4 x i32>*
%12 = load <4 x i32>, <4 x i32>* %11
%13 = sitofp <4 x i32> %12 to <4 x double>
%14 = fmul <4 x double> %7, %13
%15 = fcmp ogt <4 x double> %14, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
%16 = select <4 x i1> %15, <4 x double> %14, <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
%17 = fcmp uge <4 x double> %16, <double 2.550000e+02, double 2.550000e+02, double 2.550000e+02, double 2.550000e+02>
%18 = xor <4 x i1> %15, <i1 true, i1 true, i1 true, i1 true>
%19 = or <4 x i1> %17, %18
%20 = select <4 x i1> %17, <4 x double> <double 2.550000e+02, double 2.550000e+02, double 2.550000e+02, double 2.550000e+02>, <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
%21 = select <4 x i1> %19, <4 x double> %20, <4 x double> %14
%22 = fptosi <4 x double> %21 to <4 x i32>
%23 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> %22, <4 x i32>* %23
%24 = or i64 %9, 4
%25 = getelementptr inbounds i32, i32* %0, i64 %24
%26 = bitcast i32* %25 to <4 x i32>*
%27 = load <4 x i32>, <4 x i32>* %26
%28 = sitofp <4 x i32> %27 to <4 x double>
%29 = fmul <4 x double> %7, %28
%30 = fcmp ogt <4 x double> %29, <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
%31 = select <4 x i1> %30, <4 x double> %29, <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
%32 = fcmp uge <4 x double> %31, <double 2.550000e+02, double 2.550000e+02, double 2.550000e+02, double 2.550000e+02>
%33 = xor <4 x i1> %30, <i1 true, i1 true, i1 true, i1 true>
%34 = or <4 x i1> %32, %33
%35 = select <4 x i1> %32, <4 x double> <double 2.550000e+02, double 2.550000e+02, double 2.550000e+02, double 2.550000e+02>, <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00>
%36 = select <4 x i1> %34, <4 x double> %35, <4 x double> %29
%37 = fptosi <4 x double> %36 to <4 x i32>
%38 = bitcast i32* %25 to <4 x i32>*
store <4 x i32> %37, <4 x i32>* %38
%39 = add nuw nsw i64 %9, 8
%40 = icmp eq i64 %39, 64
br i1 %40, label %41, label %8
41: ; preds = %8
ret void
}