xunge/DecIR huggingface dataset:
/* Variables and functions */
double arccos(int);
double arcsec(double n) { return arccos(1 / n); }


x86 assembly (clang, -O0):
<arcsec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <arccos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arcsec>:
movsd  0xee8(%rip),%xmm1
divsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
jmp    1030 <arccos@plt>

LLVM IR (-O0):
define double @arcsec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @arccos(i32 %5)
ret double %6
}

LLVM IR (-O2):
define double @arcsec(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @arccos(i32 %3)
ret double %4
}
const char *protect_end(const char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @protect_end(i8* readnone returned %0) {
ret i8* %0
}
void isr_memfault(void) {
  while (1)
    ;
  ;
}


x86 assembly (clang, -O0):
<isr_memfault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <isr_memfault+0x9>
jmp    1109 <isr_memfault+0x9>

x86 assembly (clang, -O2):
<isr_memfault>:
jmp    1100 <isr_memfault>

LLVM IR (-O0):
define void @isr_memfault() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @isr_memfault() {
br label %1
1: ; preds = %0, %1
br label %1
}
int main(void) {
  int a = 5;
  int b = 0x10030;
  a <<= 1;
  b >>= a;
  return a + b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x10030,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 74
}
/* Variables and functions */
int percent(double);
int /*<<< orphan*/ printf(char *, char *, int);
void print(char *in, double ratio) {
  printf("'%s' (%d%%)\n", in, percent(ratio));
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <percent@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rdi,%rbx
call   1040 <percent@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"'%s' (%d%%)\0A\00"
define void @print(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load i8*, i8** %3
%6 = load double, double* %4
%7 = call i32 @percent(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"'%s' (%d%%)\0A\00"
define void @print(i8* %0, double %1) {
%3 = tail call i32 @percent(double %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
char getchar();
void getchars(char *start, int count) {
  for (int i = 0; i < count; i++) {
    char c = getchar();
    *(start + i) = c;
  }
}


x86 assembly (clang, -O0):
<getchars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1158 <getchars+0x48>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <getchars+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchars>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <getchars+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <getchars+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @getchars(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %11, %7 ]
%9 = tail call signext i8 (...) @getchar()
%10 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %9, i8* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %6, label %7
}
void f(int a, int b) { &b - &a; }


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

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

LLVM IR (-O0):
define void @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = ptrtoint i32* %4 to i64
%6 = ptrtoint i32* %3 to i64
%7 = sub i64 %5, %6
%8 = sdiv exact i64 %7, 4
ret void
}

LLVM IR (-O2):
define void @f(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addnchar(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void addstr(char *s) { addnchar(s, strlen(s)); }


x86 assembly (clang, -O0):
<addstr>:
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   1040 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <addnchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addstr>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <addnchar@plt>

LLVM IR (-O0):
define void @addstr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @addnchar(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @addstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @addnchar(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char const *);
void err(const char *msg) {
  printf(msg);
  printf("------- End Graph Min Cuts -------\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"------- End Graph Min Cuts -------\0A\00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [35 x i8] c"------- End Graph Min Cuts -------\00"
define void @err(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
void RTAvloIOPortDoWithAll(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ABGRToYRow_Any_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(float *);
scalar_t__ malloc(int);
float *new_Float(const float value) {
  float *p = (float *)malloc(sizeof(float));
  assert(p);
  *p = value;
  return p;
}


x86 assembly (clang, -O0):
<new_Float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_Float>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,(%rbx)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define float* @new_Float(float %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to float*
%4 = tail call i32 @assert(float* %3)
store float %0, float* %3
ret float* %3
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR44_get(void) { return U_WMRCORENONE_get("U_WMR44"); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR44\00"
define i32 @U_WMR44_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void *io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) {
  return (((char *)mapping) + offset);
}


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

x86 assembly (clang, -O2):
<io_mapping_map_wc>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
%struct.io_mapping = type opaque
define i8* @io_mapping_map_wc(%struct.io_mapping* %0, i64 %1) {
%3 = alloca %struct.io_mapping*
%4 = alloca i64
store %struct.io_mapping* %0, %struct.io_mapping** %3
store i64 %1, i64* %4
%5 = load %struct.io_mapping*, %struct.io_mapping** %3
%6 = bitcast %struct.io_mapping* %5 to i8*
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
ret i8* %8
}

LLVM IR (-O2):
%struct.io_mapping = type opaque
define i8* @io_mapping_map_wc(%struct.io_mapping* readnone %0, i64 %1) {
%3 = bitcast %struct.io_mapping* %0 to i8*
%4 = getelementptr inbounds i8, i8* %3, i64 %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void reuse_null_size(void) {
  fputs("Null size allocation requested!\n", stderr);
  abort();
}


x86 assembly (clang, -O0):
<reuse_null_size>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<reuse_null_size>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1040 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Null size allocation requested!\0A\00"
@stderr = global i32 0
define void @reuse_null_size() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [33 x i8] c"Null size allocation requested!\0A\00"
@stderr = global i32 0
define void @reuse_null_size() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @abort()
unreachable
}
char find_grade(float student_score, float a, float b, float c, float d) {
  char grade;
  if (student_score >= a)
    grade = 'A';
  else if (student_score >= b)
    grade = 'B';
  else if (student_score >= c)
    grade = 'C';
  else
    grade = 'D';
  return (grade);
}


x86 assembly (clang, -O0):
<find_grade>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     1135 <find_grade+0x35>
movb   $0x41,-0x15(%rbp)
jmp    1173 <find_grade+0x73>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jb     114d <find_grade+0x4d>
movb   $0x42,-0x15(%rbp)
jmp    116e <find_grade+0x6e>
movss  -0x4(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jb     1165 <find_grade+0x65>
movb   $0x43,-0x15(%rbp)
jmp    1169 <find_grade+0x69>
movb   $0x44,-0x15(%rbp)
jmp    116e <find_grade+0x6e>
jmp    1173 <find_grade+0x73>
movsbl -0x15(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_grade>:
mov    $0x41,%al
ucomiss %xmm1,%xmm0
jae    1115 <find_grade+0x15>
mov    $0x42,%al
ucomiss %xmm2,%xmm0
jae    1115 <find_grade+0x15>
ucomiss %xmm3,%xmm0
mov    $0x43,%al
adc    $0x0,%al
ret

LLVM IR (-O0):
define signext i8 @find_grade(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i8
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fcmp oge float %12, %13
br i1 %14, label %15, label %16
15: ; preds = %5
store i8 65, i8* %11
br label %29
16: ; preds = %5
%17 = load float, float* %6
%18 = load float, float* %8
%19 = fcmp oge float %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 66, i8* %11
br label %28
21: ; preds = %16
%22 = load float, float* %6
%23 = load float, float* %9
%24 = fcmp oge float %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
store i8 67, i8* %11
br label %27
26: ; preds = %21
store i8 68, i8* %11
br label %27
27: ; preds = %26, %25
br label %28
28: ; preds = %27, %20
br label %29
29: ; preds = %28, %15
%30 = load i8, i8* %11
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @find_grade(float %0, float %1, float %2, float %3, float %4) {
%6 = fcmp ult float %0, %1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = fcmp ult float %0, %2
br i1 %8, label %9, label %12
9: ; preds = %7
%10 = fcmp ult float %0, %3
%11 = select i1 %10, i8 68, i8 67
br label %12
12: ; preds = %9, %7, %5
%13 = phi i8 [ 65, %5 ], [ 66, %7 ], [ %11, %9 ]
ret i8 %13
}
int lstat(path, buf)
char *path;
struct stat *buf;
{
  extern int stat();
  return (stat(path, buf));
}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = load i8*, i8** %3
%6 = load %struct.stat*, %struct.stat** %4
%7 = call i32 (i8*, %struct.stat*, ...) bitcast (i32 (...)* @stat to i32 (i8*, %struct.stat*, ...)*)(i8* %5, %struct.stat* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = tail call i32 (i8*, %struct.stat*, ...) bitcast (i32 (...)* @stat to i32 (i8*, %struct.stat*, ...)*)(i8* %0, %struct.stat* %1)
ret i32 %3
}
int rotate_left(unsigned x, int n) {
  int w = sizeof(x) << 3;
  int left = (x << (w - n - 1)) << 1;
  int right = x >> n;
  return left + right;
}


x86 assembly (clang, -O0):
<rotate_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shl    %cl,%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_left>:
mov    $0x1f,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = sub nsw i32 %11, 1
%13 = shl i32 %8, %12
%14 = shl i32 %13, 1
store i32 %14, i32* %6
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = lshr i32 %15, %16
store i32 %17, i32* %7
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = sub i32 31, %1
%4 = shl i32 %0, %3
%5 = shl i32 %4, 1
%6 = lshr i32 %0, %1
%7 = add nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int bar(int);
int main() {
  assert(bar(5) == 20);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <bar@plt>
cmp    $0x14,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <bar@plt>
xor    %edi,%edi
cmp    $0x14,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 5)
%3 = icmp eq i32 %2, 20
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 5)
%2 = icmp eq i32 %1, 20
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("Hello!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct qserver {
  int dummy;
};

/* Variables and functions */
int bind_qserver2(struct qserver *, int);
int bind_qserver(struct qserver *server) { return bind_qserver2(server, 1); }


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

x86 assembly (clang, -O2):
<bind_qserver>:
mov    $0x1,%esi
jmp    1030 <bind_qserver2@plt>

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

LLVM IR (-O2):
%struct.qserver = type { i32 }
define i32 @bind_qserver(%struct.qserver* %0) {
%2 = tail call i32 @bind_qserver2(%struct.qserver* %0, i32 1)
ret i32 %2
}
void ROM_SysCtlClockSet(unsigned long i) {}


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

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

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

LLVM IR (-O2):
define void @ROM_SysCtlClockSet(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char);
void uart_puts(char *s) {
  while (*s) {
    if (*s == '\n') {
      uart_putc('\r');
    }
    uart_putc(*s++);
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <uart_puts+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1143 <uart_puts+0x33>
mov    $0xd,%edi
call   1030 <uart_putc@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
jmp    111c <uart_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    %rdi,%rbx
jmp    1139 <uart_puts+0x29>
cs nopw 0x0(%rax,%rax,1)
mov    $0xd,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
movsbl %al,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1120 <uart_puts+0x10>
test   %al,%al
jne    112d <uart_puts+0x1d>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = load i8, i8* %3
switch i8 %4, label %8 [
i8 0, label %12
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 @uart_putc(i8 signext 13)
%7 = load i8, i8* %3
br label %8
8: ; preds = %2, %5
%9 = phi i8 [ %4, %2 ], [ %7, %5 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = tail call i32 @uart_putc(i8 signext %9)
br label %2
12: ; preds = %2
ret void
}
/* Variables and functions */
int f();
int main(void) {
  int x;
  int tmp;
  int y;
  int tmp___0;
  {
    {
      tmp = f();
      x = tmp;
      tmp___0 = f();
      y = tmp___0;
    }
    if (x != y) {
    ERROR:
      goto ERROR;
    } else {
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     1155 <main+0x45>
jmp    1150 <main+0x40>
jmp    1150 <main+0x40>
jmp    115a <main+0x4a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f@plt>
cmp    %eax,%ebx
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret
nopl   0x0(%rax)
jmp    1130 <main+0x20>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @f()
%3 = icmp eq i32 %1, %2
br i1 %3, label %5, label %4
4: ; preds = %0, %4
br label %4
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned int *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ malloc(int);
unsigned int *binReadUints(FILE *fin, int n) {
  unsigned int *x_ptr = (unsigned int *)malloc(n * sizeof(unsigned int));
  fread(x_ptr, sizeof(unsigned int), n, fin);
  fseek(fin, 0, SEEK_SET);
  return x_ptr;
}


x86 assembly (clang, -O0):
<binReadUints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x4,%esi
call   1030 <fread@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e6e(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binReadUints>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    $0x4,%esi
mov    %ebx,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32* @binReadUints(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 = sext i32 %6 to i64
%8 = mul i64 %7, 4
%9 = trunc i64 %8 to i32
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %5
%12 = load i32*, i32** %5
%13 = load i32, i32* %4
%14 = load i32*, i32** %3
%15 = call i32 @fread(i32* %12, i32 4, i32 %13, i32* %14)
%16 = load i32*, i32** %3
%17 = load i32, i32* @SEEK_SET
%18 = call i32 @fseek(i32* %16, i32 0, i32 %17)
%19 = load i32*, i32** %5
ret i32* %19
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32* @binReadUints(i32* nocapture %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i32*
%6 = tail call i32 @fread(i32* %5, i32 4, i32 %1, i32* %0)
%7 = load i32, i32* @SEEK_SET
%8 = tail call i32 @fseek(i32* %0, i32 0, i32 %7)
ret i32* %5
}
int gl2psPrintPDFCompressorType() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl2psPrintPDFCompressorType() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int /*<<< orphan*/);
int main(void) { return !malloc(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <malloc@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <malloc@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @malloc(i32 0)
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 0)
%2 = icmp eq i32 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void DieWithUserMessage(const char *msg, const char *detail) {
  fputs(msg, stderr);
  fputs(": ", stderr);
  fputs(detail, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<DieWithUserMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
lea    0xe9e(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rdi
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<DieWithUserMessage>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    0x2ea2(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xeb2(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c": \00"
define void @DieWithUserMessage(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 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* %5, i32 %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i8*, i8** %4
%11 = load i32, i32* @stderr
%12 = call i32 @fputs(i8* %10, i32 %11)
%13 = load i32, i32* @stderr
%14 = call i32 @fputc(i8 signext 10, i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c": \00"
define void @DieWithUserMessage(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* %0, i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stderr
%8 = tail call i32 @fputs(i8* %1, i32 %7)
%9 = load i32, i32* @stderr
%10 = tail call i32 @fputc(i8 signext 10, i32 %9)
%11 = tail call i32 @exit(i32 1)
unreachable
}
void wo5_way_close() {}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo498() {
ret void
}
void remove_newline(char *buffer) {
  char *p = buffer;
  while (*p != '\0') {
    if (*p == '\n') {
      *p = '\0';
      break;
    }
    p++;
  }
}


x86 assembly (clang, -O0):
<remove_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <remove_newline+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    113c <remove_newline+0x3c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    114d <remove_newline+0x4d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <remove_newline+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newline>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <remove_newline+0x14>
cmp    $0xa,%al
je     1111 <remove_newline+0x11>
add    $0x1,%rdi
jmp    1100 <remove_newline>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_newline(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
circular_shift(unsigned x, int n) {
  const int SIZE = sizeof(x) * 8;
  int mod_n = n % SIZE;
  int gap = SIZE - mod_n;
  return (x & ~(~0 << mod_n) << gap) >> gap | (x << mod_n);
}


x86 assembly (clang, -O0):
<circular_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    $0x20,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x14(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    -0x14(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_shift>:
lea    0x1f(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
and    $0xe0,%eax
sub    %eax,%esi
mov    $0xffffffff,%edx
mov    %esi,%ecx
shl    %cl,%edx
mov    %edi,%eax
not    %edx
neg    %cl
shl    %cl,%edx
and    %edi,%edx
mov    %esi,%ecx
shld   %cl,%edx,%eax
ret

LLVM IR (-O0):
define i32 @circular_shift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%8 = load i32, i32* %4
%9 = srem i32 %8, 32
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = sub nsw i32 32, %10
store i32 %11, i32* %7
%12 = load i32, i32* %3
%13 = load i32, i32* %6
%14 = shl i32 -1, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %7
%17 = shl i32 %15, %16
%18 = and i32 %12, %17
%19 = load i32, i32* %7
%20 = lshr i32 %18, %19
%21 = load i32, i32* %3
%22 = load i32, i32* %6
%23 = shl i32 %21, %22
%24 = or i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @circular_shift(i32 %0, i32 %1) {
%3 = srem i32 %1, 32
%4 = sub nsw i32 32, %3
%5 = shl nsw i32 -1, %3
%6 = xor i32 %5, -1
%7 = shl i32 %6, %4
%8 = and i32 %7, %0
%9 = lshr i32 %8, %4
%10 = shl i32 %0, %3
%11 = or i32 %9, %10
ret i32 %11
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int get_fchost_nr();
int wrap_get_fchost_nr(struct activity *a) {
  int n = 0;
  if ((n = get_fchost_nr()) > 0) {
    if (n > 65536)
      return 65536;
    else
      return n;
  }
  return 0;
}


x86 assembly (clang, -O0):
<wrap_get_fchost_nr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <get_fchost_nr@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    115a <wrap_get_fchost_nr+0x4a>
cmpl   $0x10000,-0x14(%rbp)
jle    114f <wrap_get_fchost_nr+0x3f>
movl   $0x10000,-0x4(%rbp)
jmp    1161 <wrap_get_fchost_nr+0x51>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <wrap_get_fchost_nr+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_get_fchost_nr>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <get_fchost_nr@plt>
cmp    $0x10000,%eax
mov    $0x10000,%ecx
cmovge %ecx,%eax
test   %eax,%eax
cmovs  %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.activity = type { i32 }
define i32 @wrap_get_fchost_nr(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 (...) @get_fchost_nr()
%3 = icmp slt i32 %2, 65536
%4 = select i1 %3, i32 %2, i32 65536
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
ret i32 %6
}
void DrawTransWSpan(struct WLine *pWline) {}


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

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

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

LLVM IR (-O2):
%struct.WLine = type opaque
define void @DrawTransWSpan(%struct.WLine* nocapture %0) {
ret void
}
void ff_get_cpu_max_align_ppc() {}


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

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

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

LLVM IR (-O2):
define void @ff_get_cpu_max_align_ppc() {
ret void
}
int fun1109() { return 1109; }


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

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

LLVM IR (-O0):
define i32 @fun1109() {
ret i32 1109
}

LLVM IR (-O2):
define i32 @fun1109() {
ret i32 1109
}
int globalvar_add_simple_bool(const char *name, int *value) { return 0; }


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

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

LLVM IR (-O0):
define i32 @globalvar_add_simple_bool(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @globalvar_add_simple_bool(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
float fabs(float);
float error_relativo(float parm1, float parm2) {
  float temp1;
  float temp2;
  temp1 = fabs(parm1 - parm2);
  temp2 = fabs(temp1 / parm1);
  return temp2;
}


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

x86 assembly (clang, -O2):
<error_relativo>:
movaps %xmm0,%xmm2
subss  %xmm1,%xmm2
movaps 0xef2(%rip),%xmm1
andps  %xmm1,%xmm2
divss  %xmm0,%xmm2
andps  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @error_relativo(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = call float @fabs(float %9)
store float %10, float* %5
%11 = load float, float* %5
%12 = load float, float* %3
%13 = fdiv float %11, %12
%14 = call float @fabs(float %13)
store float %14, float* %6
%15 = load float, float* %6
ret float %15
}

LLVM IR (-O2):
define float @error_relativo(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call float @llvm.fabs.f32(float %3)
%5 = fdiv float %4, %0
%6 = tail call float @llvm.fabs.f32(float %5)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t ntohl(uint32_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @ntohl(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_chmod;
int syscall(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int chmod(const char *path, mode_t mode) {
  return syscall(SYS_chmod, path, mode);
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
@SYS_chmod = global i32 0
define i32 @chmod(i8* %0, i32 %1) {
%3 = load i32, i32* @SYS_chmod
%4 = tail call i32 @syscall(i32 %3, i8* %0, i32 %1)
ret i32 %4
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_insert(struct buffer *, char *, int);
void buffer_insert_short(struct buffer *buf, unsigned short value) {
  buffer_insert(buf, (char *)&value, 2);
}


x86 assembly (clang, -O0):
<buffer_insert_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x2,%edx
call   1030 <buffer_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buffer_insert_short>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <buffer_insert@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @buffer_insert_short(%struct.buffer* %0, i16 zeroext %1) {
%3 = alloca %struct.buffer*
%4 = alloca i16
store %struct.buffer* %0, %struct.buffer** %3
store i16 %1, i16* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = bitcast i16* %4 to i8*
%7 = call i32 @buffer_insert(%struct.buffer* %5, i8* %6, i32 2)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @buffer_insert_short(%struct.buffer* %0, i16 zeroext %1) {
%3 = alloca i16
store i16 %1, i16* %3
%4 = bitcast i16* %3 to i8*
%5 = call i32 @buffer_insert(%struct.buffer* %0, i8* %4, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *err) {
  fprintf(stderr, "usage: %s\n", err);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"usage: %s\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
__u64 mk_btversion(int mjr, int mnr, int sub) {
  return ((mjr & 0xff) << 16) | ((mnr & 0xff) << 8) | (sub & 0xff);
}


x86 assembly (clang, -O0):
<mk_btversion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_btversion>:
movzbl %dil,%eax
shl    $0x10,%eax
shl    $0x8,%esi
movzwl %si,%ecx
or     %eax,%ecx
movzbl %dl,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mk_btversion(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 = and i32 %7, 255
%9 = shl i32 %8, 16
%10 = load i32, i32* %5
%11 = and i32 %10, 255
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %6
%15 = and i32 %14, 255
%16 = or i32 %13, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @mk_btversion(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = and i32 %4, 16711680
%6 = shl i32 %1, 8
%7 = and i32 %6, 65280
%8 = or i32 %7, %5
%9 = and i32 %2, 255
%10 = or i32 %8, %9
ret i32 %10
}