void inter_smooth(int **map, int width, int height) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      map[i][j] %= 100;
    }
  }
}


x86 assembly (clang, -O0):
<inter_smooth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    117b <inter_smooth+0x7b>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1168 <inter_smooth+0x68>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x64,%esi
cltd
idiv   %esi
mov    -0x20(%rbp),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <inter_smooth+0x28>
jmp    116d <inter_smooth+0x6d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <inter_smooth+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_smooth>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    148f <inter_smooth+0x38f>
mov    %edx,%r14d
mov    %esi,%r12d
mov    %r12d,%r11d
and    $0xfffffff8,%r11d
lea    -0x8(%r11),%r8
mov    %r8,%r9
shr    $0x3,%r9
add    $0x1,%r9
mov    %r9,%r10
and    $0xfffffffffffffffe,%r10
xor    %r15d,%r15d
movdqa 0xec1(%rip),%xmm0
movdqa 0xec9(%rip),%xmm1
jmp    115d <inter_smooth+0x5d>
nopl   0x0(%rax)
add    $0x1,%r15
cmp    %r14,%r15
je     148f <inter_smooth+0x38f>
test   %esi,%esi
jle    1150 <inter_smooth+0x50>
mov    (%rdi,%r15,8),%r13
cmp    $0x8,%esi
jae    1180 <inter_smooth+0x80>
xor    %eax,%eax
jmp    1450 <inter_smooth+0x350>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   %r8,%r8
je     1481 <inter_smooth+0x381>
mov    %r10,%rdx
xor    %eax,%eax
xchg   %ax,%ax
movdqu 0x0(%r13,%rax,4),%xmm4
movdqu 0x10(%r13,%rax,4),%xmm5
movdqu 0x20(%r13,%rax,4),%xmm2
movdqu 0x30(%r13,%rax,4),%xmm3
movdqa %xmm4,%xmm6
pmuludq %xmm0,%xmm6
pshufd $0xed,%xmm6,%xmm6
pshufd $0xf5,%xmm4,%xmm7
pmuludq %xmm0,%xmm7
pshufd $0xed,%xmm7,%xmm7
punpckldq %xmm7,%xmm6
pxor   %xmm7,%xmm7
pcmpgtd %xmm4,%xmm7
pand   %xmm0,%xmm7
psubd  %xmm7,%xmm6
movdqa %xmm6,%xmm7
psrld  $0x1f,%xmm7
psrad  $0x5,%xmm6
paddd  %xmm7,%xmm6
pshufd $0xf5,%xmm6,%xmm7
pmuludq %xmm1,%xmm6
pshufd $0xe8,%xmm6,%xmm6
pmuludq %xmm1,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm6
psubd  %xmm6,%xmm4
movdqa %xmm5,%xmm6
pmuludq %xmm0,%xmm6
pshufd $0xed,%xmm6,%xmm6
pshufd $0xf5,%xmm5,%xmm7
pmuludq %xmm0,%xmm7
pshufd $0xed,%xmm7,%xmm7
punpckldq %xmm7,%xmm6
pxor   %xmm7,%xmm7
pcmpgtd %xmm5,%xmm7
pand   %xmm0,%xmm7
psubd  %xmm7,%xmm6
movdqa %xmm6,%xmm7
psrld  $0x1f,%xmm7
psrad  $0x5,%xmm6
paddd  %xmm7,%xmm6
pshufd $0xf5,%xmm6,%xmm7
pmuludq %xmm1,%xmm6
pshufd $0xe8,%xmm6,%xmm6
pmuludq %xmm1,%xmm7
pshufd $0xe8,%xmm7,%xmm7
punpckldq %xmm7,%xmm6
psubd  %xmm6,%xmm5
movdqu %xmm4,0x0(%r13,%rax,4)
movdqu %xmm5,0x10(%r13,%rax,4)
movdqa %xmm2,%xmm4
pmuludq %xmm0,%xmm4
pshufd $0xed,%xmm4,%xmm4
pshufd $0xf5,%xmm2,%xmm5
pmuludq %xmm0,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
pxor   %xmm5,%xmm5
pcmpgtd %xmm2,%xmm5
pand   %xmm0,%xmm5
psubd  %xmm5,%xmm4
movdqa %xmm4,%xmm5
psrld  $0x1f,%xmm5
psrad  $0x5,%xmm4
paddd  %xmm5,%xmm4
pshufd $0xf5,%xmm4,%xmm5
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm4
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
psubd  %xmm4,%xmm2
movdqa %xmm3,%xmm4
pmuludq %xmm0,%xmm4
pshufd $0xed,%xmm4,%xmm4
pshufd $0xf5,%xmm3,%xmm5
pmuludq %xmm0,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
pxor   %xmm5,%xmm5
pcmpgtd %xmm3,%xmm5
pand   %xmm0,%xmm5
psubd  %xmm5,%xmm4
movdqa %xmm4,%xmm5
psrld  $0x1f,%xmm5
psrad  $0x5,%xmm4
paddd  %xmm5,%xmm4
pshufd $0xf5,%xmm4,%xmm5
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm4
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
psubd  %xmm4,%xmm3
movdqu %xmm2,0x20(%r13,%rax,4)
movdqu %xmm3,0x30(%r13,%rax,4)
add    $0x10,%rax
add    $0xfffffffffffffffe,%rdx
jne    1190 <inter_smooth+0x90>
test   $0x1,%r9b
je     143c <inter_smooth+0x33c>
movdqu 0x0(%r13,%rax,4),%xmm2
movdqu 0x10(%r13,%rax,4),%xmm3
movdqa %xmm2,%xmm4
pmuludq %xmm0,%xmm4
pshufd $0xed,%xmm4,%xmm4
pshufd $0xf5,%xmm2,%xmm5
pmuludq %xmm0,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
pxor   %xmm5,%xmm5
pcmpgtd %xmm2,%xmm5
pand   %xmm0,%xmm5
psubd  %xmm5,%xmm4
movdqa %xmm4,%xmm5
psrld  $0x1f,%xmm5
psrad  $0x5,%xmm4
paddd  %xmm5,%xmm4
pshufd $0xf5,%xmm4,%xmm5
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm4
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
psubd  %xmm4,%xmm2
movdqa %xmm3,%xmm4
pmuludq %xmm0,%xmm4
pshufd $0xed,%xmm4,%xmm4
pshufd $0xf5,%xmm3,%xmm5
pmuludq %xmm0,%xmm5
pshufd $0xed,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
pxor   %xmm5,%xmm5
pcmpgtd %xmm3,%xmm5
pand   %xmm0,%xmm5
psubd  %xmm5,%xmm4
movdqa %xmm4,%xmm5
psrld  $0x1f,%xmm5
psrad  $0x5,%xmm4
paddd  %xmm5,%xmm4
pshufd $0xf5,%xmm4,%xmm5
pmuludq %xmm1,%xmm4
pshufd $0xe8,%xmm4,%xmm4
pmuludq %xmm1,%xmm5
pshufd $0xe8,%xmm5,%xmm5
punpckldq %xmm5,%xmm4
psubd  %xmm4,%xmm3
movdqu %xmm2,0x0(%r13,%rax,4)
movdqu %xmm3,0x10(%r13,%rax,4)
mov    %r11,%rax
cmp    %r12,%r11
je     1150 <inter_smooth+0x50>
nopl   0x0(%rax,%rax,1)
movslq 0x0(%r13,%rax,4),%rdx
imul   $0x51eb851f,%rdx,%rcx
mov    %rcx,%rbx
shr    $0x3f,%rbx
sar    $0x25,%rcx
add    %ebx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%edx
mov    %edx,0x0(%r13,%rax,4)
add    $0x1,%rax
cmp    %rax,%r12
jne    1450 <inter_smooth+0x350>
jmp    1150 <inter_smooth+0x50>
xor    %eax,%eax
test   $0x1,%r9b
jne    1360 <inter_smooth+0x260>
jmp    143c <inter_smooth+0x33c>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @inter_smooth(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %9
9: ; preds = %33, %3
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %36
13: ; preds = %9
store i32 0, i32* %8
br label %14
14: ; preds = %29, %13
%15 = load i32, i32* %8
%16 = load i32, i32* %5
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %32
18: ; preds = %14
%19 = load i32**, i32*** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32*, i32** %19, i64 %21
%23 = load i32*, i32** %22
%24 = load i32, i32* %8
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
%27 = load i32, i32* %26
%28 = srem i32 %27, 100
store i32 %28, i32* %26
br label %29
29: ; preds = %18
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %14
32: ; preds = %14
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %9
36: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @inter_smooth(i32** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %69
5: ; preds = %3
%6 = icmp sgt i32 %1, 0
%7 = zext i32 %2 to i64
%8 = zext i32 %1 to i64
%9 = and i64 %8, 4294967288
%10 = add nsw i64 %9, -8
%11 = lshr exact i64 %10, 3
%12 = add nuw nsw i64 %11, 1
%13 = icmp ult i32 %1, 8
%14 = and i64 %8, 4294967288
%15 = and i64 %12, 1
%16 = icmp eq i64 %10, 0
%17 = and i64 %12, 4611686018427387902
%18 = icmp eq i64 %15, 0
%19 = icmp eq i64 %14, %8
br label %20
20: ; preds = %5, %70
%21 = phi i64 [ 0, %5 ], [ %71, %70 ]
br i1 %6, label %22, label %70
22: ; preds = %20
%23 = getelementptr inbounds i32*, i32** %0, i64 %21
%24 = load i32*, i32** %23
br i1 %13, label %67, label %25
25: ; preds = %22
br i1 %16, label %53, label %26
26: ; preds = %25, %26
%27 = phi i64 [ %50, %26 ], [ 0, %25 ]
%28 = phi i64 [ %51, %26 ], [ 0, %25 ]
%29 = getelementptr inbounds i32, i32* %24, i64 %27
%30 = bitcast i32* %29 to <4 x i32>*
%31 = load <4 x i32>, <4 x i32>* %30
%32 = getelementptr inbounds i32, i32* %29, i64 4
%33 = bitcast i32* %32 to <4 x i32>*
%34 = load <4 x i32>, <4 x i32>* %33
%35 = srem <4 x i32> %31, <i32 100, i32 100, i32 100, i32 100>
%36 = srem <4 x i32> %34, <i32 100, i32 100, i32 100, i32 100>
%37 = bitcast i32* %29 to <4 x i32>*
store <4 x i32> %35, <4 x i32>* %37
%38 = bitcast i32* %32 to <4 x i32>*
store <4 x i32> %36, <4 x i32>* %38
%39 = or i64 %27, 8
%40 = getelementptr inbounds i32, i32* %24, i64 %39
%41 = bitcast i32* %40 to <4 x i32>*
%42 = load <4 x i32>, <4 x i32>* %41
%43 = getelementptr inbounds i32, i32* %40, i64 4
%44 = bitcast i32* %43 to <4 x i32>*
%45 = load <4 x i32>, <4 x i32>* %44
%46 = srem <4 x i32> %42, <i32 100, i32 100, i32 100, i32 100>
%47 = srem <4 x i32> %45, <i32 100, i32 100, i32 100, i32 100>
%48 = bitcast i32* %40 to <4 x i32>*
store <4 x i32> %46, <4 x i32>* %48
%49 = bitcast i32* %43 to <4 x i32>*
store <4 x i32> %47, <4 x i32>* %49
%50 = add nuw i64 %27, 16
%51 = add i64 %28, 2
%52 = icmp eq i64 %51, %17
br i1 %52, label %53, label %26
53: ; preds = %26, %25
%54 = phi i64 [ 0, %25 ], [ %50, %26 ]
br i1 %18, label %66, label %55
55: ; preds = %53
%56 = getelementptr inbounds i32, i32* %24, i64 %54
%57 = bitcast i32* %56 to <4 x i32>*
%58 = load <4 x i32>, <4 x i32>* %57
%59 = getelementptr inbounds i32, i32* %56, i64 4
%60 = bitcast i32* %59 to <4 x i32>*
%61 = load <4 x i32>, <4 x i32>* %60
%62 = srem <4 x i32> %58, <i32 100, i32 100, i32 100, i32 100>
%63 = srem <4 x i32> %61, <i32 100, i32 100, i32 100, i32 100>
%64 = bitcast i32* %56 to <4 x i32>*
store <4 x i32> %62, <4 x i32>* %64
%65 = bitcast i32* %59 to <4 x i32>*
store <4 x i32> %63, <4 x i32>* %65
br label %66
66: ; preds = %53, %55
br i1 %19, label %70, label %67
67: ; preds = %22, %66
%68 = phi i64 [ 0, %22 ], [ %14, %66 ]
br label %73
69: ; preds = %70, %3
ret void
70: ; preds = %73, %66, %20
%71 = add nuw nsw i64 %21, 1
%72 = icmp eq i64 %71, %7
br i1 %72, label %69, label %20
73: ; preds = %67, %73
%74 = phi i64 [ %78, %73 ], [ %68, %67 ]
%75 = getelementptr inbounds i32, i32* %24, i64 %74
%76 = load i32, i32* %75
%77 = srem i32 %76, 100
store i32 %77, i32* %75
%78 = add nuw nsw i64 %74, 1
%79 = icmp eq i64 %78, %8
br i1 %79, label %70, label %73
}