xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned char fa_read_byte(FILE *fp) {
  unsigned char cx;
  unsigned char temp[1];
  int ret;
  ret = fread(temp, sizeof(*temp), 1, fp);
  cx = temp[0];
  return cx;
}


x86 assembly (clang, -O0):
<fa_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
mov    %eax,-0x10(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_read_byte>:
push   %rax
mov    %rdi,%rcx
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @fa_read_byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
%4 = alloca [1 x i8]
%5 = alloca i32
store i32* %0, i32** %2
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%7 = load i32*, i32** %2
%8 = call i32 @fread(i8* %6, i32 1, i32 1, i32* %7)
store i32 %8, i32* %5
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %4, i64 0, i64 0
%10 = load i8, i8* %9
store i8 %10, i8* %3
%11 = load i8, i8* %3
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @fa_read_byte(i32* nocapture %0) {
%2 = alloca [1 x i8]
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %0)
%5 = load i8, i8* %3
ret i8 %5
}
int gb_clamp_int(int min, int value, int max) {
  if (value < min)
    return min;
  if (value > max)
    return max;
  return value;
}


x86 assembly (clang, -O0):
<gb_clamp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1124 <gb_clamp_int+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <gb_clamp_int+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <gb_clamp_int+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <gb_clamp_int+0x41>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gb_clamp_int>:
mov    %edx,%eax
cmp    %edx,%esi
cmovle %esi,%eax
cmp    %edi,%esi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gb_clamp_int(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %0
%5 = icmp sgt i32 %1, %2
%6 = select i1 %5, i32 %2, i32 %1
%7 = select i1 %4, i32 %0, i32 %6
ret i32 %7
}
void test19_TT_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test19_TT_targetInit__I() {
ret void
}
int process(void *arg) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @process(i8* nocapture readnone %0) {
ret i32 0
}
int buffer_overflow() {
  int x[10] = {0};
  return x[100];
}


