xunge/DecIR huggingface dataset:
/* Variables and functions */
bool isFlag(char c) {
  return (c == '-' || c == '+' || c == ' ' || c == '#' || c == '0');
}


x86 assembly (clang, -O0):
<isFlag>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     115f <isFlag+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     115f <isFlag+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     115f <isFlag+0x5f>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x23,%ecx
mov    %al,-0x2(%rbp)
je     115f <isFlag+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isFlag>:
cmp    $0x2d,%dil
ja     1120 <isFlag+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x280900000000,%rdx
bt     %rcx,%rdx
jae    1120 <isFlag+0x20>
ret
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isFlag(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 45
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 43
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 32
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 35
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 48
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isFlag(i8 signext %0) {
switch i8 %0, label %2 [
i8 45, label %5
i8 43, label %5
i8 35, label %5
i8 32, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 48
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
int _abs(int number) {
  int const mask = number >> ((sizeof(int) * 8) - 1);
  return (number + mask) ^ mask;
}


x86 assembly (clang, -O0):
<_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_abs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
int lps(int n) {
  if (n == 1)
    return (1);
  return (2 * lps(n / 2) - 1);
}


x86 assembly (clang, -O0):
<lps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1131 <lps+0x21>
movl   $0x1,-0x4(%rbp)
jmp    114c <lps+0x3c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <lps@plt>
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lps>:
cmp    $0x1,%edi
je     1121 <lps+0x21>
mov    %edi,%eax
nopw   0x0(%rax,%rax,1)
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
and    $0xfffffffe,%edi
cmp    $0x2,%edi
mov    %eax,%edi
jne    1110 <lps+0x10>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @lps(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sdiv i32 %8, 2
%10 = call i32 @lps(i32 %9)
%11 = mul nsw i32 2, %10
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @lps(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = sdiv i32 %4, 2
%6 = and i32 %4, -2
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int, int);
int Method(char *self, int a, int b, int c) {
  printf("Method reached with args %s %d %d %d\n", self, a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<Method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Method>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xedb(%rip),%rdi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <printf@plt>
add    %ebx,%ebp
add    %r14d,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Method reached with args %s %d %d %d\0A\00"
define i32 @Method(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %8
%18 = add nsw i32 %16, %17
ret i32 %18
}

LLVM IR (-O2):
@.str = [38 x i8] c"Method reached with args %s %d %d %d\0A\00"
define i32 @Method(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i32 %3)
%6 = add nsw i32 %2, %1
%7 = add nsw i32 %6, %3
ret i32 %7
}
long double longdouble_ignoring_unsignedchar(long double x, unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<longdouble_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %al,-0x11(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<longdouble_ignoring_unsignedchar>:
fldt   0x8(%rsp)
ret

LLVM IR (-O0):
define x86_fp80 @longdouble_ignoring_unsignedchar(x86_fp80 %0, i8 zeroext %1) {
%3 = alloca x86_fp80
%4 = alloca i8
store x86_fp80 %0, x86_fp80* %3
store i8 %1, i8* %4
%5 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @longdouble_ignoring_unsignedchar(x86_fp80 returned %0, i8 zeroext %1) {
ret x86_fp80 %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x3d() {
  Assert_real((isalnum(61) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              310, ("isalnum should be 0 for ="));
}


x86 assembly (clang, -O0):
<t_isalnum_0x3d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x136,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x3d>:
push   %rax
mov    $0x3d,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x136,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for =\00"
define void @t_isalnum_0x3d() {
%1 = call i64 @isalnum(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for =\00"
define void @t_isalnum_0x3d() {
%1 = tail call i64 @isalnum(i32 61)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 310, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *ft_memset(void *s, int c, size_t n) {
  while (n > 0) {
    ((char *)s)[n - 1] = c;
    n--;
  }
  return (s);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jbe    113f <ft_memset+0x3f>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    110f <ft_memset+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @ft_memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
br label %7
7: ; preds = %10, %3
%8 = load i64, i64* %6
%9 = icmp ugt i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %5
%12 = trunc i32 %11 to i8
%13 = load i8*, i8** %4
%14 = load i64, i64* %6
%15 = sub i64 %14, 1
%16 = getelementptr inbounds i8, i8* %13, i64 %15
store i8 %12, i8* %16
%17 = load i64, i64* %6
%18 = add i64 %17, -1
store i64 %18, i64* %6
br label %7
19: ; preds = %7
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
int arch_pointersize() { return 2; }


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

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

LLVM IR (-O0):
define i32 @arch_pointersize() {
ret i32 2
}

LLVM IR (-O2):
define i32 @arch_pointersize() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_integer_to_float();
int /*<<< orphan*/ test_longlong_integer_to_float();
int /*<<< orphan*/ tst_integer();
int /*<<< orphan*/ tst_longlong_integer();
main() {
  test_integer_to_float();
  tst_integer();
  test_longlong_integer_to_float();
  tst_longlong_integer();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_integer_to_float@plt>
mov    $0x0,%al
call   1050 <tst_integer@plt>
mov    $0x0,%al
call   1060 <test_longlong_integer_to_float@plt>
mov    $0x0,%al
call   1030 <tst_longlong_integer@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_integer_to_float@plt>
xor    %eax,%eax
call   1050 <tst_integer@plt>
xor    %eax,%eax
call   1060 <test_longlong_integer_to_float@plt>
xor    %eax,%eax
call   1030 <tst_longlong_integer@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_integer_to_float()
%3 = call i32 (...) @tst_integer()
%4 = call i32 (...) @test_longlong_integer_to_float()
%5 = call i32 (...) @tst_longlong_integer()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_integer_to_float()
%2 = tail call i32 (...) @tst_integer()
%3 = tail call i32 (...) @test_longlong_integer_to_float()
%4 = tail call i32 (...) @tst_longlong_integer()
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog, int rc) {
  fprintf(stderr, "usage: %s [-n] filename bufferSize nr_of_loops\n", prog);
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [-n] filename bufferSize nr_of_loops\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* %4
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: %s [-n] filename bufferSize nr_of_loops\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 %1)
unreachable
}
void s5pv310_default_mshci(void) {}


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

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

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

LLVM IR (-O2):
define void @s5pv310_default_mshci() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned char *tiger2_file(unsigned char *, int /*<<< orphan*/ *);
unsigned char *hash_file_tiger2(unsigned char *out, FILE *fp) {
  return tiger2_file(out, fp);
}


x86 assembly (clang, -O0):
<hash_file_tiger2>:
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 <tiger2_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_file_tiger2>:
jmp    1030 <tiger2_file@plt>

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

LLVM IR (-O2):
define i8* @hash_file_tiger2(i8* %0, i32* %1) {
%3 = tail call i8* @tiger2_file(i8* %0, i32* %1)
ret i8* %3
}
int test_imm_10int16_mem(short *val) {
  return ((*val) & (-0x10 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_10int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0xfffffff0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_10int16_mem>:
cmpw   $0x10,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_10int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 16
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double arcsec2deg(double x) { return (x / 3600.0); }


x86 assembly (clang, -O0):
<arcsec2deg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<arcsec2deg>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @arcsec2deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 3.600000e+03
ret double %4
}

LLVM IR (-O2):
define double @arcsec2deg(double %0) {
%2 = fdiv double %0, 3.600000e+03
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ver;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ ckfwrite(char *, int, int /*<<< orphan*/ *);
void scriviHeader(FILE *fp) {
  char ver[3];
  ver[0] = 'F';
  ver[1] = 'C';
  ver[2] = 1;
  ckfwrite(ver, sizeof(ver), fp);
}


x86 assembly (clang, -O0):
<scriviHeader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x46,-0xb(%rbp)
movb   $0x43,-0xa(%rbp)
movb   $0x1,-0x9(%rbp)
lea    -0xb(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x3,%esi
call   1030 <ckfwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scriviHeader>:
push   %rax
mov    %rdi,%rdx
movw   $0x4346,0x5(%rsp)
movb   $0x1,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
call   1030 <ckfwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @scriviHeader(i32* %0) {
%2 = alloca i32*
%3 = alloca [3 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 70, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 67, i8* %5
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 1, i8* %6
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%8 = load i32*, i32** %2
%9 = call i32 @ckfwrite(i8* %7, i32 3, i32* %8)
ret void
}

LLVM IR (-O2):
define void @scriviHeader(i32* %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8 70, i8* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
store i8 67, i8* %4
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 2
store i8 1, i8* %5
%6 = call i32 @ckfwrite(i8* %3, i32 3, i32* %0)
ret void
}
unsigned int char_size(unsigned int n) {
  unsigned int result = 0;
  while (n) {
    n = n >> 1;
    result++;
  }
  return (result >> 3) + ((result & 7) ? 1 : 0);
}


x86 assembly (clang, -O0):
<char_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <char_size+0x2f>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <char_size+0xe>
mov    -0x8(%rbp),%eax
shr    $0x3,%eax
mov    -0x8(%rbp),%esi
and    $0x7,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_size>:
xor    %ecx,%ecx
test   %edi,%edi
je     111c <char_size+0x1c>
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
shr    %eax
add    $0x1,%ecx
cmp    $0x1,%edi
mov    %eax,%edi
ja     1110 <char_size+0x10>
mov    %ecx,%eax
shr    $0x3,%eax
and    $0x7,%ecx
cmp    $0x1,%ecx
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @char_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = lshr i32 %8, 1
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = lshr i32 %13, 3
%15 = load i32, i32* %3
%16 = and i32 %15, 7
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
%20 = add i32 %14, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @char_size(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = lshr i32 %10, 3
%12 = and i32 %10, 7
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %11, %14
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "logname"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Usage: logname\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [16 x i8] c"Usage: logname\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void showtab(char **tab) {
  int i = -1;
  while (tab[++i]) {
    printf("%s\n", tab[i]);
  }
}


x86 assembly (clang, -O0):
<showtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     115b <showtab+0x4b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
jmp    1123 <showtab+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showtab>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1144 <showtab+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <showtab+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @showtab(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 -1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8**, i8*** %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %5, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load i8**, i8*** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @showtab(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
double DBL_MIN;
double vabs(double *);
int /*<<< orphan*/ vscale(double, double *, double *);
double vnorm2(double v1[3], double v2[3]) {
  double abs = vabs(v1);
  double norm = 1.0 / (abs + DBL_MIN);
  vscale(norm, v1, v2);
  return abs;
}


x86 assembly (clang, -O0):
<vnorm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <vabs@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
mov    0x2e96(%rip),%rax
addsd  (%rax),%xmm1
movsd  0xeaa(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <vscale@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnorm2>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <vabs@plt>
movsd  %xmm0,(%rsp)
mov    0x2ea5(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <vscale@plt>
movsd  (%rsp),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@DBL_MIN = global double 0.000000e+00
define double @vnorm2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%7 = load double*, double** %3
%8 = call double @vabs(double* %7)
store double %8, double* %5
%9 = load double, double* %5
%10 = load double, double* @DBL_MIN
%11 = fadd double %9, %10
%12 = fdiv double 1.000000e+00, %11
store double %12, double* %6
%13 = load double, double* %6
%14 = load double*, double** %3
%15 = load double*, double** %4
%16 = call i32 @vscale(double %13, double* %14, double* %15)
%17 = load double, double* %5
ret double %17
}

LLVM IR (-O2):
@DBL_MIN = global double 0.000000e+00
define double @vnorm2(double* %0, double* %1) {
%3 = tail call double @vabs(double* %0)
%4 = load double, double* @DBL_MIN
%5 = fadd double %3, %4
%6 = fdiv double 1.000000e+00, %5
%7 = tail call i32 @vscale(double %6, double* %0, double* %1)
ret double %3
}
int MyMax(int x, int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<MyMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <MyMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <MyMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MyMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @MyMax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @MyMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ messageprog_1(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  messageprog_1(host);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <messageprog_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <messageprog_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i32 @messageprog_1(i8* %19)
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @messageprog_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vec3_dot(double const *, double const *);
double vec3_norm(const double v[3]) { return sqrt(vec3_dot(v, v)); }


x86 assembly (clang, -O0):
<vec3_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec3_dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_norm>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @vec3_norm(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call i32 @vec3_dot(double* %3, double* %4)
%6 = call double @sqrt(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @vec3_norm(double* %0) {
%2 = tail call i32 @vec3_dot(double* %0, double* %0)
%3 = tail call double @sqrt(i32 %2)
ret double %3
}
/* Type definitions */
struct NpArrayListIterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct NpArrayListIterator *);
void np_arraylist_iterator_free(struct NpArrayListIterator *iter) {
  free(iter);
}


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

x86 assembly (clang, -O2):
<np_arraylist_iterator_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.NpArrayListIterator = type { i32 }
define void @np_arraylist_iterator_free(%struct.NpArrayListIterator* %0) {
%2 = alloca %struct.NpArrayListIterator*
store %struct.NpArrayListIterator* %0, %struct.NpArrayListIterator** %2
%3 = load %struct.NpArrayListIterator*, %struct.NpArrayListIterator** %2
%4 = call i32 @free(%struct.NpArrayListIterator* %3)
ret void
}

LLVM IR (-O2):
%struct.NpArrayListIterator = type { i32 }
define void @np_arraylist_iterator_free(%struct.NpArrayListIterator* nocapture %0) {
%2 = tail call i32 @free(%struct.NpArrayListIterator* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decstr();
int /*<<< orphan*/ holdit();
int /*<<< orphan*/ println(char const *);
int /*<<< orphan*/ vt_move(int, int);
int tst_DECSTR(const char *the_title) {
  vt_move(1, 1);
  println(the_title);
  println("(VT220 & up)");
  println("");
  println("The terminal will now soft-reset");
  holdit();
  decstr();
  return 1;
}


x86 assembly (clang, -O0):
<tst_DECSTR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <vt_move@plt>
mov    -0x8(%rbp),%rdi
call   1040 <println@plt>
lea    0xe98(%rip),%rdi
call   1040 <println@plt>
lea    0xe98(%rip),%rdi
call   1040 <println@plt>
lea    0xe8d(%rip),%rdi
call   1040 <println@plt>
mov    $0x0,%al
call   1050 <holdit@plt>
mov    $0x0,%al
call   1060 <decstr@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_DECSTR>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <vt_move@plt>
mov    %rbx,%rdi
call   1040 <println@plt>
lea    0xe9e(%rip),%rdi
call   1040 <println@plt>
lea    0xe9e(%rip),%rdi
call   1040 <println@plt>
lea    0xe93(%rip),%rdi
call   1040 <println@plt>
xor    %eax,%eax
call   1050 <holdit@plt>
xor    %eax,%eax
call   1060 <decstr@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"(VT220 & up)\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [33 x i8] c"The terminal will now soft-reset\00"
define i32 @tst_DECSTR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @vt_move(i32 1, i32 1)
%4 = load i8*, i8** %2
%5 = call i32 @println(i8* %4)
%6 = call i32 @println(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @println(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @println(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @holdit()
%10 = call i32 (...) @decstr()
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"(VT220 & up)\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [33 x i8] c"The terminal will now soft-reset\00"
define i32 @tst_DECSTR(i8* %0) {
%2 = tail call i32 @vt_move(i32 1, i32 1)
%3 = tail call i32 @println(i8* %0)
%4 = tail call i32 @println(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @println(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @println(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (...) @holdit()
%8 = tail call i32 (...) @decstr()
ret i32 1
}
/* Variables and functions */
double atan2(double, double);
double cos(double);
double dcos(double v) {
  double pi = 4.0 * atan2(1.0, 1.0);
  double rad = (v / 180.) * pi;
  return cos(rad);
}


x86 assembly (clang, -O0):
<dcos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm1
movaps %xmm1,%xmm0
call   1030 <atan2@plt>
movaps %xmm0,%xmm1
movsd  0xec0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <cos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcos>:
push   %rax
movsd  %xmm0,(%rsp)
movsd  0xed2(%rip),%xmm0
movaps %xmm0,%xmm1
call   1030 <atan2@plt>
movsd  (%rsp),%xmm0
divsd  0xec5(%rip),%xmm0
mulsd  0xec5(%rip),%xmm0
pop    %rax
jmp    1040 <cos@plt>

LLVM IR (-O0):
define double @dcos(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = call double @atan2(double 1.000000e+00, double 1.000000e+00)
%6 = fmul double 4.000000e+00, %5
store double %6, double* %3
%7 = load double, double* %2
%8 = fdiv double %7, 1.800000e+02
%9 = load double, double* %3
%10 = fmul double %8, %9
store double %10, double* %4
%11 = load double, double* %4
%12 = call double @cos(double %11)
ret double %12
}

LLVM IR (-O2):
define double @dcos(double %0) {
%2 = tail call double @atan2(double 1.000000e+00, double 1.000000e+00)
%3 = fdiv double %0, 1.800000e+02
%4 = fmul double %3, 0x400921FB54442D18
%5 = tail call double @cos(double %4)
ret double %5
}
void md_onsignal_autosave() {}


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

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

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

LLVM IR (-O2):
define void @md_onsignal_autosave() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(int, int /*<<< orphan*/ *);
void usage(void) { fatal(1, NULL); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <fatal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
define void @usage() {
%1 = call i32 @fatal(i32 1, i32* null)
ret void
}

LLVM IR (-O2):
define void @usage() {
%1 = tail call i32 @fatal(i32 1, i32* null)
ret void
}
/* Type definitions */
typedef int ptrdiff_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ inv_adst16_1d_internal_c(int /*<<< orphan*/ *const,
                                            int const, int const, int const,
                                            int /*<<< orphan*/ *, int const);
void dav1d_inv_flipadst16_1d_c(int32_t *const c, const ptrdiff_t stride,
                               const int min, const int max) {
  inv_adst16_1d_internal_c(c, stride, min, max, &c[(16 - 1) * stride], -stride);
}


x86 assembly (clang, -O0):
<dav1d_inv_flipadst16_1d_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
imul   $0xf,-0xc(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%r8
xor    %r9d,%r9d
sub    -0xc(%rbp),%r9d
call   1030 <inv_adst16_1d_internal_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dav1d_inv_flipadst16_1d_c>:
lea    (%rsi,%rsi,4),%eax
lea    (%rax,%rax,2),%eax
cltq
lea    (%rdi,%rax,4),%r8
mov    %esi,%r9d
neg    %r9d
jmp    1030 <inv_adst16_1d_internal_c@plt>

LLVM IR (-O0):
define void @dav1d_inv_flipadst16_1d_c(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = mul nsw i32 15, %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %6
%19 = sub nsw i32 0, %18
%20 = call i32 @inv_adst16_1d_internal_c(i32* %9, i32 %10, i32 %11, i32 %12, i32* %17, i32 %19)
ret void
}

LLVM IR (-O2):
define void @dav1d_inv_flipadst16_1d_c(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, 15
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = sub nsw i32 0, %1
%9 = tail call i32 @inv_adst16_1d_internal_c(i32* %0, i32 %1, i32 %2, i32 %3, i32* %7, i32 %8)
ret void
}
int sign(int nm) {
  if (nm < 0)
    return -1;
  else
    return (nm > 0);
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    112c <sign+0x2c>
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Variables and functions */
scalar_t__ COND_LS();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sls_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_LS() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sls_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LS@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sls_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LS@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sls_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_LS()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sls_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_LS()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void Reshape(int width, int height) {
  (void)width;
  (void)height;
}


x86 assembly (clang, -O0):
<Reshape>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Reshape(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
ret void
}

LLVM IR (-O2):
define void @Reshape(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ eng_keybacklight_test(int);
int /*<<< orphan*/ eng_lcdbacklight_test(int);
int /*<<< orphan*/ sleep(int);
void eng_backlighttest_toggle(int lcd_max, int key_max) {
  eng_lcdbacklight_test(0);
  eng_keybacklight_test(0);
  sleep(1);
  eng_lcdbacklight_test(lcd_max);
  eng_keybacklight_test(key_max);
  sleep(1);
}


x86 assembly (clang, -O0):
<eng_backlighttest_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <eng_lcdbacklight_test@plt>
xor    %edi,%edi
call   1040 <eng_keybacklight_test@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    -0x4(%rbp),%edi
call   1030 <eng_lcdbacklight_test@plt>
mov    -0x8(%rbp),%edi
call   1040 <eng_keybacklight_test@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eng_backlighttest_toggle>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1030 <eng_lcdbacklight_test@plt>
xor    %edi,%edi
call   1040 <eng_keybacklight_test@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
mov    %ebp,%edi
call   1030 <eng_lcdbacklight_test@plt>
mov    %ebx,%edi
call   1040 <eng_keybacklight_test@plt>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <sleep@plt>

LLVM IR (-O0):
define void @eng_backlighttest_toggle(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @eng_lcdbacklight_test(i32 0)
%6 = call i32 @eng_keybacklight_test(i32 0)
%7 = call i32 @sleep(i32 1)
%8 = load i32, i32* %3
%9 = call i32 @eng_lcdbacklight_test(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @eng_keybacklight_test(i32 %10)
%12 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @eng_backlighttest_toggle(i32 %0, i32 %1) {
%3 = tail call i32 @eng_lcdbacklight_test(i32 0)
%4 = tail call i32 @eng_keybacklight_test(i32 0)
%5 = tail call i32 @sleep(i32 1)
%6 = tail call i32 @eng_lcdbacklight_test(i32 %0)
%7 = tail call i32 @eng_keybacklight_test(i32 %1)
%8 = tail call i32 @sleep(i32 1)
ret void
}
void U420ToABGR() {}


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

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

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

LLVM IR (-O2):
define void @U420ToABGR() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ debug_instr_3(int, int, int);
void set_pc(uint16_t address) { debug_instr_3(0x02, address >> 8, address); }


x86 assembly (clang, -O0):
<set_pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
sar    $0x8,%esi
mov    -0x4(%rbp),%edx
mov    $0x2,%edi
call   1030 <debug_instr_3@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pc>:
mov    %edi,%esi
sar    $0x8,%esi
mov    %edi,%edx
mov    $0x2,%edi
jmp    1030 <debug_instr_3@plt>

LLVM IR (-O0):
define void @set_pc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = load i32, i32* %2
%6 = call i32 @debug_instr_3(i32 2, i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
define void @set_pc(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @debug_instr_3(i32 2, i32 %2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *cmd) {
  fprintf(stderr,
          "\nUsage:\t%s [-switches] address [ type [ data ] ]\n"
          "\taddress : memory address to act upon\n"
          "\ttype    : access operation type : [b]yte, [h]alfword, [w]ord\n"
          "\tdata    : data to be written\n\n"
          "Switches:\n"
          "\t-r      : read back after write\n"
          "\t-a      : do not check alignment\n"
          "\t--version | -V : print version\n"
          "\n",
          cmd);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [291 x i8] c"\0AUsage:\09%s [-switches] address [ type [ data ] ]\0A\09address : memory address to act upon\0A\09type : access operation type : [b]yte, [h]alfword, [w]ord\0A\09data : data to be written\0A\0ASwitches:\0A\09-r : read back after write\0A\09-a : do not check alignment\0A\09--version | -V : print version\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([291 x i8], [291 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [291 x i8] c"\0AUsage:\09%s [-switches] address [ type [ data ] ]\0A\09address : memory address to act upon\0A\09type : access operation type : [b]yte, [h]alfword, [w]ord\0A\09data : data to be written\0A\0ASwitches:\0A\09-r : read back after write\0A\09-a : do not check alignment\0A\09--version | -V : print version\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([291 x i8], [291 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}