xunge/DecIR huggingface dataset:
/* Variables and functions */
int max(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int nums[5] = {5, 9, 21, 17, 39};
  printf("largest number is: %d", max(nums, 5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <max@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <max@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [5 x i32] [i32 5, i32 9, i32 21, i32 17, i32 39]
@.str = [22 x i8] c"largest number is: %d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [5 x i32] [i32 5, i32 9, i32 21, i32 17, i32 39]
@.str = [22 x i8] c"largest number is: %d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @max(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int upkm(char *, char *);
int main(int argc, char **argv) {
  int ret = -1;
  if (argc < 3) {
    printf("Uso: %s input.pkm output.pkm\n", argv[0]);
  } else {
    ret = upkm(argv[1], argv[2]);
  }
  return ret;
}


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)
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    115f <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    1177 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <upkm@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jg     113c <main+0x1c>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
pop    %rax
jmp    1040 <upkm@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Uso: %s input.pkm output.pkm\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 -1, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %14
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 ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %22
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @upkm(i8* %17, i8* %20)
store i32 %21, i32* %6
br label %22
22: ; preds = %14, %9
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
@.str = [30 x i8] c"Uso: %s input.pkm output.pkm\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @upkm(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
%14 = phi i32 [ -1, %4 ], [ %12, %7 ]
ret i32 %14
}
void swap(int *arr, int i1, int i2) {
  int tmp;
  tmp = arr[i1];
  arr[i1] = arr[i2];
  arr[i2] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int a(int x) { return (x > 0 ? x : -x) >= 0; }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <a+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <a+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x0,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @a(i32 %0) {
ret i32 1
}
int get_len(char s[]) {
  int i = 0;
  while (s[i] != '\0')
    i++;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @get_len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @get_len(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
}
void caller_1_1_1_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_2_1_2_2() {
ret void
}
/* Variables and functions */
long double fma(long double x, long double y, long double z) {
  return (x * y) + z;
}


x86 assembly (clang, -O0):
<fma>:
push   %rbp
mov    %rsp,%rbp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fldt   -0x30(%rbp)
fxch   %st(2)
fmulp  %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fma>:
fldt   0x28(%rsp)
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fma(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = load x86_fp80, x86_fp80* %4
%8 = load x86_fp80, x86_fp80* %5
%9 = load x86_fp80, x86_fp80* %6
%10 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 %8, x86_fp80 %9)
ret x86_fp80 %10
}

LLVM IR (-O2):
define x86_fp80 @fma(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *xmalloc(size_t sz) {
  void *out;
  out = malloc(sz);
  if (!out) {
    perror("Failed xmalloc: ");
    abort();
  }
  return out;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1167 <xmalloc+0x37>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Failed xmalloc: \00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"Failed xmalloc: \00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: mkfifo [-m mode] fifo_name ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: mkfifo [-m mode] fifo_name ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: mkfifo [-m mode] fifo_name ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test_print() { printf("test_print()\n"); }


x86 assembly (clang, -O0):
<test_print>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"test_print()\0A\00"
define void @test_print() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"test_print()\00"
define void @test_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned short mod_N_pm(unsigned short a) {
  if (a > 624 - 1)
    return a - 624;
  else
    return a;
}


x86 assembly (clang, -O0):
<mod_N_pm>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
cmp    $0x26f,%eax
jle    112c <mod_N_pm+0x2c>
movzwl -0x4(%rbp),%eax
sub    $0x270,%eax
mov    %ax,-0x2(%rbp)
jmp    1134 <mod_N_pm+0x34>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_N_pm>:
lea    -0x270(%rdi),%eax
cmp    $0x270,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @mod_N_pm(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = icmp sgt i32 %5, 623
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = sub nsw i32 %9, 624
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
br label %14
12: ; preds = %1
%13 = load i16, i16* %3
store i16 %13, i16* %2
br label %14
14: ; preds = %12, %7
%15 = load i16, i16* %2
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @mod_N_pm(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 623
%3 = add i16 %0, -624
%4 = select i1 %2, i16 %3, i16 %0
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ freework();
int /*<<< orphan*/ plexit(char const *);
void myexit(const char *msg) {
  freework();
  plexit(msg);
}


x86 assembly (clang, -O0):
<myexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <freework@plt>
mov    -0x8(%rbp),%rdi
call   1030 <plexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myexit>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <freework@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <plexit@plt>

LLVM IR (-O0):
define void @myexit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @freework()
%4 = load i8*, i8** %2
%5 = call i32 @plexit(i8* %4)
ret void
}

LLVM IR (-O2):
define void @myexit(i8* %0) {
%2 = tail call i32 (...) @freework()
%3 = tail call i32 @plexit(i8* %0)
ret void
}
void test78_FakeLed_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test78_FakeLed_targetInit__I() {
ret void
}
void Swaps(short *a, short *b) {
  short t = *a;
  *a = *b;
  *b = t;
}


x86 assembly (clang, -O0):
<Swaps>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swaps>:
movzwl (%rdi),%eax
movzwl (%rsi),%ecx
mov    %cx,(%rdi)
mov    %ax,(%rsi)
ret

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

LLVM IR (-O2):
define void @Swaps(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = load i16, i16* %1
store i16 %4, i16* %0
store i16 %3, i16* %1
ret void
}
/* Variables and functions */
float equationStep2(float, float, float);
float xyz2Step2(float x, float y, float z) {
  return equationStep2(x, y, z) - equationStep2(0, 0, 0);
}


x86 assembly (clang, -O0):
<xyz2Step2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <equationStep2@plt>
movss  %xmm0,-0x10(%rbp)
xorps  %xmm2,%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1030 <equationStep2@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xyz2Step2>:
push   %rax
call   1030 <equationStep2@plt>
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1030 <equationStep2@plt>
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xyz2Step2(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @equationStep2(float %7, float %8, float %9)
%11 = call float @equationStep2(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%12 = fsub float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @xyz2Step2(float %0, float %1, float %2) {
%4 = tail call float @equationStep2(float %0, float %1, float %2)
%5 = tail call float @equationStep2(float 0.000000e+00, float 0.000000e+00, float 0.000000e+00)
%6 = fsub float %4, %5
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ GyrCon_lc898122(int);
int /*<<< orphan*/ SrvCon_lc898122(int, int);
void OisEna_lc898122(void) {
  SrvCon_lc898122(0x00, 0x01);
  SrvCon_lc898122(0x01, 0x01);
  GyrCon_lc898122(0x01);
}


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

x86 assembly (clang, -O2):
<OisEna_lc898122>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <SrvCon_lc898122@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <SrvCon_lc898122@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <GyrCon_lc898122@plt>

LLVM IR (-O0):
define void @OisEna_lc898122() {
%1 = call i32 @SrvCon_lc898122(i32 0, i32 1)
%2 = call i32 @SrvCon_lc898122(i32 1, i32 1)
%3 = call i32 @GyrCon_lc898122(i32 1)
ret void
}

LLVM IR (-O2):
define void @OisEna_lc898122() {
%1 = tail call i32 @SrvCon_lc898122(i32 0, i32 1)
%2 = tail call i32 @SrvCon_lc898122(i32 1, i32 1)
%3 = tail call i32 @GyrCon_lc898122(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displayBits(unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, unsigned int *);
int main(void) {
  unsigned x;
  printf("Enter an unsigned integer: ");
  scanf("%u", &x);
  displayBits(x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <displayBits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter an unsigned integer: \00"
@.str.1 = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @displayBits(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter an unsigned integer: \00"
@.str.1 = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @displayBits(i32 %5)
ret i32 0
}
char FastByteDiv(char x, char y) { return x / y; }


x86 assembly (clang, -O0):
<FastByteDiv>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cltd
idiv   %ecx
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastByteDiv>:
mov    %edi,%eax
cwtd
idiv   %si
ret

LLVM IR (-O0):
define signext i8 @FastByteDiv(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = sdiv i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @FastByteDiv(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i16
%4 = sext i8 %1 to i16
%5 = sdiv i16 %3, %4
%6 = trunc i16 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
size_t mem_abs(uint8_t low, uint8_t high, uint8_t off) {
  return (uint16_t)off + (uint16_t)low + ((uint16_t)high << 8);
}


x86 assembly (clang, -O0):
<mem_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    %ecx,%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
add    %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_abs>:
add    %edx,%edi
shl    $0x8,%esi
add    %edi,%esi
movslq %esi,%rax
ret

LLVM IR (-O0):
define i64 @mem_abs(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i64, i64* %4
%10 = trunc i64 %9 to i32
%11 = add nsw i32 %8, %10
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = add nsw i32 %11, %14
%16 = sext i32 %15 to i64
ret i64 %16
}

LLVM IR (-O2):
define i64 @mem_abs(i64 %0, i64 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = trunc i64 %0 to i32
%6 = add nsw i32 %4, %5
%7 = trunc i64 %1 to i32
%8 = shl i32 %7, 8
%9 = add nsw i32 %6, %8
%10 = sext i32 %9 to i64
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ get_label(int /*<<< orphan*/ *, char const *,
                             int /*<<< orphan*/ *);
ssize_t smack_label_length(const char *label) {
  return get_label(NULL, label, NULL);
}


x86 assembly (clang, -O0):
<smack_label_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
call   1030 <get_label@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smack_label_length>:
mov    %rdi,%rsi
xor    %edi,%edi
xor    %edx,%edx
jmp    1030 <get_label@plt>

LLVM IR (-O0):
define i32 @smack_label_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_label(i32* null, i8* %3, i32* null)
ret i32 %4
}

LLVM IR (-O2):
define i32 @smack_label_length(i8* %0) {
%2 = tail call i32 @get_label(i32* null, i8* %0, i32* null)
ret i32 %2
}
/* Variables and functions */
int popcount_8(unsigned int);
int popcount_16(unsigned int v) { return popcount_8(v >> 8) + popcount_8(v); }


x86 assembly (clang, -O0):
<popcount_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x8,%edi
call   1030 <popcount_8@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <popcount_8@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<popcount_16>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <popcount_8@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <popcount_8@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @popcount_16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 8
%5 = call i32 @popcount_8(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @popcount_8(i32 %6)
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @popcount_16(i32 %0) {
%2 = lshr i32 %0, 8
%3 = tail call i32 @popcount_8(i32 %2)
%4 = tail call i32 @popcount_8(i32 %0)
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ c;

/* Variables and functions */
int __WORDSIZE;
void fun() {
  char c;
  char *ret;
  ret = &c + sizeof(c) + 2 * (__WORDSIZE / 8);
  *ret += 0x7;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
lea    -0x1(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
shl    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x7,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
@__WORDSIZE = global i32 0
define void @fun() {
%1 = alloca i8
%2 = alloca i8*
%3 = getelementptr inbounds i8, i8* %1, i64 1
%4 = load i32, i32* @__WORDSIZE
%5 = sdiv i32 %4, 8
%6 = mul nsw i32 2, %5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = add nsw i32 %11, 7
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
ret void
}

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @fun() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ncurs_cleanup();
int /*<<< orphan*/ ncurs_init();
int main() {
  ncurs_init();
  ncurs_cleanup();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ncurs_init@plt>
mov    $0x0,%al
call   1030 <ncurs_cleanup@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <ncurs_init@plt>
xor    %eax,%eax
call   1030 <ncurs_cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ncurs_init()
%2 = call i32 (...) @ncurs_cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ncurs_init()
%2 = tail call i32 (...) @ncurs_cleanup()
ret i32 0
}
/* Variables and functions */
int exp(double);
double f(double x) { return (exp(x) - 2 * x - 1); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
cvtsi2sd %eax,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xec0(%rip),%xmm1
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <exp@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
addsd  0xec9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @exp(double %3)
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %6, double %5)
%8 = fsub double %7, 1.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call i32 @exp(double %0)
%3 = sitofp i32 %2 to double
%4 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %3)
%5 = fadd double %4, -1.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ EOPNOTSUPP;
int /*<<< orphan*/ errno;
int get_nodelay(int fd, void *optval, int *optlen) {
  errno = EOPNOTSUPP;
  return -1;
}


x86 assembly (clang, -O0):
<get_nodelay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_nodelay>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @get_nodelay(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @EOPNOTSUPP
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EOPNOTSUPP = global i32 0
@errno = global i32 0
define i32 @get_nodelay(i32 %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @EOPNOTSUPP
store i32 %4, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void zraiseOutOfMemory(const char *caller) {
  printf("Error: Out of memory in %s().\n", caller);
}


x86 assembly (clang, -O0):
<zraiseOutOfMemory>:
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):
<zraiseOutOfMemory>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error: Out of memory in %s().\0A\00"
define void @zraiseOutOfMemory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error: Out of memory in %s().\0A\00"
define void @zraiseOutOfMemory(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalpha(char);
int str_is_string(char *input) {
  while (*input) {
    if (!isalpha(*input))
      return 1;
    input++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<str_is_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <str_is_string+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%eax
jne    114a <str_is_string+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1162 <str_is_string+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <str_is_string+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_is_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1137 <str_is_string+0x27>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <isalpha@plt>
test   %eax,%eax
je     1137 <str_is_string+0x27>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <str_is_string+0x10>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_is_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isalpha(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
ret i32 1
}
/* Variables and functions */
scalar_t__ isspace(char);
char *blankskip(register char *s) {
  while (isspace(*s) && *s)
    ++s;
  return (s);
}


x86 assembly (clang, -O0):
<blankskip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     114a <blankskip+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    115a <blankskip+0x4a>
jmp    116b <blankskip+0x5b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <blankskip+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blankskip>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <blankskip+0x29>
cmpb   $0x0,(%rbx)
je     1139 <blankskip+0x29>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <blankskip+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @blankskip(i8* %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @isspace(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %1, %9
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %9, %1
%15 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %5 ]
ret i8* %15
}
int test_imm_EEuint16_mem(unsigned short *val) {
  return ((*val) & (0xEE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_EEuint16_mem>:
testb  $0xee,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EEuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 238
%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_EEuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 238
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int get_current_time(void) {
  struct timeval curtime;
  gettimeofday(&curtime, NULL);
  return (curtime.tv_sec * 1000000) + curtime.tv_usec;
}


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

x86 assembly (clang, -O2):
<get_current_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @get_current_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @get_current_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
void ff_hevc_put_hevc_uni_w_epel_hv32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_hv32_10_sse4() {
ret void
}
unsigned int abs(signed int value) {
  if (value < 0) {
    return -value;
  } else {
    return value;
  }
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1124 <abs+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%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* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* %3
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int test2(int);
int test4(int b) { return test2(b ?: 1); }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1135 <test4+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <test4+0x32>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1142 <test4+0x32>
mov    -0xc(%rbp),%edi
call   1030 <test2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <test2@plt>

LLVM IR (-O0):
define i32 @test4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %5
%8 = phi i32 [ %3, %5 ], [ 1, %6 ]
%9 = call i32 @test2(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @test4(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i32 @test2(i32 %3)
ret i32 %4
}
__attribute__((used)) int _isatty(int fd) { return 1; }


x86 assembly (clang, -O0):
<_isatty>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @_isatty to i8*)], section "llvm.metadata"
define i32 @_isatty(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 1
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i32)* @_isatty to i8*)], section "llvm.metadata"
define i32 @_isatty(i32 %0) {
ret i32 1
}
int sentence_len(char *buf) { return 0; }


x86 assembly (clang, -O0):
<sentence_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sentence_len>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sentence_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @sentence_len(i8* nocapture readnone %0) {
ret i32 0
}
void border_nw_ext_diagonal_special_sand_short_hori(unsigned char *pic,
                                                    unsigned char *mirr) {
  *pic = 0x2B;
  *mirr = 0x01 | 0x02;
}


x86 assembly (clang, -O0):
<border_nw_ext_diagonal_special_sand_short_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2b,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nw_ext_diagonal_special_sand_short_hori>:
movb   $0x2b,(%rdi)
movb   $0x3,(%rsi)
ret

LLVM IR (-O0):
define void @border_nw_ext_diagonal_special_sand_short_hori(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
store i8 43, i8* %5
%6 = load i8*, i8** %4
store i8 3, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nw_ext_diagonal_special_sand_short_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 43, i8* %0
store i8 3, i8* %1
ret void
}
double residential_calculation(int consumption) {
  double amount_due = 0.0;
  amount_due = 6.0 + (consumption * 0.052);
  return amount_due;
}


x86 assembly (clang, -O0):
<residential_calculation>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<residential_calculation>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @residential_calculation(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
store double 0.000000e+00, double* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = call double @llvm.fmuladd.f64(double %5, double 5.200000e-02, double 6.000000e+00)
store double %6, double* %3
%7 = load double, double* %3
ret double %7
}

LLVM IR (-O2):
define double @residential_calculation(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 5.200000e-02, double 6.000000e+00)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ mymemcpy(char *, char *, unsigned int);
void mypushchar(char *dst, unsigned len, unsigned pos, char c) {
  mymemcpy(dst + pos + 1, dst + pos, len - pos - 1);
  dst[pos] = c;
}


x86 assembly (clang, -O0):
<mypushchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%eax
add    %rax,%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%eax
add    %rax,%rsi
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <mymemcpy@plt>
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mypushchar>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdi,%rbx
mov    %edx,%ebp
lea    (%rdi,%rbp,1),%rax
add    %rbp,%rdi
add    $0x1,%rdi
not    %edx
add    %esi,%edx
mov    %rax,%rsi
call   1030 <mymemcpy@plt>
mov    %r14b,(%rbx,%rbp,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @mypushchar(i8* %0, i32 %1, i32 %2, i8 signext %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %7
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = sub i32 %18, %19
%21 = sub i32 %20, 1
%22 = call i32 @mymemcpy(i8* %13, i8* %17, i32 %21)
%23 = load i8, i8* %8
%24 = load i8*, i8** %5
%25 = load i32, i32* %7
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 %23, i8* %27
ret void
}

LLVM IR (-O2):
define void @mypushchar(i8* %0, i32 %1, i32 %2, i8 signext %3) {
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = xor i32 %2, -1
%9 = add i32 %8, %1
%10 = tail call i32 @mymemcpy(i8* %7, i8* %6, i32 %9)
store i8 %3, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void warning(char msg[]) { printf("Warning: %s\n", msg); }


x86 assembly (clang, -O0):
<warning>:
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):
<warning>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @warning(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}