xunge/DecIR huggingface dataset:
void no_dead_local_store() {
  char dead[] = "Dead Local Store of some chars.";
  char not_dead[] = "Not Dead Local Store of some chars.";
  return;
}


x86 assembly (clang, -O0):
<no_dead_local_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xed1(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.no_dead_local_store.dead = [32 x i8] c"Dead Local Store of some chars.\00"
@__const.no_dead_local_store.not_dead = [36 x i8] c"Not Dead Local Store of some chars.\00"
define void @no_dead_local_store() {
%1 = alloca [32 x i8]
%2 = alloca [36 x i8]
%3 = bitcast [32 x i8]* %1 to i8*
%4 = bitcast [36 x i8]* %2 to i8*
ret void
}

LLVM IR (-O2):
define void @no_dead_local_store() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char **);
int main() {
  char s[100];
  scanf("%[^\n]%*c", &s);
  printf("Hello, World!\n");
  printf(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@.str.1 = [15 x i8] c"Hello, World!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = bitcast [100 x i8]* %2 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%[^\0A]%*c\00"
@str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = bitcast [100 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = call i32 @printf(i8* %2)
ret i32 0
}
double plus(double d1, double d2) { return d1 + d2; }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @plus(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @plus(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
#define EDOM 129
#define ERANGE 128
char *strerror(int errnum) {
  switch (errnum) {
  case EDOM:
    return "domain error";
  case ERANGE:
    return "range error";
  default:
    return "unknown error number.";
  }
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x80,%eax
je     1140 <strerror+0x40>
jmp    111d <strerror+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x81,%eax
jne    1150 <strerror+0x50>
jmp    1130 <strerror+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <strerror+0x5b>
lea    0xec6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    115b <strerror+0x5b>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
cmp    $0x80,%edi
lea    0xf00(%rip),%rax
lea    0xf05(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x81,%edi
lea    0xedb(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"domain error\00"
@.str.1 = [12 x i8] c"range error\00"
@.str.2 = [22 x i8] c"unknown error number.\00"
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 129, label %5
i32 128, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"domain error\00"
@.str.1 = [12 x i8] c"range error\00"
@.str.2 = [22 x i8] c"unknown error number.\00"
define i8* @strerror(i32 %0) {
%2 = icmp eq i32 %0, 128
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 129
%5 = select i1 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void initialiserTableLexicale(char table[]) {}


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

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

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

LLVM IR (-O2):
define void @initialiserTableLexicale(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void bcopy(const void *IN, void *OUT, size_t N) { memcpy(OUT, IN, N); }


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

x86 assembly (clang, -O2):
<bcopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @bcopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %2)
ret void
}
int isinfd(long double x) {
  unsigned int xexp;
  unsigned long long int mant;
  xexp = ((*(unsigned long long *)(&x)) >> (52)) & 0x7ff;
  mant = ((*(unsigned long long *)(&x)) & 0xFFFFFFFFFFFFF);
  return ((xexp == 2047) && (mant == 0));
}


x86 assembly (clang, -O0):
<isinfd>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x34,%rax
and    $0x7ff,%rax
mov    %eax,-0x14(%rbp)
movabs $0xfffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmpl   $0x7ff,-0x14(%rbp)
mov    %al,-0x21(%rbp)
jne    114a <isinfd+0x4a>
cmpq   $0x0,-0x20(%rbp)
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinfd>:
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    0x8(%rsp),%rcx
movabs $0x7ff0000000000000,%rdx
xor    %eax,%eax
xor    %rcx,%rdx
sete   %al
ret

LLVM IR (-O0):
define i32 @isinfd(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
%4 = alloca i64
store x86_fp80 %0, x86_fp80* %2
%5 = bitcast x86_fp80* %2 to i64*
%6 = load i64, i64* %5
%7 = lshr i64 %6, 52
%8 = and i64 %7, 2047
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = bitcast x86_fp80* %2 to i64*
%11 = load i64, i64* %10
%12 = and i64 %11, 4503599627370495
store i64 %12, i64* %4
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 2047
br i1 %14, label %15, label %18
15: ; preds = %1
%16 = load i64, i64* %4
%17 = icmp eq i64 %16, 0
br label %18
18: ; preds = %15, %1
%19 = phi i1 [ false, %1 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isinfd(x86_fp80 %0) {
%2 = bitcast x86_fp80 %0 to i80
%3 = and i80 %2, 9223372036854775807
%4 = icmp eq i80 %3, 9218868437227405312
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_local();
int /*<<< orphan*/ test_localat();
int main(int argc, char *args[]) {
  printf("\nliblocalat test\n\n");
  test_localat();
  test_local();
  printf("all tests pass\n\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <test_localat@plt>
xor    %eax,%eax
call   1050 <test_local@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0Aliblocalat test\0A\0A\00"
@.str.1 = [17 x i8] c"all tests pass\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_localat()
%8 = call i32 (...) @test_local()
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"\0Aliblocalat test\0A\00"
@str.2 = [16 x i8] c"all tests pass\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_localat()
%5 = tail call i32 (...) @test_local()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
void mmc_pwrseq_reset(struct mmc_host *host) {}


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

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

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

LLVM IR (-O2):
%struct.mmc_host = type opaque
define void @mmc_pwrseq_reset(%struct.mmc_host* nocapture %0) {
ret void
}
void nseel_asm_bnot(void) {
  __asm__("testl %eax, %eax\n"
          "setz %al\n"
          "andl $0xff, %eax\n");
}


x86 assembly (clang, -O0):
<nseel_asm_bnot>:
push   %rbp
mov    %rsp,%rbp
test   %eax,%eax
sete   %al
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nseel_asm_bnot>:
test   %eax,%eax
sete   %al
and    $0xff,%eax
ret

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

LLVM IR (-O2):
define void @nseel_asm_bnot() {
tail call void asm sideeffect "testl %eax, %eax\0Asetz %al\0Aandl $$0xff, %eax\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int);
int __attribute__((always_)) equal_str(const char *s1, const char *s2) {
  int min_len = (strlen(s1) < strlen(s2) ? strlen(s1) : strlen(s2));
  return (strncmp(s1, s2, min_len) == 0);
}


x86 assembly (clang, -O0):
<equal_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1163 <equal_str+0x43>
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
jmp    116f <equal_str+0x4f>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_str>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebp
mov    %r14,%rdi
cmovl  %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @equal_str(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
%6 = select i1 %5, i8* %0, i8* %1
%7 = tail call i32 @strlen(i8* %6)
%8 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %7)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int y;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xreparent_y(void *_p, int _v) {
  ((XEvent *)_p)->xreparent.y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xreparent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xreparent_y(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xreparent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned int clz(unsigned int x) {
  union _uf {
    double f;
    unsigned u[2];
  } uf;
  if (__builtin_expect((x == 0), 0)) {
    return 32;
  } else {
    uf.f = (double)x;
    return 31 - ((uf.u[1] >> 20) - 1023);
  }
}


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
cmp    $0x0,%rax
je     112b <clz+0x2b>
movl   $0x20,-0x4(%rbp)
jmp    114e <clz+0x4e>
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
shr    $0x14,%ecx
sub    $0x3ff,%ecx
mov    $0x1f,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
test   %edi,%edi
je     111c <clz+0x1c>
mov    %edi,%eax
cvtsi2sd %rax,%xmm0
movq   %xmm0,%rcx
shr    $0x34,%rcx
mov    $0x41e,%eax
sub    %ecx,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
%union._uf = type { double }
define i32 @clz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union._uf
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = sext i32 %7 to i64
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 32, i32* %2
br label %21
11: ; preds = %1
%12 = load i32, i32* %3
%13 = uitofp i32 %12 to double
%14 = bitcast %union._uf* %4 to double*
store double %13, double* %14
%15 = bitcast %union._uf* %4 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
%17 = load i32, i32* %16
%18 = lshr i32 %17, 20
%19 = sub i32 %18, 1023
%20 = sub i32 31, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %11, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @clz(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = uitofp i32 %0 to double
%4 = bitcast double %3 to i64
%5 = lshr i64 %4, 52
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 1054, %6
%8 = select i1 %2, i32 32, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int PECIDomainValid(unsigned long);
unsigned long PECIDomainMaxReadGet(unsigned long ulBase,
                                   unsigned long ulDomain) {
  DEBUG_ASSERT(ulBase == 0x400B0000);
  DEBUG_ASSERT(PECIDomainValid(ulDomain));
  return (
      (((*((volatile unsigned long *)(ulBase + 0x00000040 + (ulDomain * 4)))) &
        0xFFFF0000) >>
       16));
}


x86 assembly (clang, -O0):
<PECIDomainMaxReadGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x400b0000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x40,%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    (%rax),%rax
movabs $0xffff0000,%rcx
and    %rcx,%rax
shr    $0x10,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIDomainMaxReadGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x400b0000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %r14,%rdi
call   1040 <PECIDomainValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    0x40(%rbx,%r14,4),%rax
shr    $0x10,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @PECIDomainMaxReadGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074462720
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @PECIDomainValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 64
%14 = load i64, i64* %4
%15 = mul i64 %14, 4
%16 = add i64 %13, %15
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = and i64 %18, 4294901760
%20 = lshr i64 %19, 16
ret i64 %20
}

LLVM IR (-O2):
define i64 @PECIDomainMaxReadGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074462720
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @PECIDomainValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = add i64 %0, 64
%9 = shl i64 %1, 2
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = lshr i64 %12, 16
%14 = and i64 %13, 65535
ret i64 %14
}
unsigned long atomic_cmpxchg4(unsigned int *addr, unsigned int oldval,
                              unsigned int newval) {
  asm volatile("lock; cmpxchgl %2, %1\n"
               : "=a"(oldval), "+m"(*addr)
               : "r"(newval), "0"(oldval)
               : "memory");
  return oldval;
}


x86 assembly (clang, -O0):
<atomic_cmpxchg4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%eax
lock cmpxchg %edx,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_cmpxchg4>:
mov    %esi,%eax
lock cmpxchg %edx,(%rdi)
mov    %eax,%eax
ret

LLVM IR (-O0):
define i64 @atomic_cmpxchg4(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call i32 asm sideeffect "lock; cmpxchgl $2, $1\0A", "={ax},=*m,r,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %7, i32 %8, i32 %9, i32* elementtype(i32) %7)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @atomic_cmpxchg4(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 asm sideeffect "lock; cmpxchgl $2, $1\0A", "={ax},=*m,r,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 %2, i32 %1, i32* elementtype(i32) %0)
%5 = zext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, float);
int /*<<< orphan*/ stderr;
void dummy_set_fanspeed(void *user, float speed) {
  fprintf(stderr, "GCodeParser: set_fanspeed(%.0f)\n", speed);
}


x86 assembly (clang, -O0):
<dummy_set_fanspeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
movss  -0xc(%rbp),%xmm0
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"GCodeParser: set_fanspeed(%.0f)\0A\00"
define void @dummy_set_fanspeed(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i32, i32* @stderr
%6 = load float, float* %4
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), float %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"GCodeParser: set_fanspeed(%.0f)\0A\00"
define void @dummy_set_fanspeed(i8* nocapture readnone %0, float %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _usage(void) {
  fputs("Usage: "
        "pr"
        " [+page][-column][-adFmrt][-e [char][ gap]]"
        "[-h header][-i[char][gap]]\n"
        "[-l lines][-n [char][width]][-o offset][-s[char]]"
        "[-w width] file...\n",
        stderr);
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [148 x i8] c"Usage: pr [+page][-column][-adFmrt][-e [char][ gap]][-h header][-i[char][gap]]\0A[-l lines][-n [char][width]][-o offset][-s[char]][-w width] file...\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [148 x i8] c"Usage: pr [+page][-column][-adFmrt][-e [char][ gap]][-h header][-i[char][gap]]\0A[-l lines][-n [char][width]][-o offset][-s[char]][-w width] file...\0A\00"
@stderr = global i32 0
define i32 @_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Mali_WrReg(int, int /*<<< orphan*/, int, int);
void Mali_write_JSn_register(int JSn_reg, int n, int value_to_write) {
  int JSn_reg_final = 0x1000 | 0x800 | JSn_reg | (n * 128);
  Mali_WrReg(0x20, 0, JSn_reg_final, value_to_write);
}


x86 assembly (clang, -O0):
<Mali_write_JSn_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1800,%eax
mov    -0x8(%rbp),%ecx
shl    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <Mali_WrReg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mali_write_JSn_register>:
mov    %edx,%ecx
mov    %esi,%edx
shl    $0x7,%edx
or     %edi,%edx
or     $0x1800,%edx
mov    $0x20,%edi
xor    %esi,%esi
jmp    1030 <Mali_WrReg@plt>

LLVM IR (-O0):
define void @Mali_write_JSn_register(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 = or i32 6144, %8
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 128
%12 = or i32 %9, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @Mali_WrReg(i32 32, i32 0, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
define void @Mali_write_JSn_register(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 %1, 7
%5 = or i32 %4, %0
%6 = or i32 %5, 6144
%7 = tail call i32 @Mali_WrReg(i32 32, i32 0, i32 %6, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ big();
int q1(void) {
  big();
  big();
  big();
}


x86 assembly (clang, -O0):
<q1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <big@plt>
mov    $0x0,%al
call   1030 <big@plt>
mov    $0x0,%al
call   1030 <big@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<q1>:
push   %rax
xor    %eax,%eax
call   1030 <big@plt>
xor    %eax,%eax
call   1030 <big@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <big@plt>

LLVM IR (-O0):
define i32 @q1() {
%1 = alloca i32
%2 = call i32 (...) @big()
%3 = call i32 (...) @big()
%4 = call i32 (...) @big()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @q1() {
%1 = tail call i32 (...) @big()
%2 = tail call i32 (...) @big()
%3 = tail call i32 (...) @big()
ret i32 undef
}
char *path_transform_from_nix(char *path) { return path; }


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

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

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

LLVM IR (-O2):
define i8* @path_transform_from_nix(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
int main() {
  long count;
  for (count = 0; count < 1000000000000; count++) {
    if (count % 1000000000 == 0 && count != 0) {
      printf("%ld\n", count);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movabs $0xe8d4a51000,%rax
cmp    %rax,-0x10(%rbp)
jge    1184 <main+0x74>
mov    -0x10(%rbp),%rax
mov    $0x3b9aca00,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    116e <main+0x5e>
cmpq   $0x0,-0x10(%rbp)
je     116e <main+0x5e>
mov    -0x10(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x63>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1127 <main+0x17>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
movabs $0x44b82fa09b5a53,%r15
lea    0xed5(%rip),%r14
movabs $0xe8d4a51000,%r12
jmp    1149 <main+0x39>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
cmp    %r12,%rbx
je     1175 <main+0x65>
mov    %rbx,%rax
shr    $0x9,%rax
mul    %r15
test   %rbx,%rbx
je     1140 <main+0x30>
shr    $0xb,%rdx
imul   $0x3b9aca00,%rdx,%rax
cmp    %rbx,%rax
jne    1140 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1140 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %9
%2 = phi i64 [ 0, %0 ], [ %10, %9 ]
%3 = urem i64 %2, 1000000000
%4 = icmp eq i64 %3, 0
%5 = icmp ne i64 %2, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %9
9: ; preds = %1, %7
%10 = add nuw nsw i64 %2, 1
%11 = icmp eq i64 %10, 1000000000000
br i1 %11, label %12, label %1
12: ; preds = %9
ret i32 0
}
/* Variables and functions */
int block_read_write(unsigned long long, unsigned int, void *, int);
int block_read(unsigned long long offset, unsigned int len, void *buf) {
  return block_read_write(offset, len, buf, 1);
}


x86 assembly (clang, -O0):
<block_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <block_read_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_read>:
mov    $0x1,%ecx
jmp    1030 <block_read_write@plt>

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

LLVM IR (-O2):
define i32 @block_read(i64 %0, i32 %1, i8* %2) {
%4 = tail call i32 @block_read_write(i64 %0, i32 %1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int trimstr(char *, int);
int main() {
  int length;
  char line[1000];
  while ((length = trimstr(line, 1000)) > 0)
    printf("The line '%s' has length: %d\n", line, length);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <trimstr@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116a <main+0x4a>
lea    -0x3f0(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <trimstr@plt>
test   %eax,%eax
jle    116e <main+0x4e>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <trimstr@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"The line '%s' has length: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @trimstr(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"The line '%s' has length: %d\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @trimstr(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ %3, %0 ]
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %6)
%8 = call i32 @trimstr(i8* %2, i32 1000)
%9 = icmp sgt i32 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int __builtin_allegrex_floor_w_s(float);
int pspFpuFloor(float fs) { return (__builtin_allegrex_floor_w_s(fs)); }


x86 assembly (clang, -O0):
<pspFpuFloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_allegrex_floor_w_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pspFpuFloor>:
jmp    1030 <__builtin_allegrex_floor_w_s@plt>

LLVM IR (-O0):
define i32 @pspFpuFloor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @__builtin_allegrex_floor_w_s(float %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @pspFpuFloor(float %0) {
%2 = tail call i32 @__builtin_allegrex_floor_w_s(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ derror(char *);
int setkey(void) {
  derror("Cannot set key");
  return (0);
}


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

x86 assembly (clang, -O2):
<setkey>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <derror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Cannot set key\00"
define i32 @setkey() {
%1 = call i32 @derror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Cannot set key\00"
define i32 @setkey() {
%1 = tail call i32 @derror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outsl(unsigned int, void *, unsigned long);
void nsp32_multi_write4(unsigned int BaseAddr, unsigned int Register, void *buf,
                        unsigned long count) {
  outsl(BaseAddr + Register, buf, count);
}


x86 assembly (clang, -O0):
<nsp32_multi_write4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
add    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <outsl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsp32_multi_write4>:
add    %esi,%edi
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <outsl@plt>

LLVM IR (-O0):
define void @nsp32_multi_write4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add i32 %9, %10
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = call i32 @outsl(i32 %11, i8* %12, i64 %13)
ret void
}

LLVM IR (-O2):
define void @nsp32_multi_write4(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = add i32 %1, %0
%6 = tail call i32 @outsl(i32 %5, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setupDisp(int /*<<< orphan*/, int, int, int, int, int, int,
                             int);
void setup() { setupDisp(0, 1, 2, 3, 4, 5, 6, 7); }


x86 assembly (clang, -O0):
<setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
call   1030 <setupDisp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x7
push   $0x6
call   1030 <setupDisp@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @setup() {
%1 = call i32 @setupDisp(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @setup() {
%1 = tail call i32 @setupDisp(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
int /*<<< orphan*/ unix_error(char *);
void csapp_fstat(int fd, struct stat *buf) {
  if (fstat(fd, buf) < 0)
    unix_error("fstat error");
}


x86 assembly (clang, -O0):
<csapp_fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0x0,%rax
jge    1151 <csapp_fstat+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<csapp_fstat>:
push   %rax
call   1040 <fstat@plt>
test   %rax,%rax
js     112d <csapp_fstat+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [12 x i8] c"fstat error\00"
define void @csapp_fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i32, i32* %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i64 @fstat(i32 %5, %struct.stat* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [12 x i8] c"fstat error\00"
define void @csapp_fstat(i32 %0, %struct.stat* nocapture %1) {
%3 = tail call i64 @fstat(i32 %0, %struct.stat* %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord2iv(int /*<<< orphan*/ *);
void TexCoord2iv(GLint v[2]) { glTexCoord2iv(v); }


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

x86 assembly (clang, -O2):
<TexCoord2iv>:
jmp    1030 <glTexCoord2iv@plt>

LLVM IR (-O0):
define void @TexCoord2iv(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @glTexCoord2iv(i32* %3)
ret void
}

LLVM IR (-O2):
define void @TexCoord2iv(i32* %0) {
%2 = tail call i32 @glTexCoord2iv(i32* %0)
ret void
}
int powp(int l, int l2) {
  int i;
  unsigned long d = 1;
  for (i = 0; i++ < l2; d *= l)
    ;
  return d;
}


x86 assembly (clang, -O0):
<powp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jge    1144 <powp+0x44>
jmp    1132 <powp+0x32>
movslq -0x4(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1119 <powp+0x19>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<powp>:
test   %esi,%esi
jle    111a <powp+0x1a>
mov    %edi,%ecx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1120 <powp+0x20>
mov    $0x1,%eax
jmp    1155 <powp+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <powp+0x30>
test   %edx,%edx
je     1169 <powp+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <powp+0x60>
ret

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

LLVM IR (-O2):
define i32 @powp(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %37
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %24, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 0, %9 ], [ %22, %11 ]
%14 = mul i64 %12, %5
%15 = mul i64 %14, %5
%16 = mul i64 %15, %5
%17 = mul i64 %16, %5
%18 = mul i64 %17, %5
%19 = mul i64 %18, %5
%20 = mul i64 %19, %5
%21 = mul i64 %20, %5
%22 = add i32 %13, 8
%23 = icmp eq i32 %22, %10
br i1 %23, label %24, label %11
24: ; preds = %11, %4
%25 = phi i64 [ undef, %4 ], [ %21, %11 ]
%26 = phi i64 [ 1, %4 ], [ %21, %11 ]
%27 = icmp eq i32 %7, 0
br i1 %27, label %34, label %28
28: ; preds = %24, %28
%29 = phi i64 [ %31, %28 ], [ %26, %24 ]
%30 = phi i32 [ %32, %28 ], [ 0, %24 ]
%31 = mul i64 %29, %5
%32 = add i32 %30, 1
%33 = icmp eq i32 %32, %7
br i1 %33, label %34, label %28
34: ; preds = %28, %24
%35 = phi i64 [ %25, %24 ], [ %31, %28 ]
%36 = trunc i64 %35 to i32
br label %37
37: ; preds = %34, %2
%38 = phi i32 [ 1, %2 ], [ %36, %34 ]
ret i32 %38
}
int test_imm_B2int64_lowword_reg(long long val) {
  return ((val) & (0xB2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B2int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 178
%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_B2int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 178
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cbt_findline(struct cbtree *from, int line, struct cbtree **node) {
  return 0;
}


x86 assembly (clang, -O0):
<cbt_findline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cbtree = type opaque
define i32 @cbt_findline(%struct.cbtree* %0, i32 %1, %struct.cbtree** %2) {
%4 = alloca %struct.cbtree*
%5 = alloca i32
%6 = alloca %struct.cbtree**
store %struct.cbtree* %0, %struct.cbtree** %4
store i32 %1, i32* %5
store %struct.cbtree** %2, %struct.cbtree*** %6
ret i32 0
}

LLVM IR (-O2):
%struct.cbtree = type opaque
define i32 @cbt_findline(%struct.cbtree* nocapture readnone %0, i32 %1, %struct.cbtree** nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimir_entero(int a) { printf("%d ", a); }


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

x86 assembly (clang, -O2):
<imprimir_entero>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @imprimir_entero(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int main() {
  f(4);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 4)
ret i32 0
}
int ocad_shutdown() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ocad_shutdown() {
ret i32 0
}
void bootblock_northbridge_init(void) {}


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

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

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

LLVM IR (-O2):
define void @bootblock_northbridge_init() {
ret void
}
extern void ftg_alloc_console(void) {}


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

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

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

LLVM IR (-O2):
define void @ftg_alloc_console() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void bzero(void *string, size_t number) {
  memset(string, 0, number);
  return;
}


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

x86 assembly (clang, -O2):
<bzero>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @bzero(i8* %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 = call i32 @memset(i8* %5, i32 0, i64 %6)
ret void
}

LLVM IR (-O2):
define void @bzero(i8* %0, i64 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i64 %1)
ret void
}