xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pdispatch_creds() {
  printf("NOT IMPLEMENTED:"
         "pa_pdispatch_creds"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_pdispatch_creds\00"
define i32 @pa_pdispatch_creds() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void genc_f_s() {}


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

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

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

LLVM IR (-O2):
define void @genc_f_s() {
ret void
}
void mutex_lock(struct mutex *lock) { return; }


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

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

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

LLVM IR (-O2):
%struct.mutex = type opaque
define void @mutex_lock(%struct.mutex* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void handle_err(const char *str) {
  perror(str);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_err>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @handle_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @handle_err(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
char *RCSid() {
  return RCSid("$Id: gadgets.c,v 1.80.2.1 2013/08/07 16:57:15 sfeam Exp $");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"$Id: gadgets.c,v 1.80.2.1 2013/08/07 16:57:15 sfeam Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
double DSConvertZUnitsToIn(int z, int zUnits) { return z * zUnits / 25400.0; }


x86 assembly (clang, -O0):
<DSConvertZUnitsToIn>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSConvertZUnitsToIn>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DSConvertZUnitsToIn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 2.540000e+04
ret double %9
}

LLVM IR (-O2):
define double @DSConvertZUnitsToIn(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 2.540000e+04
ret double %5
}
int tolower(int ch) {
  if (ch >= 'A' && ch <= 'Z')
    return ch - ('A' - 'a');
  return ch;
}


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <tolower+0x29>
mov    -0x8(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, -32
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int get_i(int, int);
int get_j(int index, int N) { return index - get_i(index, N) * N; }


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

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

LLVM IR (-O0):
define i32 @get_j(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @get_i(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_j(i32 %0, i32 %1) {
%3 = tail call i32 @get_i(i32 %0, i32 %1)
%4 = mul nsw i32 %3, %1
%5 = sub nsw i32 %0, %4
ret i32 %5
}
char getPubYear() {
  char year[4];
  printf("What year was it published?\n");
  scanf("%s", year);
  return year;
}


x86 assembly (clang, -O0):
<getPubYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x4(%rbp),%rsi
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0x4(%rbp),%rax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPubYear>:
push   %rbx
sub    $0x10,%rsp
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"What year was it published?\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define signext i8 @getPubYear() {
%1 = alloca [4 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = ptrtoint i8* %5 to i8
ret i8 %6
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [28 x i8] c"What year was it published?\00"
define signext i8 @getPubYear() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = ptrtoint [4 x i8]* %1 to i64
%6 = trunc i64 %5 to i8
ret i8 %6
}
char b64_to_safe(char c) {
  switch (c) {
  case '+':
    return '-';
    break;
  case '/':
    return '_';
    break;
  default:
    return c;
  }
}


x86 assembly (clang, -O0):
<b64_to_safe>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x2b,%eax
je     1130 <b64_to_safe+0x30>
jmp    111f <b64_to_safe+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2f,%eax
je     1139 <b64_to_safe+0x39>
jmp    1142 <b64_to_safe+0x42>
movb   $0x2d,-0x1(%rbp)
jmp    1148 <b64_to_safe+0x48>
movb   $0x5f,-0x1(%rbp)
jmp    1148 <b64_to_safe+0x48>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_to_safe>:
cmp    $0x2b,%edi
je     110f <b64_to_safe+0xf>
mov    %edi,%eax
cmp    $0x2f,%edi
jne    110e <b64_to_safe+0xe>
mov    $0x5f,%al
ret
mov    $0x2d,%al
ret

LLVM IR (-O0):
define signext i8 @b64_to_safe(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 43, label %6
i32 47, label %7
]
6: ; preds = %1
store i8 45, i8* %2
br label %10
7: ; preds = %1
store i8 95, i8* %2
br label %10
8: ; preds = %1
%9 = load i8, i8* %3
store i8 %9, i8* %2
br label %10
10: ; preds = %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @b64_to_safe(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %4 [
i32 43, label %5
i32 47, label %3
]
3: ; preds = %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %4, %3
%6 = phi i8 [ %0, %4 ], [ 95, %3 ], [ 45, %1 ]
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_js_http_post() { exit(1); }


x86 assembly (clang, -O0):
<caml_js_http_post>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_js_http_post>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_js_http_post() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_js_http_post() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
double t_ef(double t_nom, double d_vzk) { return (t_nom - 0.5 * d_vzk); }


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

x86 assembly (clang, -O2):
<t_ef>:
mulsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @t_ef(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 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %6, double %5)
ret double %7
}

LLVM IR (-O2):
define double @t_ef(double %0, double %1) {
%3 = tail call double @llvm.fmuladd.f64(double %1, double -5.000000e-01, double %0)
ret double %3
}
unsigned int xdr_roundup(unsigned int n) {
  unsigned int rounded;
  rounded = (((n) + (4) - 1) & ~((4) - 1));
  return rounded;
}


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

x86 assembly (clang, -O2):
<xdr_roundup>:
lea    0x3(%rdi),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @xdr_roundup(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 4
%6 = sub i32 %5, 1
%7 = and i32 %6, -4
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @xdr_roundup(i32 %0) {
%2 = add i32 %0, 3
%3 = and i32 %2, -4
ret i32 %3
}
int main(int input) {
  int y = 0;
  int x = 90;
  while (input) {
    x = 90;
    x = x + 1;
    y = y + 1;
  }
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x5a,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <main+0x44>
movl   $0x5a,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <main+0x1c>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 90
}
/* Variables and functions */
void *malloc(unsigned int);
void *my_malloc(unsigned bytes) { return (malloc(bytes)); }


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

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

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

LLVM IR (-O2):
define noalias i8* @my_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
void serial_speed(int tty, speed_t speed) {}


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

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

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

LLVM IR (-O2):
define void @serial_speed(i32 %0, i32 %1) {
ret void
}
int test_37(void) {
  int *ptr;
  return *ptr;
}


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

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

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

LLVM IR (-O2):
define i32 @test_37() {
ret i32 undef
}
int pthread_setcanceltype(int state, int *oldstate) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pthread_setcanceltype(i32 %0, i32* nocapture readnone %1) {
ret i32 0
}
int aa_imodulo(int a, int b) {
  return (((a) % (b)) + (b)) % (b);
  ;
}


x86 assembly (clang, -O0):
<aa_imodulo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
add    -0x8(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_imodulo>:
mov    %edi,%eax
cltd
idiv   %esi
lea    (%rdx,%rsi,1),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @aa_imodulo(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = add nsw i32 %3, %1
%5 = srem i32 %4, %1
ret i32 %5
}
int f(int x) {
  int i = 0;
  switch (x) {
  case 1:
    i++;
  case 2:
    i++;
  case 3:
    i++;
  case 4:
    i++;
  default:
    i++;
  }
  if (i > 2) {
    return i;
    i++;
  } else {
    return i;
    i++;
  }
  return 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x3,%eax
ja     115b <f+0x5b>
mov    -0x18(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1179 <f+0x79>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <f+0x7f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     1134 <f+0x34>
mov    $0x1,%eax
mov    $0x2,%edx
mov    $0x3,%ecx
lea    0xee2(%rip),%rsi
movslq (%rsi,%rdi,4),%rdi
add    %rsi,%rdi
jmp    *%rdi
mov    $0x4,%ecx
mov    %ecx,%edx
mov    %edx,%eax
add    $0x1,%eax
ret
xor    %eax,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %18 [
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 4, label %15
]
6: ; preds = %1
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %4
br label %9
9: ; preds = %1, %6
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
br label %12
12: ; preds = %1, %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %15
15: ; preds = %1, %12
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %18
18: ; preds = %1, %15
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %21
21: ; preds = %18
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32, i32* %4
store i32 %25, i32* %2
br label %28
26: ; preds = %21
%27 = load i32, i32* %4
store i32 %27, i32* %2
br label %28
28: ; preds = %26, %24
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
switch i32 %0, label %9 [
i32 1, label %2
i32 2, label %3
i32 3, label %5
i32 4, label %7
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 3, %1 ], [ 4, %2 ]
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 2, %1 ], [ %4, %3 ]
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ 1, %1 ], [ %6, %5 ]
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 0, %1 ], [ %8, %7 ]
%11 = add nuw nsw i32 %10, 1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_fd_or_socket(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<close_fd_or_socket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_fd_or_socket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int get_brightness();
int /*<<< orphan*/ set_brightness(int);
void inc_brightness() {
  int brightness = get_brightness();
  set_brightness(brightness == 0 ? 2 : brightness * 2);
}


x86 assembly (clang, -O0):
<inc_brightness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_brightness@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1149 <inc_brightness+0x29>
mov    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <inc_brightness+0x32>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <set_brightness@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inc_brightness>:
push   %rax
xor    %eax,%eax
call   1040 <get_brightness@plt>
lea    (%rax,%rax,1),%ecx
test   %eax,%eax
mov    $0x2,%edi
cmovne %ecx,%edi
pop    %rax
jmp    1030 <set_brightness@plt>

LLVM IR (-O0):
define void @inc_brightness() {
%1 = alloca i32
%2 = call i32 (...) @get_brightness()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %9
6: ; preds = %0
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, 2
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ 2, %5 ], [ %8, %6 ]
%11 = call i32 @set_brightness(i32 %10)
ret void
}

LLVM IR (-O2):
define void @inc_brightness() {
%1 = tail call i32 (...) @get_brightness()
%2 = icmp eq i32 %1, 0
%3 = shl nsw i32 %1, 1
%4 = select i1 %2, i32 2, i32 %3
%5 = tail call i32 @set_brightness(i32 %4)
ret void
}
int gl_fx_dummy_function_span(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl_fx_dummy_function_span() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void viewos_fini(void *arg) {
  printk("umsandnet_fini\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"umsandnet_fini\0A\00"
define void @viewos_fini(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"umsandnet_fini\0A\00"
define void @viewos_fini(i8* nocapture readnone %0) {
%2 = tail call i32 @printk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct value {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ collect(struct value *);
char *get_str(struct value *);
struct value *pop();
int /*<<< orphan*/ printf(char *, char *);
void builtin_output() {
  struct value *v = pop();
  char *s = get_str(v);
  printf("%s", s);
  collect(v);
}


x86 assembly (clang, -O0):
<builtin_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <pop@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <get_str@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <collect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_output>:
push   %rbx
xor    %eax,%eax
call   1040 <pop@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <get_str@plt>
lea    0xea6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <collect@plt>

LLVM IR (-O0):
%struct.value = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @builtin_output() {
%1 = alloca %struct.value*
%2 = alloca i8*
%3 = call %struct.value* (...) @pop()
store %struct.value* %3, %struct.value** %1
%4 = load %struct.value*, %struct.value** %1
%5 = call i8* @get_str(%struct.value* %4)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load %struct.value*, %struct.value** %1
%9 = call i32 @collect(%struct.value* %8)
ret void
}

LLVM IR (-O2):
%struct.value = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @builtin_output() {
%1 = tail call %struct.value* (...) @pop()
%2 = tail call i8* @get_str(%struct.value* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @collect(%struct.value* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ truclient_step(char *, char *, char *);
vuser_init() {
  truclient_step(
      "2",
      "Evaluate JavaScript code // Run conditions: var j....net/*', false);",
      "snapshot=Init_2.inf");
  return 0;
}


x86 assembly (clang, -O0):
<vuser_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
lea    0xf1e(%rip),%rdx
call   1030 <truclient_step@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuser_init>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee3(%rip),%rsi
lea    0xf21(%rip),%rdx
call   1030 <truclient_step@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"2\00"
@.str.1 = [69 x i8] c"Evaluate JavaScript code // Run conditions: var j....net/*', false);\00"
@.str.2 = [20 x i8] c"snapshot=Init_2.inf\00"
define i32 @vuser_init() {
%1 = call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
@.str.1 = [69 x i8] c"Evaluate JavaScript code // Run conditions: var j....net/*', false);\00"
@.str.2 = [20 x i8] c"snapshot=Init_2.inf\00"
define i32 @vuser_init() {
%1 = tail call i32 @truclient_step(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x73() {
  Assert_real((isupper(115) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              580, ("isupper should be 0 for s"));
}


x86 assembly (clang, -O0):
<t_isupper_0x73>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x244,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x73>:
push   %rax
mov    $0x73,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x244,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for s\00"
define void @t_isupper_0x73() {
%1 = call i64 @isupper(i32 115)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for s\00"
define void @t_isupper_0x73() {
%1 = tail call i64 @isupper(i32 115)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int u_int16_t;
typedef int int16_t;

/* Variables and functions */
int16_t swap16(int16_t x) {
  return ((((u_int16_t)x & 0x00ffU) << 8) | (((u_int16_t)x & 0xff00U) >> 8));
}


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
void _print_stack(char *fname, struct stack *s) {}


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

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

LLVM IR (-O0):
%struct.stack = type opaque
define void @_print_stack(i8* %0, %struct.stack* %1) {
%3 = alloca i8*
%4 = alloca %struct.stack*
store i8* %0, i8** %3
store %struct.stack* %1, %struct.stack** %4
ret void
}

LLVM IR (-O2):
%struct.stack = type opaque
define void @_print_stack(i8* nocapture %0, %struct.stack* nocapture %1) {
ret void
}
/* Variables and functions */
float const INFINITY;
bool stdlib_base_is_finitef(const float x) {
  return (x == x && x < INFINITY && x > -INFINITY);
}


x86 assembly (clang, -O0):
<stdlib_base_is_finitef>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
ucomiss -0x4(%rbp),%xmm0
mov    %al,-0x5(%rbp)
jne    1167 <stdlib_base_is_finitef+0x67>
jp     1167 <stdlib_base_is_finitef+0x67>
movss  -0x4(%rbp),%xmm1
mov    0x2eb9(%rip),%rax
movss  (%rax),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0x5(%rbp)
jbe    1167 <stdlib_base_is_finitef+0x67>
movss  -0x4(%rbp),%xmm0
mov    0x2e9b(%rip),%rax
movss  (%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
ucomiss %xmm1,%xmm0
seta   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@INFINITY = constant float 0.000000e+00
define i32 @stdlib_base_is_finitef(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fcmp oeq float %3, %4
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load float, float* %2
%8 = load float, float* @INFINITY
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load float, float* %2
%12 = load float, float* @INFINITY
%13 = fneg float %12
%14 = fcmp ogt float %11, %13
br label %15
15: ; preds = %10, %6, %1
%16 = phi i1 [ false, %6 ], [ false, %1 ], [ %14, %10 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@INFINITY = constant float 0.000000e+00
define i32 @stdlib_base_is_finitef(float %0) {
ret i32 0
}
int pxad_toggle_reserved_channel(int legacy_channel) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pxad_toggle_reserved_channel(i32 %0) {
ret i32 0
}
message(s, a, b, c) char *s, *a, *b, *c;
{
  printf("- ");
  printf(s, a, b, c);
  printf("\n");
}


x86 assembly (clang, -O0):
<message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"- \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @message(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i8*, i8** %9
%15 = call i32 (i8*, ...) @printf(i8* %11, i8* %12, i8* %13, i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"- \00"
define i32 @message(i8* nocapture %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i8* %1, i8* %2, i8* %3)
%7 = tail call i32 @putchar(i32 10)
ret i32 undef
}
/* Type definitions */
typedef int __u8;
typedef int __u16;

/* Variables and functions */
__u8 nvme_status_type(__u16 status) { return (status & 0x700) >> 8; }


x86 assembly (clang, -O0):
<nvme_status_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x700,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_status_type>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @nvme_status_type(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1792
%5 = ashr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @nvme_status_type(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 7
ret i32 %3
}
/* Type definitions */
struct timeb {
  int time;
  int millitm;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
int gettime(void) {
  struct timeb timebuffer;
  ftime(&timebuffer);
  return (timebuffer.time * 1000) + timebuffer.millitm;
}


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

x86 assembly (clang, -O2):
<gettime>:
push   %rax
mov    %rsp,%rdi
call   1030 <ftime@plt>
imul   $0x3e8,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.timeb = type { i32, i32 }
define i32 @gettime() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
/* Variables and functions */
scalar_t__ ptsname_r(int, char *, int);
char *ptsname(int fd) {
  static char buffer[256];
  if (ptsname_r(fd, buffer, 256) == 0) {
    return buffer;
  };
  return NULL;
}


x86 assembly (clang, -O0):
<ptsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x100,%edx
call   1030 <ptsname_r@plt>
cmp    $0x0,%rax
jne    1149 <ptsname+0x39>
lea    0x2f00(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <ptsname+0x41>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptsname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x100,%edx
call   1030 <ptsname_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ptsname.buffer = internal global [256 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ptsname_r(i32 %4, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ptsname.buffer, i64 0, i64 0), i32 256)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ptsname.buffer, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@ptsname.buffer = internal global [256 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = tail call i64 @ptsname_r(i32 %0, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ptsname.buffer, i64 0, i64 0), i32 256)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @ptsname.buffer, i64 0, i64 0), i8* null
ret i8* %4
}
int UAX_Asm_RegIsWordP(int reg) {
  if ((reg & 0xF0) == 0x20)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<UAX_Asm_RegIsWordP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
cmp    $0x20,%eax
jne    1124 <UAX_Asm_RegIsWordP+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <UAX_Asm_RegIsWordP+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UAX_Asm_RegIsWordP>:
and    $0xf0,%edi
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @UAX_Asm_RegIsWordP(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 240
%6 = icmp eq i32 %5, 32
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @UAX_Asm_RegIsWordP(i32 %0) {
%2 = and i32 %0, 240
%3 = icmp eq i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
int xmlUCSIsHighPrivateUseSurrogates(int code) {
  return (((code >= 0xDB80) && (code <= 0xDBFF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsHighPrivateUseSurrogates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xdb80,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsHighPrivateUseSurrogates+0x26>
cmpl   $0xdbff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsHighPrivateUseSurrogates>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xdb80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsHighPrivateUseSurrogates(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 56192
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 56319
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsHighPrivateUseSurrogates(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 56192
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glOrtho(double, double, double, double, double, double);
void init() {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glOrtho(-1.2, 1.2, -1.2, 1.2, -1.0, 1.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1050 <glClearColor@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1060 <glLoadIdentity@plt>
movsd  0xe8e(%rip),%xmm2
movsd  0xe8e(%rip),%xmm3
movsd  0xe8e(%rip),%xmm4
movsd  0xe8e(%rip),%xmm5
movaps %xmm2,%xmm0
movaps %xmm3,%xmm1
call   1040 <glOrtho@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1050 <glClearColor@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1060 <glLoadIdentity@plt>
movsd  0xe91(%rip),%xmm0
movsd  0xe91(%rip),%xmm1
movsd  0xe91(%rip),%xmm4
movsd  0xe91(%rip),%xmm5
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
pop    %rax
jmp    1040 <glOrtho@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = call i32 @glMatrixMode(i32 %2)
%4 = call i32 (...) @glLoadIdentity()
%5 = call i32 @glOrtho(double -1.200000e+00, double 1.200000e+00, double -1.200000e+00, double 1.200000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_PROJECTION
%3 = tail call i32 @glMatrixMode(i32 %2)
%4 = tail call i32 (...) @glLoadIdentity()
%5 = tail call i32 @glOrtho(double -1.200000e+00, double 1.200000e+00, double -1.200000e+00, double 1.200000e+00, double -1.000000e+00, double 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int main() {
  char *x = (char *)malloc(10 * sizeof(char *));
  free(x);
  return x[5];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movsbl 0x5(%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x50,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <free@plt>
movsbl 0x5(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 80)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 80)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @free(i8* %2)
%4 = getelementptr inbounds i8, i8* %2, i64 5
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
void sv_call_handler(void) {
  while (true)
    ;
}


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

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

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

LLVM IR (-O2):
define void @sv_call_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_TYPE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_ANY_it;
scalar_t__ ASN1_item_d2i(int /*<<< orphan*/ **, unsigned char const **, long,
                         int /*<<< orphan*/ *);
ASN1_TYPE *d2i_ASN1_TYPE(ASN1_TYPE **a, const unsigned char **in, long len) {
  return (ASN1_TYPE *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, &ASN1_ANY_it);
}


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

x86 assembly (clang, -O2):
<d2i_ASN1_TYPE>:
mov    0x2ec9(%rip),%rcx
jmp    1030 <ASN1_item_d2i@plt>

LLVM IR (-O0):
@ASN1_ANY_it = global i32 0
define i32* @d2i_ASN1_TYPE(i32** %0, i8** %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i8**
%6 = alloca i64
store i32** %0, i32*** %4
store i8** %1, i8*** %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i8**, i8*** %5
%9 = load i64, i64* %6
%10 = call i64 @ASN1_item_d2i(i32** %7, i8** %8, i64 %9, i32* @ASN1_ANY_it)
%11 = inttoptr i64 %10 to i32*
ret i32* %11
}

LLVM IR (-O2):
@ASN1_ANY_it = global i32 0
define i32* @d2i_ASN1_TYPE(i32** %0, i8** %1, i64 %2) {
%4 = tail call i64 @ASN1_item_d2i(i32** %0, i8** %1, i64 %2, i32* @ASN1_ANY_it)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void f(void) {
  assert(0);
  printf("hello, this is \"void f(void)\"\n");
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <assert@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
xor    %edi,%edi
call   1040 <assert@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"hello, this is \22void f(void)\22\0A\00"
define void @f() {
%1 = call i32 @assert(i32 0)
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"hello, this is \22void f(void)\22\00"
define void @f() {
%1 = tail call i32 @assert(i32 0)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}