#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 /*<<< orphan*/ GL_CLAMP;
int /*<<< orphan*/ GL_REPEAT;
int /*<<< orphan*/ GL_TEXTURE_2D;
int /*<<< orphan*/ GL_TEXTURE_WRAP_S;
int /*<<< orphan*/ GL_TEXTURE_WRAP_T;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glTexParameteri(int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
void keyboard(unsigned char key, int x, int y) {
  switch (key) {
  case 's':
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
    glutPostRedisplay();
    break;
  case 'S':
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    glutPostRedisplay();
    break;
  case 't':
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
    glutPostRedisplay();
    break;
  case 'T':
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    glutPostRedisplay();
    break;
  case 27:
    exit(0);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     124d <keyboard+0x11d>
jmp    1159 <keyboard+0x29>
mov    -0x10(%rbp),%eax
sub    $0x53,%eax
je     11c9 <keyboard+0x99>
jmp    116a <keyboard+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x54,%eax
je     1221 <keyboard+0xf1>
jmp    117b <keyboard+0x4b>
mov    -0x10(%rbp),%eax
sub    $0x73,%eax
je     119d <keyboard+0x6d>
jmp    118c <keyboard+0x5c>
mov    -0x10(%rbp),%eax
sub    $0x74,%eax
je     11f5 <keyboard+0xc5>
jmp    1254 <keyboard+0x124>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
mov    0x2e33(%rip),%rax
mov    (%rax),%esi
mov    0x2e42(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1259 <keyboard+0x129>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
mov    0x2e07(%rip),%rax
mov    (%rax),%esi
mov    0x2de6(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1259 <keyboard+0x129>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
mov    0x2db3(%rip),%rax
mov    (%rax),%esi
mov    0x2dea(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1259 <keyboard+0x129>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
mov    0x2d87(%rip),%rax
mov    (%rax),%esi
mov    0x2d8e(%rip),%rax
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
jmp    1259 <keyboard+0x129>
xor    %edi,%edi
call   1050 <exit@plt>
jmp    1259 <keyboard+0x129>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
push   %rax
lea    -0x53(%rdi),%edx
cmp    $0x21,%dl
ja     118b <keyboard+0x5b>
mov    0x2eb8(%rip),%rax
mov    0x2e99(%rip),%rcx
movzbl %dl,%edx
lea    0xeaf(%rip),%rsi
movslq (%rsi,%rdx,4),%rdx
add    %rsi,%rdx
jmp    *%rdx
mov    0x2e67(%rip),%rax
jmp    1171 <keyboard+0x41>
mov    0x2e5e(%rip),%rax
mov    0x2e47(%rip),%rcx
mov    0x2e58(%rip),%rdx
mov    (%rdx),%edi
mov    (%rcx),%esi
mov    (%rax),%edx
call   1030 <glTexParameteri@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>
cmp    $0x1b,%dil
je     1193 <keyboard+0x63>
pop    %rax
ret
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_CLAMP = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %35 [
i32 115, label %9
i32 83, label %15
i32 116, label %21
i32 84, label %27
i32 27, label %33
]
9: ; preds = %3
%10 = load i32, i32* @GL_TEXTURE_2D
%11 = load i32, i32* @GL_TEXTURE_WRAP_S
%12 = load i32, i32* @GL_CLAMP
%13 = call i32 @glTexParameteri(i32 %10, i32 %11, i32 %12)
%14 = call i32 (...) @glutPostRedisplay()
br label %36
15: ; preds = %3
%16 = load i32, i32* @GL_TEXTURE_2D
%17 = load i32, i32* @GL_TEXTURE_WRAP_S
%18 = load i32, i32* @GL_REPEAT
%19 = call i32 @glTexParameteri(i32 %16, i32 %17, i32 %18)
%20 = call i32 (...) @glutPostRedisplay()
br label %36
21: ; preds = %3
%22 = load i32, i32* @GL_TEXTURE_2D
%23 = load i32, i32* @GL_TEXTURE_WRAP_T
%24 = load i32, i32* @GL_CLAMP
%25 = call i32 @glTexParameteri(i32 %22, i32 %23, i32 %24)
%26 = call i32 (...) @glutPostRedisplay()
br label %36
27: ; preds = %3
%28 = load i32, i32* @GL_TEXTURE_2D
%29 = load i32, i32* @GL_TEXTURE_WRAP_T
%30 = load i32, i32* @GL_REPEAT
%31 = call i32 @glTexParameteri(i32 %28, i32 %29, i32 %30)
%32 = call i32 (...) @glutPostRedisplay()
br label %36
33: ; preds = %3
%34 = call i32 @exit(i32 0)
unreachable
35: ; preds = %3
br label %36
36: ; preds = %35, %27, %21, %15, %9
ret void
}

LLVM IR (-O2):
@GL_TEXTURE_2D = global i32 0
@GL_TEXTURE_WRAP_S = global i32 0
@GL_CLAMP = global i32 0
@GL_REPEAT = global i32 0
@GL_TEXTURE_WRAP_T = global i32 0
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %17 [
i8 115, label %9
i8 83, label %4
i8 116, label %5
i8 84, label %6
i8 27, label %7
]
4: ; preds = %3
br label %9
5: ; preds = %3
br label %9
6: ; preds = %3
br label %9
7: ; preds = %3
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3, %4, %5, %6
%10 = phi i32* [ @GL_TEXTURE_WRAP_T, %6 ], [ @GL_TEXTURE_WRAP_T, %5 ], [ @GL_TEXTURE_WRAP_S, %4 ], [ @GL_TEXTURE_WRAP_S, %3 ]
%11 = phi i32* [ @GL_REPEAT, %6 ], [ @GL_CLAMP, %5 ], [ @GL_REPEAT, %4 ], [ @GL_CLAMP, %3 ]
%12 = load i32, i32* @GL_TEXTURE_2D
%13 = load i32, i32* %10
%14 = load i32, i32* %11
%15 = tail call i32 @glTexParameteri(i32 %12, i32 %13, i32 %14)
%16 = tail call i32 (...) @glutPostRedisplay()
br label %17
17: ; preds = %9, %3
ret void
}