xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fread(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
uint32_t read_uint16() {
  uint8_t byte[2] = {0x00, 0x00};
  fread(byte, sizeof(uint8_t), 2, stdin);
  uint32_t result = ((uint16_t)byte[0]) << 0 | ((uint16_t)byte[1]) << 8;
  return result;
}


x86 assembly (clang, -O0):
<read_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    -0x8(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%ecx
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    -0x8(%rbp),%eax
shl    $0x0,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint16>:
push   %rax
movq   $0x0,(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    0x4(%rsp),%eax
shl    $0x8,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @read_uint16() {
%1 = alloca [2 x i32]
%2 = alloca i32
%3 = bitcast [2 x i32]* %1 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fread(i32* %4, i32 4, i32 2, i32 %5)
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 0
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @read_uint16() {
%1 = alloca i64
%2 = bitcast i64* %1 to [2 x i32]*
%3 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%4 = bitcast i64* %1 to i32*
%5 = load i32, i32* @stdin
%6 = call i32 @fread(i32* %4, i32 4, i32 2, i32 %5)
%7 = load i32, i32* %4
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %10, %7
ret i32 %11
}
int strlength(const char *str) {
  int len = 0;
  while (str[len])
    ++len;
  return len;
}


x86 assembly (clang, -O0):
<strlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <strlength+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlength+0x10>
ret

LLVM IR (-O0):
define i32 @strlength(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @strlength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t fwrite(char *, int, int, int /*<<< orphan*/ *);
size_t writebyte(FILE *file, char byte) {
  return fwrite(&byte, sizeof(char), 1, file);
}


x86 assembly (clang, -O0):
<writebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebyte>:
push   %rax
mov    %rdi,%rcx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @writebyte(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
%5 = load i32*, i32** %3
%6 = call i64 @fwrite(i8* %4, i32 1, i32 1, i32* %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @writebyte(i32* nocapture %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i64 @fwrite(i8* %3, i32 1, i32 1, i32* %0)
ret i64 %4
}
void skip_space(const char **s) {
  for (;;) {
    if (**s == '\0')
      break;
    if (**s > ' ')
      break;
    (*s)++;
  }
}


x86 assembly (clang, -O0):
<skip_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1120 <skip_space+0x20>
jmp    114b <skip_space+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jle    1138 <skip_space+0x38>
jmp    114b <skip_space+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skip_space+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_space>:
mov    (%rdi),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1133 <skip_space+0x33>
cmp    $0x20,%cl
jg     1133 <skip_space+0x33>
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,(%rdi)
movzbl (%rax),%ecx
test   %cl,%cl
je     1133 <skip_space+0x33>
add    $0x1,%rax
cmp    $0x21,%cl
jl     1120 <skip_space+0x20>
ret

LLVM IR (-O0):
define void @skip_space(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %17, %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
br label %21
10: ; preds = %3
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 32
br i1 %15, label %16, label %17
16: ; preds = %10
br label %21
17: ; preds = %10
%18 = load i8**, i8*** %2
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
br label %3
21: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
define void @skip_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
%5 = icmp sgt i8 %3, 32
%6 = or i1 %4, %5
br i1 %6, label %14, label %7
7: ; preds = %1, %7
%8 = phi i8* [ %9, %7 ], [ %2, %1 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
%12 = icmp sgt i8 %10, 32
%13 = or i1 %11, %12
br i1 %13, label %14, label %7
14: ; preds = %7, %1
ret void
}
int main() {
  int a = 99;
  int b = 47;
  return a ^ b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x63,-0x8(%rbp)
movl   $0x2f,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x4c,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 99, i32* %2
store i32 47, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = xor i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
ret i32 76
}
/* Variables and functions */
bool endian() {
  unsigned int i = 1;
  char *c = (char *)&i;
  if (*c)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <endian+0x2c>
movl   $0x1,-0x4(%rbp)
jmp    1133 <endian+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<endian>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 1, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @endian() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ dlacpy_(char *, int *, int *, double const *, int *,
                           double *, int *);
void aa_cla_dlacpy(char uplo, int m, int n, const double *A, int lda, double *B,
                   int ldb) {
  dlacpy_(&uplo, &m, &n, A, &lda, B, &ldb);
}


x86 assembly (clang, -O0):
<aa_cla_dlacpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    0x10(%rbp),%edi
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%r9
lea    -0x1(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x1c(%rbp),%r8
lea    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <dlacpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_dlacpy>:
sub    $0x18,%rsp
mov    %dil,0xb(%rsp)
mov    %esi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,(%rsp)
lea    0xb(%rsp),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <dlacpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @aa_cla_dlacpy(i8 signext %0, i32 %1, i32 %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double* %3, double** %11
store i32 %4, i32* %12
store double* %5, double** %13
store i32 %6, i32* %14
%15 = load double*, double** %11
%16 = load double*, double** %13
%17 = call i32 @dlacpy_(i8* %8, i32* %9, i32* %10, double* %15, i32* %12, double* %16, i32* %14)
ret void
}

LLVM IR (-O2):
define void @aa_cla_dlacpy(i8 signext %0, i32 %1, i32 %2, double* %3, i32 %4, double* %5, i32 %6) {
%8 = alloca i8
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i8 %0, i8* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %4, i32* %11
store i32 %6, i32* %12
%13 = call i32 @dlacpy_(i8* %8, i32* %9, i32* %10, double* %3, i32* %11, double* %5, i32* %12)
ret void
}
int calculate_lint_min() {
  signed long int i = 0;
  while (i <= 0) {
    --i;
  }
  ++i;
  return i;
}


x86 assembly (clang, -O0):
<calculate_lint_min>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jg     1128 <calculate_lint_min+0x28>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <calculate_lint_min+0xc>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @calculate_lint_min() {
%1 = alloca i64
store i64 0, i64* %1
br label %2
2: ; preds = %5, %0
%3 = load i64, i64* %1
%4 = icmp sle i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i64, i64* %1
%7 = add nsw i64 %6, -1
store i64 %7, i64* %1
br label %2
8: ; preds = %2
%9 = load i64, i64* %1
%10 = add nsw i64 %9, 1
store i64 %10, i64* %1
%11 = load i64, i64* %1
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
/* Variables and functions */
int __syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int kill(int signal, int pid) { return __syscall(signal, pid, 0, 0, 60); }


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %ecx,%ecx
mov    $0x3c,%r8d
mov    %ecx,%edx
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x3c,%r8d
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
define i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @__syscall(i32 %5, i32 %6, i32 0, i32 0, i32 60)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @__syscall(i32 %0, i32 %1, i32 0, i32 0, i32 60)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ checkunitsleft();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void check_win(void) {
  if (!checkunitsleft()) {
    puts("WINNER!");
    exit(EXIT_SUCCESS);
  }
}


x86 assembly (clang, -O0):
<check_win>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <checkunitsleft@plt>
cmp    $0x0,%eax
jne    115e <check_win+0x2e>
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_win>:
push   %rax
xor    %eax,%eax
call   1050 <checkunitsleft@plt>
test   %eax,%eax
je     113e <check_win+0xe>
pop    %rax
ret
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"WINNER!\00"
@EXIT_SUCCESS = global i32 0
define void @check_win() {
%1 = call i32 (...) @checkunitsleft()
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"WINNER!\00"
@EXIT_SUCCESS = global i32 0
define void @check_win() {
%1 = tail call i32 (...) @checkunitsleft()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *appname) {
  printf("usage: %s <url> <folder to write file to>\n", appname);
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"usage: %s <url> <folder to write file to>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"usage: %s <url> <folder to write file to>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
__attribute__((swiftcall)) void
context_error_2(short s, __attribute__((swift_context)) int *self,
                __attribute__((swift_error_result)) float **error) {}


x86 assembly (clang, -O0):
<context_error_2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %r12,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %r13,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%r12
pop    %rbp
ret

x86 assembly (clang, -O2):
<context_error_2>:
ret

LLVM IR (-O0):
define swiftcc void @context_error_2(i16 %0, i32* swiftself %1, float** swifterror %2) {
%4 = alloca float*
%5 = alloca i16
%6 = alloca i32*
%7 = alloca float**
%8 = load float*, float** %2
store float* %8, float** %4
store i16 %0, i16* %5
store i32* %1, i32** %6
store float** %4, float*** %7
%9 = load float*, float** %4
store float* %9, float** %2
ret void
}

LLVM IR (-O2):
define swiftcc void @context_error_2(i16 %0, i32* nocapture swiftself %1, float** nocapture swifterror %2) {
ret void
}
float g(void) { return 0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @g() {
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @g() {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ test_angle_degree_to_radian();
int /*<<< orphan*/ test_angle_radian_to_degree();
void test_angle() {
  test_angle_radian_to_degree();
  test_angle_degree_to_radian();
}


x86 assembly (clang, -O0):
<test_angle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_angle_radian_to_degree@plt>
mov    $0x0,%al
call   1040 <test_angle_degree_to_radian@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_angle>:
push   %rax
xor    %eax,%eax
call   1030 <test_angle_radian_to_degree@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_angle_degree_to_radian@plt>

LLVM IR (-O0):
define void @test_angle() {
%1 = call i32 (...) @test_angle_radian_to_degree()
%2 = call i32 (...) @test_angle_degree_to_radian()
ret void
}

LLVM IR (-O2):
define void @test_angle() {
%1 = tail call i32 (...) @test_angle_radian_to_degree()
%2 = tail call i32 (...) @test_angle_degree_to_radian()
ret void
}
void rop3_234_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk1 = *D | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_234_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_234_0_0>:
and    %edx,%esi
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_234_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
store i8 %22, i8* %23
ret void
}

LLVM IR (-O2):
define void @rop3_234_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %5, %4
store i8 %6, i8* %0
ret void
}
int test_imm_79int32_reg(int val) { return ((val) & (0x79 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_79int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x79,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_79int32_reg>:
test   $0x79,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_79int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 121
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_79int32_reg(i32 %0) {
%2 = and i32 %0, 121
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gdk_visibility_state_get_type() {}


x86 assembly (clang, -O0):
<gdk_visibility_state_get_type>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdk_visibility_state_get_type>:
ret

LLVM IR (-O0):
define void @gdk_visibility_state_get_type() {
ret void
}

LLVM IR (-O2):
define void @gdk_visibility_state_get_type() {
ret void
}
int fun475() { return 475; }


x86 assembly (clang, -O0):
<fun475>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1db,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun475>:
mov    $0x1db,%eax
ret

LLVM IR (-O0):
define i32 @fun475() {
ret i32 475
}

LLVM IR (-O2):
define i32 @fun475() {
ret i32 475
}
void usb_mouse_event_dummy() {}


x86 assembly (clang, -O0):
<usb_mouse_event_dummy>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_mouse_event_dummy>:
ret

LLVM IR (-O0):
define void @usb_mouse_event_dummy() {
ret void
}

LLVM IR (-O2):
define void @usb_mouse_event_dummy() {
ret void
}
/* Variables and functions */
unsigned long long __builtin_cnttzdm(unsigned long long, unsigned long long);
unsigned long long int do_cnttzdm(unsigned long long int source,
                                  unsigned long long int mask) {
  return __builtin_cnttzdm(source, mask);
}


x86 assembly (clang, -O0):
<do_cnttzdm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__builtin_cnttzdm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cnttzdm>:
jmp    1030 <__builtin_cnttzdm@plt>

LLVM IR (-O0):
define i64 @do_cnttzdm(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__builtin_cnttzdm(i64 %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @do_cnttzdm(i64 %0, i64 %1) {
%3 = tail call i64 @__builtin_cnttzdm(i64 %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
double mysecond();
double mysecond_() { return mysecond(); }


x86 assembly (clang, -O0):
<mysecond_>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mysecond@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysecond_>:
xor    %eax,%eax
jmp    1030 <mysecond@plt>

LLVM IR (-O0):
define double @mysecond_() {
%1 = call double (...) @mysecond()
ret double %1
}

LLVM IR (-O2):
define double @mysecond_() {
%1 = tail call double (...) @mysecond()
ret double %1
}
/* Type definitions */
struct timespec {
  int tv_sec;
  unsigned long tv_nsec;
};

/* Variables and functions */
unsigned long diff_time(struct timespec *op1, struct timespec *op2) {
  return (op1->tv_sec - op2->tv_sec) * 1000000000 + op1->tv_nsec - op2->tv_nsec;
}


x86 assembly (clang, -O0):
<diff_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3b9aca00,%eax,%eax
cltq
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x10(%rbp),%rcx
sub    0x8(%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_time>:
movslq (%rdi),%rax
movslq (%rsi),%rcx
sub    %rcx,%rax
imul   $0x3b9aca00,%rax,%rcx
mov    0x8(%rdi),%rax
sub    0x8(%rsi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @diff_time(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000000
%13 = sext i32 %12 to i64
%14 = load %struct.timespec*, %struct.timespec** %3
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = add i64 %13, %16
%18 = load %struct.timespec*, %struct.timespec** %4
%19 = getelementptr inbounds %struct.timespec, %struct.timespec* %18, i32 0, i32 1
%20 = load i64, i64* %19
%21 = sub i64 %17, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @diff_time(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add i64 %14, %9
ret i64 %15
}
/* Type definitions */
struct server_list {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_new();
struct server_list *server_list_new(void) {
  return ((struct server_list *)(genlist_new()));
}


x86 assembly (clang, -O0):
<server_list_new>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genlist_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<server_list_new>:
xor    %eax,%eax
jmp    1030 <genlist_new@plt>

LLVM IR (-O0):
%struct.server_list = type { i32 }
define %struct.server_list* @server_list_new() {
%1 = call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.server_list*
ret %struct.server_list* %2
}

LLVM IR (-O2):
%struct.server_list = type { i32 }
define %struct.server_list* @server_list_new() {
%1 = tail call i64 (...) @genlist_new()
%2 = inttoptr i64 %1 to %struct.server_list*
ret %struct.server_list* %2
}
unsigned char window_needs_option(const unsigned char type) {
  switch (type) {
  case 1:
  case 2:
  case 3:
  case 13:
  case 4:
  case 5:
  case 7:
  case 8:
  case 11:
    return (0 == 1);
    break;
  case 6:
  case 9:
  case 10:
  case 12:
  case 14:
    return (0 == 0);
    break;
  default:
    return (0 == 1);
    break;
  }
}


x86 assembly (clang, -O0):
<window_needs_option>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
add    $0xffffffff,%eax
sub    $0x5,%eax
jb     119f <window_needs_option+0x9f>
jmp    1122 <window_needs_option+0x22>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
je     11a8 <window_needs_option+0xa8>
jmp    1133 <window_needs_option+0x33>
mov    -0x8(%rbp),%eax
add    $0xfffffff9,%eax
sub    $0x2,%eax
jb     119f <window_needs_option+0x9f>
jmp    1147 <window_needs_option+0x47>
mov    -0x8(%rbp),%eax
add    $0xfffffff7,%eax
sub    $0x2,%eax
jb     11a8 <window_needs_option+0xa8>
jmp    115b <window_needs_option+0x5b>
mov    -0x8(%rbp),%eax
sub    $0xb,%eax
je     119f <window_needs_option+0x9f>
jmp    116c <window_needs_option+0x6c>
mov    -0x8(%rbp),%eax
sub    $0xc,%eax
je     11a8 <window_needs_option+0xa8>
jmp    117d <window_needs_option+0x7d>
mov    -0x8(%rbp),%eax
sub    $0xd,%eax
je     119f <window_needs_option+0x9f>
jmp    118e <window_needs_option+0x8e>
mov    -0x8(%rbp),%eax
sub    $0xe,%eax
je     11a8 <window_needs_option+0xa8>
jmp    11b1 <window_needs_option+0xb1>
movb   $0x0,-0x1(%rbp)
jmp    11b5 <window_needs_option+0xb5>
movb   $0x1,-0x1(%rbp)
jmp    11b5 <window_needs_option+0xb5>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<window_needs_option>:
add    $0xfa,%dil
cmp    $0x8,%dil
ja     1119 <window_needs_option+0x19>
movsbq %dil,%rax
lea    0xeeb(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define zeroext i8 @window_needs_option(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %8 [
i32 1, label %6
i32 2, label %6
i32 3, label %6
i32 13, label %6
i32 4, label %6
i32 5, label %6
i32 7, label %6
i32 8, label %6
i32 11, label %6
i32 6, label %7
i32 9, label %7
i32 10, label %7
i32 12, label %7
i32 14, label %7
]
6: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1
store i8 0, i8* %2
br label %9
7: ; preds = %1, %1, %1, %1, %1
store i8 1, i8* %2
br label %9
8: ; preds = %1
store i8 0, i8* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i8, i8* %2
ret i8 %10
}

LLVM IR (-O2):
@switch.table.window_needs_option = [9 x i8] c"\01\00\00\01\01\00\01\00\01"
define zeroext i8 @window_needs_option(i8 zeroext %0) {
%2 = add i8 %0, -6
%3 = icmp ult i8 %2, 9
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i8 %2 to i64
%6 = getelementptr inbounds [9 x i8], [9 x i8]* @switch.table.window_needs_option, i64 0, i64 %5
%7 = load i8, i8* %6
br label %8
8: ; preds = %4, %1
%9 = phi i8 [ 0, %1 ], [ %7, %4 ]
ret i8 %9
}
int test_imm_7Euint32_reg(unsigned int val) {
  return ((val) & (0x7E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Euint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x7e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Euint32_reg>:
test   $0x7e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_7Euint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 126
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -20, i32 -40
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_imm_7Euint32_reg(i32 %0) {
%2 = and i32 %0, 126
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char *, char const *, int);
char *prefixed(char *string, const char *prefix) {
  int len = strlen(prefix);
  return strncmp(string, prefix, len) ? NULL : string + len;
}


x86 assembly (clang, -O0):
<prefixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1161 <prefixed+0x41>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    1170 <prefixed+0x50>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefixed>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
movslq %ebp,%rdx
add    %r14,%rdx
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rdx,%rcx
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @prefixed(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i64 @strncmp(i8* %8, i8* %9, i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %2
br label %19
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
br label %19
19: ; preds = %14, %13
%20 = phi i8* [ null, %13 ], [ %18, %14 ]
ret i8* %20
}

LLVM IR (-O2):
define i8* @prefixed(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = select i1 %5, i8* %7, i8* null
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ atanl(long double);
long double cosl(int /*<<< orphan*/);
long double __attribute__((no)) cosatanl_(long double x) {
  return cosl(atanl(x));
}


x86 assembly (clang, -O0):
<cosatanl_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <atanl@plt>
mov    %eax,%edi
call   1040 <cosl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosatanl_>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <atanl@plt>
mov    %eax,%edi
add    $0x18,%rsp
jmp    1040 <cosl@plt>

LLVM IR (-O0):
define x86_fp80 @cosatanl_(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i32 @atanl(x86_fp80 %3)
%5 = call x86_fp80 @cosl(i32 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @cosatanl_(x86_fp80 %0) {
%2 = tail call i32 @atanl(x86_fp80 %0)
%3 = tail call x86_fp80 @cosl(i32 %2)
ret x86_fp80 %3
}
void movsd(void *dest, const void *src, int len, int decrement) {
  if (decrement) {
    __asm__ volatile("std");
  }

  __asm__ volatile("rep movsd" ::"S"(src), "D"(dest), "c"(len) : "memory");
  if (decrement) {
    __asm__ volatile("cld");
  }
}


x86 assembly (clang, -O0):
<movsd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     111d <movsd+0x1d>
std
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%ecx
rep movsl %ds:(%rsi),%es:(%rdi)
cmpl   $0x0,-0x18(%rbp)
je     1135 <movsd+0x35>
cld
pop    %rbp
ret

x86 assembly (clang, -O2):
<movsd>:
mov    %ecx,%eax
mov    %edx,%ecx
test   %eax,%eax
je     110d <movsd+0xd>
std
rep movsl %ds:(%rsi),%es:(%rdi)
cld
ret
rep movsl %ds:(%rsi),%es:(%rdi)
ret

LLVM IR (-O0):
define void @movsd(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %4
br label %12
12: ; preds = %11, %4
%13 = load i8*, i8** %6
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %12
br label %19
19: ; preds = %18, %12
ret void
}

LLVM IR (-O2):
define void @movsd(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %7, label %6
6: ; preds = %4
tail call void asm sideeffect "std", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "rep movsd", "{si},{di},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0, i32 %2)
tail call void asm sideeffect "cld", "~{dirflag},~{fpsr},~{flags}"()
br label %8
7: ; preds = %4
tail call void asm sideeffect "rep movsd", "{si},{di},{cx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %1, i8* %0, i32 %2)
br label %8
8: ; preds = %7, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ reverse(unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(int argc, char *argv[]) {
  unsigned int d = 0;
  printf("Input number \n");
  scanf("%d", &d);
  reverse(d);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
call   1030 <reverse@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <reverse@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Input number \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%8 = load i32, i32* %5
%9 = call i32 @reverse(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [14 x i8] c"Input number \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @reverse(i32 %7)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int verify_pw(char *pw) {
  int auth;
  auth = strcmp(pw, "12345678");
  return auth;
}


x86 assembly (clang, -O0):
<verify_pw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_pw>:
lea    0xee9(%rip),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"12345678\00"
define i32 @verify_pw(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"12345678\00"
define i32 @verify_pw(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
unsigned int bin_search(char c, char *xs, unsigned int lo, unsigned int hi) {
  while (lo < hi) {
    unsigned int mid = lo + (hi - lo) / 2;
    if (xs[mid] < c) {
      lo = mid + 1;
    } else {
      hi = mid;
    }
  }
  return lo;
}


x86 assembly (clang, -O0):
<bin_search>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jae    1161 <bin_search+0x61>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
jge    1156 <bin_search+0x56>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <bin_search+0x5c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <bin_search+0x14>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_search>:
mov    %edx,%eax
cmp    %edx,%ecx
ja     1117 <bin_search+0x17>
jmp    1130 <bin_search+0x30>
nopl   0x0(%rax,%rax,1)
mov    %r8d,%ecx
cmp    %eax,%ecx
jbe    1130 <bin_search+0x30>
mov    %ecx,%edx
sub    %eax,%edx
shr    %edx
lea    (%rdx,%rax,1),%r8d
cmp    %dil,(%rsi,%r8,1)
jge    1110 <bin_search+0x10>
add    %edx,%eax
add    $0x1,%eax
cmp    %eax,%ecx
ja     1117 <bin_search+0x17>
ret

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

LLVM IR (-O2):
define i32 @bin_search(i8 signext %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %3, %2
br i1 %5, label %6, label %20
6: ; preds = %4, %6
%7 = phi i32 [ %18, %6 ], [ %2, %4 ]
%8 = phi i32 [ %17, %6 ], [ %3, %4 ]
%9 = sub i32 %8, %7
%10 = lshr i32 %9, 1
%11 = add i32 %10, %7
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %1, i64 %12
%14 = load i8, i8* %13
%15 = icmp slt i8 %14, %0
%16 = add i32 %11, 1
%17 = select i1 %15, i32 %8, i32 %11
%18 = select i1 %15, i32 %16, i32 %7
%19 = icmp ugt i32 %17, %18
br i1 %19, label %6, label %20
20: ; preds = %6, %4
%21 = phi i32 [ %2, %4 ], [ %18, %6 ]
ret i32 %21
}
/* Variables and functions */
int strCompare(char *first, char *second) {
  for (; *first == *second; ++first, ++second)
    if (*first == 0)
      return true;
  return false;
}


x86 assembly (clang, -O0):
<strCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strCompare+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strCompare+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1167 <strCompare+0x67>
jmp    1143 <strCompare+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strCompare+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCompare>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <strCompare+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <strCompare+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <strCompare+0x10>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @strCompare(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %3
br label %27
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
store i32 0, i32* %3
br label %27
27: ; preds = %26, %19
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @strCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
int /*<<< orphan*/ settimeofday(struct timeval *, int /*<<< orphan*/);
int main(void) {
  struct timeval tv;
  gettimeofday(&tv, 0);
  settimeofday(&tv, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <settimeofday@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <settimeofday@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = call i32 @settimeofday(%struct.timeval* %2, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = call i32 @settimeofday(%struct.timeval* %1, i32 0)
ret i32 0
}
/* Variables and functions */
scalar_t__ isExtendedLetter(unsigned char);
scalar_t__ isRegularLetter(unsigned char);
short int isLetter(unsigned char chrsource) {
  if (isRegularLetter(chrsource) || isExtendedLetter(chrsource))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1030 <isRegularLetter@plt>
cmp    $0x0,%rax
jne    1154 <isLetter+0x34>
movzbl -0x3(%rbp),%edi
call   1040 <isExtendedLetter@plt>
cmp    $0x0,%rax
je     115f <isLetter+0x3f>
movw   $0x1,-0x2(%rbp)
jmp    1165 <isLetter+0x45>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLetter>:
push   %rbx
mov    %edi,%ebx
call   1030 <isRegularLetter@plt>
mov    %rax,%rcx
mov    $0x1,%ax
test   %rcx,%rcx
je     1136 <isLetter+0x16>
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <isExtendedLetter@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @isLetter(i8 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isRegularLetter(i8 zeroext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @isExtendedLetter(i8 zeroext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i16 1, i16* %2
br label %13
12: ; preds = %7
store i16 0, i16* %2
br label %13
13: ; preds = %12, %11
%14 = load i16, i16* %2
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @isLetter(i8 zeroext %0) {
%2 = tail call i64 @isRegularLetter(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isExtendedLetter(i8 zeroext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i16
br label %8
8: ; preds = %4, %1
%9 = phi i16 [ 1, %1 ], [ %7, %4 ]
ret i16 %9
}
void *test_anti_range_100(unsigned char n) {
  extern void *alloc_anti_range_100(unsigned char)
      __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_100(n);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     113d <test_anti_range_100+0x2d>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jg     113d <test_anti_range_100+0x2d>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <alloc_anti_range_100@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x3,%dil
mov    $0xff,%eax
cmovb  %eax,%edi
jmp    1030 <alloc_anti_range_100@plt>

LLVM IR (-O0):
define i8* @test_anti_range_100(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 -1, i8* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i8, i8* %2
%13 = call i8* @alloc_anti_range_100(i8 zeroext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_100(i8 zeroext %0) {
%2 = icmp ult i8 %0, 3
%3 = select i1 %2, i8 -1, i8 %0
%4 = tail call i8* @alloc_anti_range_100(i8 zeroext %3)
ret i8* %4
}