xunge/DecIR huggingface dataset:
void exchange(int *x, int i, int j) {
  int t = x[i];
  x[i] = x[j];
  x[j] = t;
}


x86 assembly (clang, -O0):
<exchange>:
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):
<exchange>:
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 @exchange(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 @exchange(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
}
/* Variables and functions */
double delta_ET(double);
double delta_T(double);
double delta_UT(double utc) {
  double dt;
  dt = delta_ET(utc) - delta_T(utc);
  return (dt);
}


x86 assembly (clang, -O0):
<delta_UT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <delta_ET@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <delta_T@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_UT>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <delta_ET@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <delta_T@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @delta_UT(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @delta_ET(double %4)
%6 = load double, double* %2
%7 = call double @delta_T(double %6)
%8 = fsub double %5, %7
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @delta_UT(double %0) {
%2 = tail call double @delta_ET(double %0)
%3 = tail call double @delta_T(double %0)
%4 = fsub double %2, %3
ret double %4
}
char *mystrcat(char *dest, char *src) {
  while (*dest)
    dest++;
  while (*dest++ = *src++)
    ;
  return --dest;
}


x86 assembly (clang, -O0):
<mystrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     112a <mystrcat+0x2a>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystrcat+0xc>
jmp    112f <mystrcat+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     115e <mystrcat+0x5e>
jmp    112f <mystrcat+0x2f>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcat>:
mov    %rdi,%rax
add    $0xfffffffffffffffe,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1110 <mystrcat+0x10>
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1120 <mystrcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @mystrcat(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %9
}
void INT_Excep_ICU_IRQ1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ scalar_put();
int /*<<< orphan*/ test_ok(int /*<<< orphan*/);
int /*<<< orphan*/ vector_put();
int main() {
  initialize();
  test_ok(scalar_put());
  initialize();
  test_ok(vector_put());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initialize@plt>
mov    $0x0,%al
call   1050 <scalar_put@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
mov    $0x0,%al
call   1030 <initialize@plt>
mov    $0x0,%al
call   1040 <vector_put@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initialize@plt>
xor    %eax,%eax
call   1050 <scalar_put@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
xor    %eax,%eax
call   1030 <initialize@plt>
xor    %eax,%eax
call   1040 <vector_put@plt>
mov    %eax,%edi
call   1060 <test_ok@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 (...) @scalar_put()
%4 = call i32 @test_ok(i32 %3)
%5 = call i32 (...) @initialize()
%6 = call i32 (...) @vector_put()
%7 = call i32 @test_ok(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @scalar_put()
%3 = tail call i32 @test_ok(i32 %2)
%4 = tail call i32 (...) @initialize()
%5 = tail call i32 (...) @vector_put()
%6 = tail call i32 @test_ok(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int write(int, void *, int);
int dev_write(int fd, void *data, int count) {
  int ret = 0;
  if ((write(fd, data, count)) != count) {
    perror("write failed!");
    ret = -1;
    exit(0);
  }
  return ret;
}


x86 assembly (clang, -O0):
<dev_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     117b <dev_write+0x4b>
lea    0xe98(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x18(%rbp)
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dev_write>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
jne    1140 <dev_write+0x10>
xor    %eax,%eax
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"write failed!\00"
define i32 @dev_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @write(i32 %8, i8* %9, i32 %10)
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %7
%16 = call i32 @exit(i32 0)
unreachable
17: ; preds = %3
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
@.str = [14 x i8] c"write failed!\00"
define i32 @dev_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %3
ret i32 0
}
void pari_err_INV() {}


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

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

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

LLVM IR (-O2):
define void @pari_err_INV() {
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *xbasename(char *path) {
  char *p;
  p = strrchr(path, '/');
  return (p ? (p + 1) : path);
}


x86 assembly (clang, -O0):
<xbasename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <xbasename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <xbasename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbasename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xbasename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @xbasename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
void rop3_210_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D & stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_210_0_0>:
not    %sil
and    (%rdi),%sil
xor    %dl,%sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_210_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc4(void) {
  printf("Executing exitfunc4.\n");
  exit(0);
}


x86 assembly (clang, -O0):
<exitfunc4>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exitfunc4>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Executing exitfunc4.\0A\00"
define void @exitfunc4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Executing exitfunc4.\00"
define void @exitfunc4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int rand();
void randomizer(int arr[], int _arraySize) {
  int i;
  for (i = 0; i < _arraySize; i++)
    *(arr + i) = rand() % 20000;
}


x86 assembly (clang, -O0):
<randomizer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <randomizer+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4e20,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <randomizer+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomizer>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1162 <randomizer+0x52>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x4e20,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <randomizer+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @randomizer(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 20000
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @randomizer(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 20000
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void __ipipe_report_setsched(struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define void @__ipipe_report_setsched(%struct.task_struct* %0) {
%2 = alloca %struct.task_struct*
store %struct.task_struct* %0, %struct.task_struct** %2
ret void
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @__ipipe_report_setsched(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kd_cclear(int /*<<< orphan*/);
void kd_clear() { kd_cclear(0); }


x86 assembly (clang, -O0):
<kd_clear>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <kd_cclear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kd_clear>:
xor    %edi,%edi
jmp    1030 <kd_cclear@plt>

LLVM IR (-O0):
define void @kd_clear() {
%1 = call i32 @kd_cclear(i32 0)
ret void
}

LLVM IR (-O2):
define void @kd_clear() {
%1 = tail call i32 @kd_cclear(i32 0)
ret void
}
/* Variables and functions */
double ceil(double const);
double floor(double const);
double fracPart(const double x) {
  double nextInteger = ceil(x);
  double previousInteger = floor(x);
  return ((nextInteger - x) < (x - previousInteger) ? (nextInteger - x)
                                                    : (x - previousInteger));
}


x86 assembly (clang, -O0):
<fracPart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117d <fracPart+0x5d>
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    118c <fracPart+0x6c>
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fracPart>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <ceil@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <floor@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
subsd  %xmm0,%xmm1
minsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fracPart(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @llvm.ceil.f64(double %5)
store double %6, double* %3
%7 = load double, double* %2
%8 = call double @llvm.floor.f64(double %7)
store double %8, double* %4
%9 = load double, double* %3
%10 = load double, double* %2
%11 = fsub double %9, %10
%12 = load double, double* %2
%13 = load double, double* %4
%14 = fsub double %12, %13
%15 = fcmp olt double %11, %14
br i1 %15, label %16, label %20
16: ; preds = %1
%17 = load double, double* %3
%18 = load double, double* %2
%19 = fsub double %17, %18
br label %24
20: ; preds = %1
%21 = load double, double* %2
%22 = load double, double* %4
%23 = fsub double %21, %22
br label %24
24: ; preds = %20, %16
%25 = phi double [ %19, %16 ], [ %23, %20 ]
ret double %25
}

LLVM IR (-O2):
define double @fracPart(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
%3 = tail call double @llvm.floor.f64(double %0)
%4 = fsub double %2, %0
%5 = fsub double %0, %3
%6 = fcmp olt double %4, %5
%7 = select i1 %6, double %4, double %5
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ save_word(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int save_block(FILE *out, unsigned char *mem, int b, int sz) {
  save_word(out, b, 0);
  save_word(out, b + sz - 1, 0);
  fwrite(mem + b, 1, sz, out);
  return 1;
}


x86 assembly (clang, -O0):
<save_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
call   1040 <save_word@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
sub    $0x1,%esi
xor    %edx,%edx
call   1040 <save_word@plt>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_block>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %rsi,%r15
mov    %rdi,%r12
mov    %edx,%esi
xor    %edx,%edx
call   1040 <save_word@plt>
lea    (%rbx,%r14,1),%esi
add    $0xffffffff,%esi
mov    %r12,%rdi
xor    %edx,%edx
call   1040 <save_word@plt>
movslq %ebx,%rdi
add    %r15,%rdi
mov    $0x1,%esi
mov    %r14d,%edx
mov    %r12,%rcx
call   1030 <fwrite@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @save_block(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = call i32 @save_word(i32* %9, i32 %10, i32 0)
%12 = load i32*, i32** %5
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = add nsw i32 %13, %14
%16 = sub nsw i32 %15, 1
%17 = call i32 @save_word(i32* %12, i32 %16, i32 0)
%18 = load i8*, i8** %6
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i32, i32* %8
%23 = load i32*, i32** %5
%24 = call i32 @fwrite(i8* %21, i32 1, i32 %22, i32* %23)
ret i32 1
}

LLVM IR (-O2):
define i32 @save_block(i32* %0, i8* nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @save_word(i32* %0, i32 %2, i32 0)
%6 = add i32 %2, -1
%7 = add i32 %6, %3
%8 = tail call i32 @save_word(i32* %0, i32 %7, i32 0)
%9 = sext i32 %2 to i64
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = tail call i32 @fwrite(i8* %10, i32 1, i32 %3, i32* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sim();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  sim();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <sim@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <sim@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @sim()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @sim()
ret i32 0
}
char *index(s, c)
register char *s, c;
{
  do {
    if (*s == c)
      return (s);
  } while (*s++ != 0);
  return (0);
}


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    112e <index+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <index+0x56>
jmp    1133 <index+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110e <index+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
cmp    %sil,%cl
je     1122 <index+0x22>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <index+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @index(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i8* [ %4, %3 ], [ null, %7 ]
ret i8* %11
}
int test_imm_61int64_highword_reg(long long val) {
  return ((val >> 32) & (0x61 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_61int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x61,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_61int64_highword_reg>:
movabs $0x6100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_61int64_highword_reg(i64 %0) {
%2 = and i64 %0, 416611827712
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_quaddobl_size_limit(int k, int *szl) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(602, &k, szl, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_quaddobl_size_limit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x25a,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_quaddobl_size_limit>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x25a,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @syscon_quaddobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 602, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @syscon_quaddobl_size_limit(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 602, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
int test_imm_DDuint8_reg(unsigned char val) {
  return ((val) & (-0xDD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DDuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff23,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DDuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 35
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr,
          "\n"
          "Usage: bntools nick [options] <INPUT> [...]\n"
          "\n"
          "Options:\n"
          "   <INPUT> [...]  input FASTA/FASTQ file(s) to generate restriction "
          "map\n"
          "   -o FILE        output file ["
          "stdout"
          "]\n"
          "   -f STR         output format, tsv/cmap/bnx/txt ["
          "tsv"
          "]\n"
          "   -e STR         restriction enzyme name ["
          "BspQI"
          "]\n"
          "   -r STR         recognition sequence ["
          "GCTCTTCN^"
          "]\n"
          "   -S             select only chr1-22, chrX and chrY to nick\n"
          "   -v             show verbose messages\n"
          "   -h             show this help\n"
          "\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [459 x i8] c"\0AUsage: bntools nick [options] <INPUT> [...]\0A\0AOptions:\0A <INPUT> [...] input FASTA/FASTQ file(s) to generate restriction map\0A -o FILE output file [stdout]\0A -f STR output format, tsv/cmap/bnx/txt [tsv]\0A -e STR restriction enzyme name [BspQI]\0A -r STR recognition sequence [GCTCTTCN^]\0A -S select only chr1-22, chrX and chrY to nick\0A -v show verbose messages\0A -h show this help\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([459 x i8], [459 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [459 x i8] c"\0AUsage: bntools nick [options] <INPUT> [...]\0A\0AOptions:\0A <INPUT> [...] input FASTA/FASTQ file(s) to generate restriction map\0A -o FILE output file [stdout]\0A -f STR output format, tsv/cmap/bnx/txt [tsv]\0A -e STR restriction enzyme name [BspQI]\0A -r STR recognition sequence [GCTCTTCN^]\0A -S select only chr1-22, chrX and chrY to nick\0A -v show verbose messages\0A -h show this help\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([459 x i8], [459 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int screen_close(void) { return EXIT_FAILURE; }


x86 assembly (clang, -O0):
<screen_close>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_close>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32 @screen_close() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define i32 @screen_close() {
%1 = load i32, i32* @EXIT_FAILURE
ret i32 %1
}
void gdk_window_set_background() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_background() {
ret void
}
int flsnz(int x) {
  int r;
  __asm__("bsrl %1,%0\n" : "=r"(r) : "rm"(x));
  return r + 1;
}


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

x86 assembly (clang, -O2):
<flsnz>:
mov    %edi,-0x4(%rsp)
bsr    -0x4(%rsp),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @flsnz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsrl $1,$0\0A", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @flsnz(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0\0A", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
void CPSWClkEnable(void) {
  (*((volatile unsigned int *)((0x44E00000) + (0x14)))) = (0x2u);
  while (0 != ((*((volatile unsigned int *)((0x44E00000) + (0x14)))) &
               (0x00030000u)))
    ;
  (*((volatile unsigned int *)((0x44E00000) + (0x144)))) = (0x2u);
  while (0 == ((*((volatile unsigned int *)((0x44E00000) + (0x144)))) &
               (0x00000010u)))
    ;
}


x86 assembly (clang, -O0):
<CPSWClkEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44e00014,%eax
movl   $0x2,(%rax)
mov    $0x44e00014,%eax
mov    (%rax),%ecx
and    $0x30000,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     112b <CPSWClkEnable+0x2b>
jmp    110f <CPSWClkEnable+0xf>
mov    $0x44e00144,%eax
movl   $0x2,(%rax)
mov    $0x44e00144,%eax
mov    (%rax),%ecx
and    $0x10,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    114f <CPSWClkEnable+0x4f>
jmp    1136 <CPSWClkEnable+0x36>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPSWClkEnable>:
movl   $0x2,0x44e00014
nopl   0x0(%rax,%rax,1)
testl  $0x30000,0x44e00014
jne    1110 <CPSWClkEnable+0x10>
movl   $0x2,0x44e00144
nopl   0x0(%rax,%rax,1)
testl  $0x10,0x44e00144
je     1130 <CPSWClkEnable+0x30>
ret

LLVM IR (-O0):
define void @CPSWClkEnable() {
store volatile i32 2, i32* inttoptr (i64 1155530772 to i32*)
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 1155530772 to i32*)
%3 = and i32 %2, 196608
%4 = icmp ne i32 0, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
store volatile i32 2, i32* inttoptr (i64 1155531076 to i32*)
br label %7
7: ; preds = %11, %6
%8 = load volatile i32, i32* inttoptr (i64 1155531076 to i32*)
%9 = and i32 %8, 16
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %7
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @CPSWClkEnable() {
store volatile i32 2, i32* inttoptr (i64 1155530772 to i32*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1155530772 to i32*)
%3 = and i32 %2, 196608
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
store volatile i32 2, i32* inttoptr (i64 1155531076 to i32*)
br label %6
6: ; preds = %6, %5
%7 = load volatile i32, i32* inttoptr (i64 1155531076 to i32*)
%8 = and i32 %7, 16
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6
ret void
}
int close_thin_subvol(struct mosaic *m, struct volume *v) { return 0; }


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

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

LLVM IR (-O0):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @close_thin_subvol(%struct.mosaic* %0, %struct.volume* %1) {
%3 = alloca %struct.mosaic*
%4 = alloca %struct.volume*
store %struct.mosaic* %0, %struct.mosaic** %3
store %struct.volume* %1, %struct.volume** %4
ret i32 0
}

LLVM IR (-O2):
%struct.mosaic = type opaque
%struct.volume = type opaque
define i32 @close_thin_subvol(%struct.mosaic* nocapture readnone %0, %struct.volume* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int com_set(char *arg) {
  printf("com_set: %s\n", arg);
  return (0);
}


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

x86 assembly (clang, -O2):
<com_set>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"com_set: %s\0A\00"
define i32 @com_set(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 i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"com_set: %s\0A\00"
define i32 @com_set(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
struct _user {
  int dummy;
};

/* Variables and functions */
int pool_mem_check(struct _user *);
int user_check(struct _user *ptr) { return pool_mem_check(ptr); }


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

x86 assembly (clang, -O2):
<user_check>:
jmp    1030 <pool_mem_check@plt>

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

LLVM IR (-O2):
%struct._user = type { i32 }
define i32 @user_check(%struct._user* %0) {
%2 = tail call i32 @pool_mem_check(%struct._user* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ editorClearScreen();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *);
void die(const char *s) {
  editorClearScreen();
  perror(s);
  printf("\r\n");
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <editorClearScreen@plt>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <editorClearScreen@plt>
mov    %rbx,%rdi
call   1050 <perror@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @editorClearScreen()
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [2 x i8] c"\0D\00"
define void @die(i8* nocapture %0) {
%2 = tail call i32 (...) @editorClearScreen()
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct utmp {
  int /*<<< orphan*/ ut_line;
};

/* Variables and functions */
scalar_t__ strncmp(int /*<<< orphan*/, int /*<<< orphan*/, int);
int proc_utmp_eq(const struct utmp *entry, const struct utmp *match) {
  return (strncmp(entry->ut_line, match->ut_line, sizeof match->ut_line) == 0);
}


x86 assembly (clang, -O0):
<proc_utmp_eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_utmp_eq>:
push   %rax
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utmp = type { i32 }
define i32 @proc_utmp_eq(%struct.utmp* %0, %struct.utmp* %1) {
%3 = alloca %struct.utmp*
%4 = alloca %struct.utmp*
store %struct.utmp* %0, %struct.utmp** %3
store %struct.utmp* %1, %struct.utmp** %4
%5 = load %struct.utmp*, %struct.utmp** %3
%6 = getelementptr inbounds %struct.utmp, %struct.utmp* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.utmp*, %struct.utmp** %4
%9 = getelementptr inbounds %struct.utmp, %struct.utmp* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @strncmp(i32 %7, i32 %10, i32 4)
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.utmp = type { i32 }
define i32 @proc_utmp_eq(%struct.utmp* nocapture %0, %struct.utmp* nocapture %1) {
%3 = getelementptr inbounds %struct.utmp, %struct.utmp* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.utmp, %struct.utmp* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i64 @strncmp(i32 %4, i32 %6, i32 4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
const char *world(void) { return ("world"); }


x86 assembly (clang, -O0):
<world>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<world>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"world\00"
define i8* @world() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
define i8* @world() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int david() { printf("Hola mundo :)\n"); }


x86 assembly (clang, -O0):
<david>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hola mundo :)\0A\00"
define i32 @david() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [14 x i8] c"Hola mundo :)\00"
define i32 @david() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int rom_present(char *);
int et4000w32p_available(void) {
  return rom_present(L"roms/video/et4000w32/et4000w32.bin");
}


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

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

LLVM IR (-O0):
@.str = [35 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 119, i32 51, i32 50, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 119, i32 51, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @et4000w32p_available() {
%1 = call i32 @rom_present(i8* bitcast ([35 x i32]* @.str to i8*))
ret i32 %1
}

LLVM IR (-O2):
@.str = [35 x i32] [i32 114, i32 111, i32 109, i32 115, i32 47, i32 118, i32 105, i32 100, i32 101, i32 111, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 119, i32 51, i32 50, i32 47, i32 101, i32 116, i32 52, i32 48, i32 48, i32 48, i32 119, i32 51, i32 50, i32 46, i32 98, i32 105, i32 110, i32 0]
define i32 @et4000w32p_available() {
%1 = tail call i32 @rom_present(i8* bitcast ([35 x i32]* @.str to i8*))
ret i32 %1
}
int calado(int k) { return k + 3; }


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

x86 assembly (clang, -O2):
<calado>:
lea    0x3(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @calado(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
ret i32 %4
}

LLVM IR (-O2):
define i32 @calado(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
double cos(double);
double sin(double);
void __attribute__((visibility("hidden")))
sincos(double x, double *psin, double *pcos) {
  *psin = sin(x);
  *pcos = cos(x);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define hidden void @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define hidden void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _strings_error(char const *message, int ret) {
  fputs("strings"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_strings_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strings_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"strings: \00"
@stderr = global i32 0
define i32 @_strings_error(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 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"strings: \00"
@stderr = global i32 0
define i32 @_strings_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
void gtk_fixed_get_has_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_fixed_get_has_window() {
ret void
}