x86 assembly (clang, -O0):
<buffer_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
mov    0x160(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @buffer_overflow() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 100
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @buffer_overflow() {
ret i32 poison
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double r(void) { return (double)rand() / (double)RAND_MAX; }


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @r() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @r() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fdiv double %2, %4
ret double %5
}
/* Type definitions */
struct sensor_network {
  int dummy;
};
struct grid {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ do_grd_debug0(struct sensor_network const *,
                                 struct grid const *, int);
void grd_debug0(const struct sensor_network *sn, const struct grid *g) {
  do_grd_debug0(sn, g, 1);
}


x86 assembly (clang, -O0):
<grd_debug0>:
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    $0x1,%edx
call   1030 <do_grd_debug0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grd_debug0>:
mov    $0x1,%edx
jmp    1030 <do_grd_debug0@plt>

LLVM IR (-O0):
%struct.sensor_network = type { i32 }
%struct.grid = type { i32 }
define void @grd_debug0(%struct.sensor_network* %0, %struct.grid* %1) {
%3 = alloca %struct.sensor_network*
%4 = alloca %struct.grid*
store %struct.sensor_network* %0, %struct.sensor_network** %3
store %struct.grid* %1, %struct.grid** %4
%5 = load %struct.sensor_network*, %struct.sensor_network** %3
%6 = load %struct.grid*, %struct.grid** %4
%7 = call i32 @do_grd_debug0(%struct.sensor_network* %5, %struct.grid* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.sensor_network = type { i32 }
%struct.grid = type { i32 }
define void @grd_debug0(%struct.sensor_network* %0, %struct.grid* %1) {
%3 = tail call i32 @do_grd_debug0(%struct.sensor_network* %0, %struct.grid* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ div();
int /*<<< orphan*/ swap();
zmod() {
  div();
  swap();
}


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

x86 assembly (clang, -O2):
<zmod>:
push   %rax
xor    %eax,%eax
call   1030 <div@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <swap@plt>

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

LLVM IR (-O2):
define i32 @zmod() {
%1 = tail call i32 (...) @div()
%2 = tail call i32 (...) @swap()
ret i32 undef
}
f(a) {
  switch (a) { case 1 ... 1:; }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
jne    111d <f+0x1d>
jmp    1118 <f+0x18>
jmp    111d <f+0x1d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
]
5: ; preds = %1
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long blue_mask;
};
typedef TYPE_1__ Visual;

/* Variables and functions */
void set_Visual_blue_mask(void *_p, unsigned long _v) {
  ((Visual *)_p)->blue_mask = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_Visual_blue_mask>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_Visual_blue_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
_Bool QuietLessGreater(double f1, double f2) {
  return __builtin_islessgreater(f1, f2);
}


x86 assembly (clang, -O0):
<QuietLessGreater>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuietLessGreater>:
ucomisd %xmm1,%xmm0
setne  %al
ret

LLVM IR (-O0):
define zeroext i1 @QuietLessGreater(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 = fcmp one double %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @QuietLessGreater(double %0, double %1) {
%3 = fcmp one double %0, %1
ret i1 %3
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};
struct sockaddr {
  int sa_family;
};

/* Variables and functions */
#define AF_INET 128
char *inet_ntoa(int /*<<< orphan*/);
char *addr(struct sockaddr *sa) {
  switch (sa->sa_family) {
  case AF_INET:
    return inet_ntoa(((struct sockaddr_in *)sa)->sin_addr);
  default:
    return "unknown address family";
  }
}


x86 assembly (clang, -O0):
<addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sub    $0x80,%eax
jne    1146 <addr+0x36>
jmp    1132 <addr+0x22>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
jmp    1151 <addr+0x41>
lea    0xeb3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr>:
cmpl   $0x80,(%rdi)
jne    1122 <addr+0x12>
mov    $0x80,%edi
jmp    1030 <inet_ntoa@plt>
lea    0xed7(%rip),%rax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_in = type { i32 }
@.str = [23 x i8] c"unknown address family\00"
define i8* @addr(%struct.sockaddr* %0) {
%2 = alloca i8*
%3 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %3
%4 = load %struct.sockaddr*, %struct.sockaddr** %3
%5 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %4, i32 0, i32 0
%6 = load i32, i32* %5
switch i32 %6, label %13 [
i32 128, label %7
]
7: ; preds = %1
%8 = load %struct.sockaddr*, %struct.sockaddr** %3
%9 = bitcast %struct.sockaddr* %8 to %struct.sockaddr_in*
%10 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i8* @inet_ntoa(i32 %11)
store i8* %12, i8** %2
br label %14
13: ; preds = %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %2
br label %14
14: ; preds = %13, %7
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [23 x i8] c"unknown address family\00"
define i8* @addr(%struct.sockaddr* nocapture %0) {
%2 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 128
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i8* @inet_ntoa(i32 128)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Type definitions */
typedef scalar_t__ time_t;
struct tm {
  int tm_isdst;
};

/* Variables and functions */
struct tm *__dst_adjust(struct tm *);
int /*<<< orphan*/ __time_to_tm(scalar_t__ const, struct tm *);
scalar_t__ const __timezone;
int /*<<< orphan*/ __tzset();
struct tm *localtime_r(const time_t *t, struct tm *result) {
  __tzset();
  __time_to_tm(*t - __timezone, result);
  result->tm_isdst = -1;
  return __dst_adjust(result);
}


x86 assembly (clang, -O0):
<localtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <__tzset@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e93(%rip),%rax
sub    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <__time_to_tm@plt>
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
mov    -0x10(%rbp),%rdi
call   1040 <__dst_adjust@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localtime_r>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <__tzset@plt>
mov    (%r14),%rdi
mov    %rbx,%rsi
call   1050 <__time_to_tm@plt>
movl   $0xffffffff,(%rbx)
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__dst_adjust@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@__timezone = constant i64 0
define %struct.tm* @localtime_r(i64* %0, %struct.tm* %1) {
%3 = alloca i64*
%4 = alloca %struct.tm*
store i64* %0, i64** %3
store %struct.tm* %1, %struct.tm** %4
%5 = call i32 (...) @__tzset()
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = load i64, i64* @__timezone
%9 = sub nsw i64 %7, %8
%10 = load %struct.tm*, %struct.tm** %4
%11 = call i32 @__time_to_tm(i64 %9, %struct.tm* %10)
%12 = load %struct.tm*, %struct.tm** %4
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 0
store i32 -1, i32* %13
%14 = load %struct.tm*, %struct.tm** %4
%15 = call %struct.tm* @__dst_adjust(%struct.tm* %14)
ret %struct.tm* %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@__timezone = constant i64 0
define %struct.tm* @localtime_r(i64* nocapture %0, %struct.tm* %1) {
%3 = tail call i32 (...) @__tzset()
%4 = load i64, i64* %0
%5 = tail call i32 @__time_to_tm(i64 %4, %struct.tm* %1)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
store i32 -1, i32* %6
%7 = tail call %struct.tm* @__dst_adjust(%struct.tm* %1)
ret %struct.tm* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *resolve_environment_variables(char *, char *);
int main() {
  char *str;
  char buffer[1024];
  str = "this_file.sh $root/invlink/load/trading";
  printf("resolved: %s\n", resolve_environment_variables(buffer, str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <resolve_environment_variables@plt>
mov    %rax,%rsi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x408,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%rdi
call   1040 <resolve_environment_variables@plt>
lea    0xeeb(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"this_file.sh $root/invlink/load/trading\00"
@.str.1 = [14 x i8] c"resolved: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i8* @resolve_environment_variables(i8* %4, i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"this_file.sh $root/invlink/load/trading\00"
@.str.1 = [14 x i8] c"resolved: %s\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i8* @resolve_environment_variables(i8* %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct Cyc___cycFILE {
  int dummy;
};
struct Cyc_Interface_I {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Interface_print(struct Cyc_Interface_I *,
                                       struct Cyc___cycFILE *);
void Cyc_Interface_save(struct Cyc_Interface_I *i, struct Cyc___cycFILE *f) {
  ({ Cyc_Interface_print(i, f); });
}


x86 assembly (clang, -O0):
<Cyc_Interface_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_Interface_print@plt>
mov    %eax,-0x14(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Interface_save>:
jmp    1030 <Cyc_Interface_print@plt>

LLVM IR (-O0):
%struct.Cyc_Interface_I = type { i32 }
%struct.Cyc___cycFILE = type { i32 }
define void @Cyc_Interface_save(%struct.Cyc_Interface_I* %0, %struct.Cyc___cycFILE* %1) {
%3 = alloca %struct.Cyc_Interface_I*
%4 = alloca %struct.Cyc___cycFILE*
%5 = alloca i32
store %struct.Cyc_Interface_I* %0, %struct.Cyc_Interface_I** %3
store %struct.Cyc___cycFILE* %1, %struct.Cyc___cycFILE** %4
%6 = load %struct.Cyc_Interface_I*, %struct.Cyc_Interface_I** %3
%7 = load %struct.Cyc___cycFILE*, %struct.Cyc___cycFILE** %4
%8 = call i32 @Cyc_Interface_print(%struct.Cyc_Interface_I* %6, %struct.Cyc___cycFILE* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
%struct.Cyc_Interface_I = type { i32 }
%struct.Cyc___cycFILE = type { i32 }
define void @Cyc_Interface_save(%struct.Cyc_Interface_I* %0, %struct.Cyc___cycFILE* %1) {
%3 = tail call i32 @Cyc_Interface_print(%struct.Cyc_Interface_I* %0, %struct.Cyc___cycFILE* %1)
ret void
}
void ScaleRowDown2_NEON() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @curs_noraw() {
ret void
}
int toupper(int c) { return ((c >= 'a') && (c <= 'z')) ? (c - 'a' + 'A') : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     112c <toupper+0x2c>
cmpl   $0x7a,-0x4(%rbp)
jg     112c <toupper+0x2c>
mov    -0x4(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <toupper+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%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 */
scalar_t__ COND_LE();
int /*<<< orphan*/ EA_AY_DI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sle_8_di(void) {
  m68ki_write_8(EA_AY_DI_8(), COND_LE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sle_8_di>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_DI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_LE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sle_8_di>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_DI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_LE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sle_8_di() {
%1 = call i32 (...) @EA_AY_DI_8()
%2 = call i64 (...) @COND_LE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sle_8_di() {
%1 = tail call i32 (...) @EA_AY_DI_8()
%2 = tail call i64 (...) @COND_LE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
int c1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @c1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @c1() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int cli_callback(int event, void *arg1, void *arg2) {
  printf("receive event(%d)\n", event);
  return 0;
}


x86 assembly (clang, -O0):
<cli_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [19 x i8] c"receive event(%d)\0A\00"
define i32 @cli_callback(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"receive event(%d)\0A\00"
define i32 @cli_callback(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ allocator_default();
int /*<<< orphan*/ allocator_traced_init(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void _ensure_allocator_traced_init_copes_with_null_allocator(void) {
  allocator_traced_init(0, allocator_default(), stdout);
}


x86 assembly (clang, -O0):
<_ensure_allocator_traced_init_copes_with_null_allocator>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <allocator_default@plt>
mov    %eax,%esi
mov    0x2eac(%rip),%rax
mov    (%rax),%edx
xor    %edi,%edi
call   1040 <allocator_traced_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_allocator_traced_init_copes_with_null_allocator>:
push   %rax
xor    %eax,%eax
call   1030 <allocator_default@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%edx
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <allocator_traced_init@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @_ensure_allocator_traced_init_copes_with_null_allocator() {
%1 = call i32 (...) @allocator_default()
%2 = load i32, i32* @stdout
%3 = call i32 @allocator_traced_init(i32 0, i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @_ensure_allocator_traced_init_copes_with_null_allocator() {
%1 = tail call i32 (...) @allocator_default()
%2 = load i32, i32* @stdout
%3 = tail call i32 @allocator_traced_init(i32 0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
double __ocml_add_rtn_f64(double, double);
double __dadd_ru(double x, double y) { return __ocml_add_rtn_f64(x, y); }


x86 assembly (clang, -O0):
<__dadd_ru>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ocml_add_rtn_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dadd_ru>:
jmp    1030 <__ocml_add_rtn_f64@plt>

LLVM IR (-O0):
define double @__dadd_ru(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 @__ocml_add_rtn_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dadd_ru(double %0, double %1) {
%3 = tail call double @__ocml_add_rtn_f64(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ init_packet();
int /*<<< orphan*/ open_link();
void init_ethmac() {
  init_packet();
  while (!open_link())
    ;
}


x86 assembly (clang, -O0):
<init_ethmac>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <init_packet@plt>
mov    $0x0,%al
call   1040 <open_link@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1147 <init_ethmac+0x27>
jmp    114c <init_ethmac+0x2c>
jmp    112b <init_ethmac+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_ethmac>:
push   %rax
xor    %eax,%eax
call   1030 <init_packet@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <open_link@plt>
test   %eax,%eax
je     1130 <init_ethmac+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @init_ethmac() {
%1 = call i32 (...) @init_packet()
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @open_link()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @init_ethmac() {
%1 = tail call i32 (...) @init_packet()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @open_link()
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
int main() {
  int a[] = {1, 2, 3};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeec(%rip),%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = bitcast [3 x i32]* %2 to i8*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
const char *type_name(long t) {
  if (t)
    return "LONG";
  else
    return "long";
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1123 <type_name+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <type_name+0x2e>
lea    0xedb(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
test   %rdi,%rdi
lea    0xefb(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"LONG\00"
@.str.1 = [5 x i8] c"long\00"
define i8* @type_name(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"LONG\00"
@.str.1 = [5 x i8] c"long\00"
define i8* @type_name(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double get_time() {
  struct timeval t;
  struct timezone tzp;
  gettimeofday(&t, &tzp);
  return t.tv_sec + (t.tv_usec * 1e-6);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
%struct.timezone = type { i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
%struct.timezone = type { i32 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sitofp i32 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0x3EB0C6F7A0B5ED8D, double %7)
ret double %11
}
/* Type definitions */
typedef scalar_t__ __v16qi;
typedef scalar_t__ __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_cmpgt_epi8(__m128i a, __m128i b) {
  return (__m128i)((__v16qi)a > (__v16qi)b);
}


x86 assembly (clang, -O0):
<_mm_cmpgt_epi8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mm_cmpgt_epi8>:
xor    %eax,%eax
cmp    %rsi,%rdi
setg   %al
ret

LLVM IR (-O0):
define i64 @_mm_cmpgt_epi8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @_mm_cmpgt_epi8(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = zext i1 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ WCHAR_MIN;
int main() {
  (void)WCHAR_MIN;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@WCHAR_MIN = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @WCHAR_MIN
ret i32 0
}

LLVM IR (-O2):
@WCHAR_MIN = global i32 0
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int expansion_permutation(int /*<<< orphan*/);
int /*<<< orphan*/ permutation(int /*<<< orphan*/);
int /*<<< orphan*/ s_boxes(int);
uint32_t _ld_feistel(uint32_t right, uint64_t round_key) {
  uint64_t expanded_right = 0;
  uint64_t e_xor_k = 0;
  uint8_t i;
  expanded_right = expansion_permutation(right);
  e_xor_k = expanded_right ^ round_key;
  return permutation(s_boxes(e_xor_k));
}


x86 assembly (clang, -O0):
<_ld_feistel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <expansion_permutation@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <s_boxes@plt>
mov    %eax,%edi
call   1050 <permutation@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ld_feistel>:
push   %rbx
mov    %esi,%ebx
call   1030 <expansion_permutation@plt>
xor    %eax,%ebx
mov    %ebx,%edi
call   1040 <s_boxes@plt>
mov    %eax,%edi
pop    %rbx
jmp    1050 <permutation@plt>

LLVM IR (-O0):
define i32 @_ld_feistel(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 0, i32* %5
store i32 0, i32* %6
%8 = load i32, i32* %3
%9 = call i32 @expansion_permutation(i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @s_boxes(i32 %13)
%15 = call i32 @permutation(i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @_ld_feistel(i32 %0, i32 %1) {
%3 = tail call i32 @expansion_permutation(i32 %0)
%4 = xor i32 %3, %1
%5 = tail call i32 @s_boxes(i32 %4)
%6 = tail call i32 @permutation(i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void clear_bitmap(unsigned char **pixels, int w, int h) {
  int y;
  for (y = 0; y < h; y++)
    memset(pixels[y], 0, w);
}


x86 assembly (clang, -O0):
<clear_bitmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1159 <clear_bitmap+0x49>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <clear_bitmap+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bitmap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1147 <clear_bitmap+0x37>
mov    %esi,%r14d
mov    %rdi,%r15
mov    %edx,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbx,8),%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1030 <memset@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <clear_bitmap+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @clear_bitmap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @memset(i8* %10, i32 0, i32 %1)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
void cpu_stop(void) {
  for (;;)
    asm volatile("cli; hlt;" : : : "memory");
}


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

x86 assembly (clang, -O2):
<cpu_stop>:
cli
hlt
jmp    1100 <cpu_stop>

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

LLVM IR (-O2):
define void @cpu_stop() {
br label %1
1: ; preds = %1, %0
tail call void asm sideeffect "cli; hlt;", "~{memory},~{dirflag},~{fpsr},~{flags}"()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ saa7114_write_reg(int, unsigned char);
int saa7114_set_decoder_brightness(unsigned char brightness) {
  saa7114_write_reg(0x0A, brightness);
  return (0);
}


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

x86 assembly (clang, -O2):
<saa7114_set_decoder_brightness>:
push   %rax
mov    %edi,%esi
mov    $0xa,%edi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @saa7114_set_decoder_brightness(i8 zeroext %0) {
%2 = tail call i32 @saa7114_write_reg(i32 10, i8 zeroext %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TakeOffLocationHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void TakeOffLocationRequestUpdate() {
  UAVObjRequestUpdate(TakeOffLocationHandle());
}


x86 assembly (clang, -O0):
<TakeOffLocationRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <TakeOffLocationHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeOffLocationRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <TakeOffLocationHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @TakeOffLocationRequestUpdate() {
%1 = call i32 (...) @TakeOffLocationHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TakeOffLocationRequestUpdate() {
%1 = tail call i32 (...) @TakeOffLocationHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
dlopen() {}


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

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

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

LLVM IR (-O2):
define i32 @dlopen() {
ret i32 undef
}
int ltrim(float x) { return (x >= 1.0f) - (x < 0.0f); }


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
seta   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
xorps  %xmm1,%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ltrim(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 1.000000e+00
%5 = zext i1 %4 to i32
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
%8 = zext i1 %7 to i32
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @ltrim(float %0) {
%2 = fcmp oge float %0, 1.000000e+00
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, 0.000000e+00
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fdiv_preg64_dword(int reg64) {
  put8(0xD8);
  put8(0x30 + reg64);
}


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

x86 assembly (clang, -O2):
<fdiv_preg64_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd8,%edi
call   1030 <put8@plt>
add    $0x30,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fdiv_preg64_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 216)
%4 = load i32, i32* %2
%5 = add nsw i32 48, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @fdiv_preg64_dword(i32 %0) {
%2 = tail call i32 @put8(i32 216)
%3 = add nsw i32 %0, 48
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};
struct dns_rr_txt {
  int dummy;
};
struct dns_ctx {
  int dummy;
};

/* Variables and functions */
scalar_t__ dns_resolve(struct dns_ctx *, int /*<<< orphan*/);
int /*<<< orphan*/ dns_submit_a4dnsbl_txt(struct dns_ctx *,
                                          struct in_addr const *, char const *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
struct dns_rr_txt *dns_resolve_a4dnsbl_txt(struct dns_ctx *ctx,
                                           const struct in_addr *addr,
                                           const char *dnsbl) {
  return (struct dns_rr_txt *)dns_resolve(
      ctx, dns_submit_a4dnsbl_txt(ctx, addr, dnsbl, 0, 0));
}


x86 assembly (clang, -O0):
<dns_resolve_a4dnsbl_txt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <dns_submit_a4dnsbl_txt@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <dns_resolve@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_resolve_a4dnsbl_txt>:
push   %rbx
mov    %rdi,%rbx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1030 <dns_submit_a4dnsbl_txt@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <dns_resolve@plt>

LLVM IR (-O0):
%struct.dns_rr_txt = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in_addr = type { i32 }
define %struct.dns_rr_txt* @dns_resolve_a4dnsbl_txt(%struct.dns_ctx* %0, %struct.in_addr* %1, i8* %2) {
%4 = alloca %struct.dns_ctx*
%5 = alloca %struct.in_addr*
%6 = alloca i8*
store %struct.dns_ctx* %0, %struct.dns_ctx** %4
store %struct.in_addr* %1, %struct.in_addr** %5
store i8* %2, i8** %6
%7 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%8 = load %struct.dns_ctx*, %struct.dns_ctx** %4
%9 = load %struct.in_addr*, %struct.in_addr** %5
%10 = load i8*, i8** %6
%11 = call i32 @dns_submit_a4dnsbl_txt(%struct.dns_ctx* %8, %struct.in_addr* %9, i8* %10, i32 0, i32 0)
%12 = call i64 @dns_resolve(%struct.dns_ctx* %7, i32 %11)
%13 = inttoptr i64 %12 to %struct.dns_rr_txt*
ret %struct.dns_rr_txt* %13
}

LLVM IR (-O2):
%struct.dns_rr_txt = type { i32 }
%struct.dns_ctx = type { i32 }
%struct.in_addr = type { i32 }
define %struct.dns_rr_txt* @dns_resolve_a4dnsbl_txt(%struct.dns_ctx* %0, %struct.in_addr* %1, i8* %2) {
%4 = tail call i32 @dns_submit_a4dnsbl_txt(%struct.dns_ctx* %0, %struct.in_addr* %1, i8* %2, i32 0, i32 0)
%5 = tail call i64 @dns_resolve(%struct.dns_ctx* %0, i32 %4)
%6 = inttoptr i64 %5 to %struct.dns_rr_txt*
ret %struct.dns_rr_txt* %6
}
int doublecomp(const void *elem1, const void *elem2) {
  if (*(const double *)elem1 < *(const double *)elem2)
    return -1;
  return *(const double *)elem1 > *(const double *)elem2;
}


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

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

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

LLVM IR (-O2):
define i32 @doublecomp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_writable_size() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_writable_size"
         "\n");
}


x86 assembly (clang, -O0):
<pa_stream_writable_size>:
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_stream_writable_size>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

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


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

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

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

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