xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bit_clear_range(void *, int /*<<< orphan*/, scalar_t__);
scalar_t__ bit_size(void *);
void bit_clear(void *B) { bit_clear_range(B, 0, bit_size(B) - 1); }


x86 assembly (clang, -O0):
<bit_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bit_size@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1040 <bit_clear_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_clear>:
push   %rbx
mov    %rdi,%rbx
call   1030 <bit_size@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <bit_clear_range@plt>

LLVM IR (-O0):
define void @bit_clear(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @bit_size(i8* %4)
%6 = sub nsw i64 %5, 1
%7 = call i32 @bit_clear_range(i8* %3, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @bit_clear(i8* %0) {
%2 = tail call i64 @bit_size(i8* %0)
%3 = add nsw i64 %2, -1
%4 = tail call i32 @bit_clear_range(i8* %0, i32 0, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
scalar_t__ malloc(unsigned int);
uint32_t *co_create_(unsigned size, uintptr_t entry) {
  uint32_t *t = (uint32_t *)malloc(size);
  (void)entry;
  return t;
}


x86 assembly (clang, -O0):
<co_create_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<co_create_>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @co_create_(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %5
%9 = load i64, i64* %4
%10 = load i32*, i32** %5
ret i32* %10
}

LLVM IR (-O2):
define i32* @co_create_(i32 %0, i64 %1) {
%3 = tail call i64 @malloc(i32 %0)
%4 = inttoptr i64 %3 to i32*
ret i32* %4
}
unsigned long prioq__parent(unsigned long index) { return (index - 1) >> 1; }


x86 assembly (clang, -O0):
<prioq__parent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
shr    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prioq__parent>:
lea    -0x1(%rdi),%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @prioq__parent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = lshr i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @prioq__parent(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
ret i64 %3
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR8F_set(void) { return U_WMRCORENONE_set("U_WMR8F"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR8F\00"
define i8* @U_WMR8F_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR8F\00"
define i8* @U_WMR8F_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char *XSetOMValues() {}


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

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

LLVM IR (-O0):
define i8* @XSetOMValues() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @XSetOMValues() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("a|b = %d\na&b = %d\na<<b = %d\na>>b = %d\n~a = %d\n", a | b, a & b,
         a << b, a >> b, ~a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
or     -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
and    -0x8(%rbp),%edx
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%ecx
sar    %cl,%r8d
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%r9d
xor    $0xffffffff,%r9d
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%r9d
mov    (%rsp),%ecx
mov    %ecx,%edx
mov    %ecx,%esi
or     %r9d,%esi
and    %r9d,%edx
mov    %r9d,%eax
shl    %cl,%eax
mov    %r9d,%r8d
sar    %cl,%r8d
not    %r9d
lea    0xea9(%rip),%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [47 x i8] c"a|b = %d\0Aa&b = %d\0Aa<<b = %d\0Aa>>b = %d\0A~a = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = or i32 %4, %5
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = and i32 %7, %8
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = shl i32 %10, %11
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = ashr i32 %13, %14
%16 = load i32, i32* %1
%17 = xor i32 %16, -1
%18 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %15, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [47 x i8] c"a|b = %d\0Aa&b = %d\0Aa<<b = %d\0Aa>>b = %d\0A~a = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
%9 = and i32 %7, %6
%10 = shl i32 %6, %7
%11 = ashr i32 %6, %7
%12 = xor i32 %6, -1
%13 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 0
}
void outb(unsigned char b, unsigned long int port) {
  *((volatile unsigned char *)((0x7c000000 + ((port) << 0)))) = b;
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
add    $0x7c000000,%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %dil,0x7c000000(%rsi)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = load i64, i64* %4
%7 = shl i64 %6, 0
%8 = add i64 2080374784, %7
%9 = inttoptr i64 %8 to i8*
store volatile i8 %5, i8* %9
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i64 %1) {
%3 = add i64 %1, 2080374784
%4 = inttoptr i64 %3 to i8*
store volatile i8 %0, i8* %4
ret void
}
/* Variables and functions */
char *get_output(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *get_alternative_link(char *arch_path, char *pattern) {
  char command[80];
  sprintf(command, "update-alternatives --list %s_gl_conf | grep %s", arch_path,
          pattern);
  char *alternative = NULL;
  alternative = get_output(command);
  return alternative;
}


x86 assembly (clang, -O0):
<get_alternative_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xebd(%rip),%rsi
call   1040 <sprintf@plt>
movq   $0x0,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <get_output@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_alternative_link>:
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <get_output@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"update-alternatives --list %s_gl_conf | grep %s\00"
define i8* @get_alternative_link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [80 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
store i8* null, i8** %6
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%12 = call i8* @get_output(i8* %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
ret i8* %13
}

LLVM IR (-O2):
@.str = [48 x i8] c"update-alternatives --list %s_gl_conf | grep %s\00"
define i8* @get_alternative_link(i8* %0, i8* %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = call i8* @get_output(i8* %4)
ret i8* %6
}
double dabs(double a) {
  if (a < 0)
    return (-1 * a);
  else
    return a;
}


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112e <dabs+0x2e>
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1138 <dabs+0x38>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double -1.000000e+00, %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int a(int i) {
  i++;
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @a(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
void protocol_textline_free_topic_data(struct topic *t) {}


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

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

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

LLVM IR (-O2):
%struct.topic = type opaque
define void @protocol_textline_free_topic_data(%struct.topic* nocapture %0) {
ret void
}
char *XSetICValues() {}


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

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

LLVM IR (-O0):
define i8* @XSetICValues() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @XSetICValues() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
scalar_t__ getgroups(int, short *);
int setgroups(int, short *);
main() {
  short x[4];
  x[0] = x[1] = 0;
  if (getgroups(1, x) == 0)
    if (setgroups(1, x) == -1)
      _exit(1);
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x0,-0xa(%rbp)
movw   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rsi
mov    $0x1,%edi
call   1050 <getgroups@plt>
cmp    $0x0,%rax
jne    1189 <main+0x59>
lea    -0xc(%rbp),%rsi
mov    $0x1,%edi
call   1040 <setgroups@plt>
cmp    $0xffffffff,%eax
jne    1184 <main+0x54>
mov    $0x1,%edi
call   1030 <_exit@plt>
jmp    1189 <main+0x59>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rsi
mov    $0x1,%edi
call   1050 <getgroups@plt>
test   %rax,%rax
jne    1166 <main+0x36>
mov    %rsp,%rsi
mov    $0x1,%edi
call   1040 <setgroups@plt>
cmp    $0xffffffff,%eax
jne    1166 <main+0x36>
mov    $0x1,%edi
call   1030 <_exit@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i16]
store i32 0, i32* %1
%3 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 1
store i16 0, i16* %3
%4 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
store i16 0, i16* %4
%5 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%6 = call i64 @getgroups(i32 1, i16* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = getelementptr inbounds [4 x i16], [4 x i16]* %2, i64 0, i64 0
%10 = call i32 @setgroups(i32 1, i16* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @_exit(i32 1)
unreachable
14: ; preds = %8
br label %15
15: ; preds = %14, %0
%16 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x i16]
%2 = bitcast [4 x i16]* %1 to i8*
%3 = getelementptr inbounds [4 x i16], [4 x i16]* %1, i64 0, i64 1
store i16 0, i16* %3
%4 = getelementptr inbounds [4 x i16], [4 x i16]* %1, i64 0, i64 0
store i16 0, i16* %4
%5 = call i64 @getgroups(i32 1, i16* %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0
%8 = call i32 @setgroups(i32 1, i16* %4)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @_exit(i32 1)
unreachable
12: ; preds = %7, %0
%13 = call i32 @_exit(i32 0)
unreachable
}
float fclamp(float x, float a, float b) { return x < a ? a : (x > b ? b : x); }


x86 assembly (clang, -O0):
<fclamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <fclamp+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1167 <fclamp+0x67>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <fclamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    115d <fclamp+0x5d>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fclamp>:
minss  %xmm0,%xmm2
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @fclamp(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 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %5
br label %22
12: ; preds = %3
%13 = load float, float* %4
%14 = load float, float* %6
%15 = fcmp ogt float %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load float, float* %6
br label %20
18: ; preds = %12
%19 = load float, float* %4
br label %20
20: ; preds = %18, %16
%21 = phi float [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi float [ %11, %10 ], [ %21, %20 ]
ret float %23
}

LLVM IR (-O2):
define float @fclamp(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = fcmp ogt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *x, const void *y) {
  return strcmp(*(char **)x, *(char **)y);
}


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(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
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
long double f5(void) { return 0; }


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

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

LLVM IR (-O0):
define x86_fp80 @f5() {
ret x86_fp80 0xK00000000000000000000
}

LLVM IR (-O2):
define x86_fp80 @f5() {
ret x86_fp80 0xK00000000000000000000
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int c_right() { return fputs("[C", stdout); }


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

x86 assembly (clang, -O2):
<c_right>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[C\00"
@stdout = global i32 0
define i32 @c_right() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[C\00"
@stdout = global i32 0
define i32 @c_right() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
unsigned long mfpvr();
unsigned long chip_11_errata(unsigned long memsize) {
  unsigned long pvr;
  pvr = mfpvr();
  switch (pvr & 0xf0000ff0) {
  case 0x40000850:
  case 0x400008d0:
  case 0x200008d0:
    memsize -= 4096;
    break;
  default:
    break;
  }
  return memsize;
}


x86 assembly (clang, -O0):
<chip_11_errata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1030 <mfpvr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xf0000ff0,%eax
mov    %rax,-0x18(%rbp)
sub    $0x200008d0,%rax
je     116f <chip_11_errata+0x5f>
jmp    1145 <chip_11_errata+0x35>
mov    -0x18(%rbp),%rax
sub    $0x40000850,%rax
je     116f <chip_11_errata+0x5f>
jmp    115a <chip_11_errata+0x4a>
mov    -0x18(%rbp),%rax
sub    $0x400008d0,%rax
jne    1182 <chip_11_errata+0x72>
jmp    116f <chip_11_errata+0x5f>
mov    -0x8(%rbp),%rax
sub    $0x1000,%rax
mov    %rax,-0x8(%rbp)
jmp    1187 <chip_11_errata+0x77>
jmp    1187 <chip_11_errata+0x77>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chip_11_errata>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <mfpvr@plt>
and    $0xf0000ff0,%eax
cmp    $0x200008d0,%eax
je     1135 <chip_11_errata+0x25>
cmp    $0x400008d0,%eax
je     1135 <chip_11_errata+0x25>
cmp    $0x40000850,%eax
jne    113c <chip_11_errata+0x2c>
add    $0xfffffffffffff000,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @chip_11_errata(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = call i64 (...) @mfpvr()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = and i64 %5, 4026535920
switch i64 %6, label %10 [
i64 1073743952, label %7
i64 1073744080, label %7
i64 536873168, label %7
]
7: ; preds = %1, %1, %1
%8 = load i64, i64* %2
%9 = sub i64 %8, 4096
store i64 %9, i64* %2
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %7
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @chip_11_errata(i64 %0) {
%2 = tail call i64 (...) @mfpvr()
%3 = trunc i64 %2 to i32
%4 = and i32 %3, -268431376
switch i32 %4, label %7 [
i32 1073743952, label %5
i32 1073744080, label %5
i32 536873168, label %5
]
5: ; preds = %1, %1, %1
%6 = add i64 %0, -4096
br label %7
7: ; preds = %1, %5
%8 = phi i64 [ %0, %1 ], [ %6, %5 ]
ret i64 %8
}
int qed_compare_values(const void *value1, const void *value2) {
  if (*(const double *)value1 < *(const double *)value2)
    return -1;
  return *(const double *)value1 > *(const double *)value2;
}


x86 assembly (clang, -O0):
<qed_compare_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <qed_compare_values+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    114d <qed_compare_values+0x4d>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qed_compare_values>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @qed_compare_values(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = fcmp olt double %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %23
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to double*
%17 = load double, double* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to double*
%20 = load double, double* %19
%21 = fcmp ogt double %17, %20
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @qed_compare_values(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ do_not_propagate_mask;
};
typedef TYPE_1__ XWindowAttributes;

/* Variables and functions */
long get_XWindowAttributes_do_not_propagate_mask(void *_p) {
  return (long)((XWindowAttributes *)_p)->do_not_propagate_mask;
}


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

x86 assembly (clang, -O2):
<get_XWindowAttributes_do_not_propagate_mask>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XWindowAttributes_do_not_propagate_mask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XWindowAttributes_do_not_propagate_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_XGATE(void) { DeinitFields(); }


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

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

LLVM IR (-O0):
define void @SwitchFrom_XGATE() {
%1 = call i32 (...) @DeinitFields()
ret void
}

LLVM IR (-O2):
define void @SwitchFrom_XGATE() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
_Bool isalnum(unsigned char);
_Bool dns_isalnum(unsigned char c) { return isalnum(c); }


x86 assembly (clang, -O0):
<dns_isalnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_isalnum>:
jmp    1030 <isalnum@plt>

LLVM IR (-O0):
define zeroext i1 @dns_isalnum(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i1 @isalnum(i8 zeroext %3)
ret i1 %4
}

LLVM IR (-O2):
define zeroext i1 @dns_isalnum(i8 zeroext %0) {
%2 = tail call zeroext i1 @isalnum(i8 zeroext %0)
ret i1 %2
}
/* Variables and functions */
int /*<<< orphan*/ eset(int);
int tcFopen(char *, char *);
int Mfopen(int nargs, int *args) {
  if (nargs < 2) {
    eset(21);
    return -1;
  }
  char *filename = (char *)args[0];
  char *mode = (char *)args[1];
  return tcFopen(filename, mode);
}


x86 assembly (clang, -O0):
<Mfopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    114f <Mfopen+0x2f>
mov    $0x15,%edi
call   1030 <eset@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1176 <Mfopen+0x56>
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <tcFopen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mfopen>:
push   %rax
cmp    $0x1,%edi
jg     1137 <Mfopen+0x17>
mov    $0x15,%edi
call   1030 <eset@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
movslq (%rsi),%rdi
movslq 0x4(%rsi),%rsi
pop    %rax
jmp    1040 <tcFopen@plt>

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

LLVM IR (-O2):
define i32 @Mfopen(i32 %0, i32* nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @eset(i32 21)
br label %15
6: ; preds = %2
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
%10 = getelementptr inbounds i32, i32* %1, i64 1
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @tcFopen(i8* %9, i8* %13)
br label %15
15: ; preds = %6, %4
%16 = phi i32 [ -1, %4 ], [ %14, %6 ]
ret i32 %16
}
extern int apply_moves(struct game *game, const struct move *moves) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.game = type opaque
%struct.move = type opaque
define i32 @apply_moves(%struct.game* nocapture readnone %0, %struct.move* nocapture readnone %1) {
ret i32 0
}
int fn() { return 0; }


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

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

LLVM IR (-O0):
define i32 @fn() {
ret i32 0
}

LLVM IR (-O2):
define i32 @fn() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int *);
void g(int *x, int *y) {
  int z;
  z = *y;
  if (z > 0)
    f(&z, y);
  else
    *x = z;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1145 <g+0x35>
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1030 <f@plt>
jmp    114e <g+0x3e>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    (%rsi),%eax
mov    %eax,0x4(%rsp)
test   %eax,%eax
jle    1127 <g+0x17>
lea    0x4(%rsp),%rdi
call   1030 <f@plt>
pop    %rax
ret
mov    %eax,(%rdi)
pop    %rax
ret

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

LLVM IR (-O2):
define void @g(i32* nocapture writeonly %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* %1
store i32 %5, i32* %3
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @f(i32* %3, i32* %1)
br label %10
9: ; preds = %2
store i32 %5, i32* %0
br label %10
10: ; preds = %9, %7
ret void
}
/* Variables and functions */
int fn_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295(char const *);
int fn_al_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295(
    const char *text) {
  int pos = 0;
  pos = fn_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295(text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295>:
jmp    1030 <fn_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295(i8* %0) {
%2 = tail call i32 @fn_sq_ch_35_qtg_1_4294967295_cl_1_9_11_12_14_4294967295(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_lrintf();
scalar_t__ lrintf(float);
void test_lrintf(float f) {
  if (lrintf(f) != lrintf(f))
    link_failure_lrintf();
}


x86 assembly (clang, -O0):
<test_lrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <lrintf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <lrintf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_lrintf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_lrintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lrintf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <lrintf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <lrintf@plt>
cmp    %rax,%rbx
jne    1149 <test_lrintf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_lrintf@plt>

LLVM IR (-O0):
define void @test_lrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @lrintf(float %3)
%5 = load float, float* %2
%6 = call i64 @lrintf(float %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_lrintf()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_lrintf(float %0) {
%2 = tail call i64 @lrintf(float %0)
%3 = tail call i64 @lrintf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_lrintf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ changeTexMode(int);
int /*<<< orphan*/ fprintRTF(char *);
int getTexMode();
void CmdToday(int code) {
  if (getTexMode() == 6)
    changeTexMode(2);
  fprintRTF("\\chdate ");
}


x86 assembly (clang, -O0):
<CmdToday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getTexMode@plt>
cmp    $0x6,%eax
jne    1155 <CmdToday+0x25>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
lea    0xea4(%rip),%rdi
call   1050 <fprintRTF@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdToday>:
push   %rax
xor    %eax,%eax
call   1040 <getTexMode@plt>
cmp    $0x6,%eax
jne    1147 <CmdToday+0x17>
mov    $0x2,%edi
call   1030 <changeTexMode@plt>
lea    0xeb2(%rip),%rdi
pop    %rax
jmp    1050 <fprintRTF@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\\chdate \00"
define void @CmdToday(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getTexMode()
%4 = icmp eq i32 %3, 6
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @changeTexMode(i32 2)
br label %7
7: ; preds = %5, %1
%8 = call i32 @fprintRTF(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\\chdate \00"
define void @CmdToday(i32 %0) {
%2 = tail call i32 (...) @getTexMode()
%3 = icmp eq i32 %2, 6
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @changeTexMode(i32 2)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @fprintRTF(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double pow(int, int);
int get_freq_from_code(int noteCode) {
  return (int)(440.0 * pow(2, ((noteCode - 33) / 12.0)));
}


x86 assembly (clang, -O0):
<get_freq_from_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x21,%eax
cvtsi2sd %eax,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xeb6(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_freq_from_code>:
push   %rax
add    $0xffffffdf,%edi
cvtsi2sd %edi,%xmm0
divsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  0xed2(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_freq_from_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 33
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 1.200000e+01
%7 = fptosi double %6 to i32
%8 = call double @pow(i32 2, i32 %7)
%9 = fmul double 4.400000e+02, %8
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_freq_from_code(i32 %0) {
%2 = add nsw i32 %0, -33
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.200000e+01
%5 = fptosi double %4 to i32
%6 = tail call double @pow(i32 2, i32 %5)
%7 = fmul double %6, 4.400000e+02
%8 = fptosi double %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ USB1_UTMI_DriverIRQHandler();
__attribute__((weak)) void USB1_UTMI_IRQHandler(void) {
  USB1_UTMI_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @USB1_UTMI_IRQHandler() {
%1 = call i32 (...) @USB1_UTMI_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @USB1_UTMI_IRQHandler() {
%1 = tail call i32 (...) @USB1_UTMI_DriverIRQHandler()
ret void
}
/* Variables and functions */
int hex(char);
unsigned char asctohex(char *str) {
  unsigned char value;
  value = hex(*str) & 0x0f;
  value = value << 4;
  str++;
  value |= hex(*str) & 0x0f;
  return value;
}


x86 assembly (clang, -O0):
<asctohex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hex@plt>
and    $0xf,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <hex@plt>
mov    %eax,%ecx
and    $0xf,%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asctohex>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <hex@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
call   1030 <hex@plt>
and    $0xf,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i8 @asctohex(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @hex(i8 signext %2)
%4 = shl i32 %3, 4
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i32 @hex(i8 signext %6)
%8 = and i32 %7, 15
%9 = or i32 %8, %4
%10 = trunc i32 %9 to i8
ret i8 %10
}
unsigned long stack4_top(unsigned long s) { return s & 0xf; }


x86 assembly (clang, -O0):
<stack4_top>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack4_top>:
mov    %rdi,%rax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i64 @stack4_top(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 15
ret i64 %4
}

LLVM IR (-O2):
define i64 @stack4_top(i64 %0) {
%2 = and i64 %0, 15
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cgincbloc(char *i, int a, int v) {
  ngen("%s\tcl,%d", "mov", v);
  ngen("%s\t[bp%+d],cl", i, v);
}


x86 assembly (clang, -O0):
<cgincbloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%edx
lea    0xed4(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <ngen@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xec7(%rip),%rdi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgincbloc>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
lea    0xee0(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1030 <ngen@plt>
lea    0xeda(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s\09cl,%d\00"
@.str.1 = [4 x i8] c"mov\00"
@.str.2 = [14 x i8] c"%s\09[bp%+d],cl\00"
define void @cgincbloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %4
%10 = load i32, i32* %6
%11 = call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s\09cl,%d\00"
@.str.1 = [4 x i8] c"mov\00"
@.str.2 = [14 x i8] c"%s\09[bp%+d],cl\00"
define void @cgincbloc(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @ngen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%5 = tail call i32 @ngen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i <= 10000; i++) {
    if (i % 5 == 0) {
      printf("\n%d e divisivel", i);
    }
  }
}


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   $0x1,-0x14(%rbp)
cmpl   $0x2710,-0x14(%rbp)
jg     1170 <main+0x60>
mov    -0x14(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    115d <main+0x4d>
mov    -0x14(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    1162 <main+0x52>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
jmp    113b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x2711,%ebx
je     115d <main+0x4d>
movzwl %bx,%eax
imul   $0xcccd,%eax,%ecx
shr    $0x12,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
add    %cx,%ax
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"\0A%d e divisivel\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
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 10000
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %6
%12 = srem i32 %11, 5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0A%d e divisivel\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %10
%4 = phi i32 [ 1, %2 ], [ %11, %10 ]
%5 = trunc i32 %4 to i16
%6 = urem i16 %5, 5
%7 = icmp eq i16 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %10
10: ; preds = %3, %8
%11 = add nuw nsw i32 %4, 1
%12 = icmp eq i32 %11, 10001
br i1 %12, label %13, label %3
13: ; preds = %10
ret i32 0
}
/* Variables and functions */
char *strtok(char *, char const *);
char *strtok_r(char *str, const char *delim, char **saveptr) {
  return strtok(str, delim);
}


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

x86 assembly (clang, -O2):
<strtok_r>:
jmp    1030 <strtok@plt>

LLVM IR (-O0):
define i8* @strtok_r(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i8* @strtok(i8* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
define i8* @strtok_r(i8* %0, i8* nocapture %1, i8** nocapture readnone %2) {
%4 = tail call i8* @strtok(i8* %0, i8* %1)
ret i8* %4
}
void ip_timeout(arg) int *arg;
{
  register struct reasm *rp;
  rp = (struct reasm *)arg;
  free_reasm(rp);
}


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

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

LLVM IR (-O0):
%struct.reasm = type opaque
define void @ip_timeout(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.reasm*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to %struct.reasm*
store %struct.reasm* %5, %struct.reasm** %3
%6 = load %struct.reasm*, %struct.reasm** %3
%7 = call i32 (%struct.reasm*, ...) bitcast (i32 (...)* @free_reasm to i32 (%struct.reasm*, ...)*)(%struct.reasm* %6)
ret void
}

LLVM IR (-O2):
%struct.reasm = type opaque
define void @ip_timeout(i32* %0) {
%2 = bitcast i32* %0 to %struct.reasm*
%3 = tail call i32 (%struct.reasm*, ...) bitcast (i32 (...)* @free_reasm to i32 (%struct.reasm*, ...)*)(%struct.reasm* %2)
ret void
}
int test_imm_5Eint64_lowword_reg(long long val) {
  return ((val) & (0x5E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Eint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 94
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}