xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ save_move(unsigned char const *);
void save_k_castle(void) { save_move((const unsigned char *)"O-O"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"O-O\00"
define void @save_k_castle() {
%1 = call i32 @save_move(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"O-O\00"
define void @save_k_castle() {
%1 = tail call i32 @save_move(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_set_sleep_low() {
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (0xF << 9) | (0 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(
      0x6, 0x17, ((3 << 14) | (0 << 13) | (0xF << 9) | (0 << 5) | (1)));
  delay(100);
  mbus_remote_register_write(0x6, 0x15,
                             ((0 << 19) | (0 << 18) | (0 << 17) | (3 << 14) |
                              (0 << 13) | (0xF << 9) | (0 << 5) | (1)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_set_sleep_low>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xde01,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xde01,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xde01,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_set_sleep_low>:
push   %rax
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xde01,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x17,%esi
mov    $0xde01,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x6,%edi
mov    $0x15,%esi
mov    $0xde01,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_set_sleep_low() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 56833)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 6, i32 23, i32 56833)
%4 = call i32 @delay(i32 100)
%5 = call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56833)
%6 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_set_sleep_low() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 56833)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 6, i32 23, i32 56833)
%4 = tail call i32 @delay(i32 100)
%5 = tail call i32 @mbus_remote_register_write(i32 6, i32 21, i32 56833)
%6 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void HandleTagEnd(void *cookie, const char *szString) {
  printf("tagEndHandler: '%s'\n", szString);
}


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

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

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

LLVM IR (-O2):
@.str = [21 x i8] c"tagEndHandler: '%s'\0A\00"
define void @HandleTagEnd(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
void *obs_service_get_weak_service(void *);
void *weak_service_ref(void *ref) { return obs_service_get_weak_service(ref); }


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

x86 assembly (clang, -O2):
<weak_service_ref>:
jmp    1030 <obs_service_get_weak_service@plt>

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

LLVM IR (-O2):
define i8* @weak_service_ref(i8* %0) {
%2 = tail call i8* @obs_service_get_weak_service(i8* %0)
ret i8* %2
}
void gtk_tree_view_column_get_title() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_title() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t MULx_0x1b(uint8_t v) {
  uint8_t r;
  r = v << 1;
  if (v & 0x80) {
    r ^= 0x1b;
  }
  return r;
}


x86 assembly (clang, -O0):
<MULx_0x1b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112a <MULx_0x1b+0x2a>
mov    -0x8(%rbp),%eax
xor    $0x1b,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MULx_0x1b>:
lea    (%rdi,%rdi,1),%ecx
mov    %ecx,%eax
xor    $0x1b,%eax
test   $0x80,%dil
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @MULx_0x1b(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %0, 128
%4 = icmp eq i32 %3, 0
%5 = xor i32 %2, 27
%6 = select i1 %4, i32 %2, i32 %5
ret i32 %6
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long red_mult;
};
typedef TYPE_1__ XStandardColormap;

/* Variables and functions */
void set_XStandardColormap_red_mult(void *_p, unsigned long _v) {
  ((XStandardColormap *)_p)->red_mult = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XStandardColormap_red_mult>:
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_XStandardColormap_red_mult>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XStandardColormap_red_mult(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_XStandardColormap_red_mult(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
__attribute__((gnu_)) double carmen_radians_to_degrees(double theta) {
  return (theta * 180.0 / 3.14159265358979323846);
}


x86 assembly (clang, -O0):
<carmen_radians_to_degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carmen_radians_to_degrees>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @carmen_radians_to_degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB54442D18
ret double %5
}

LLVM IR (-O2):
define double @carmen_radians_to_degrees(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB54442D18
ret double %3
}
int increment(int codigo) { return (codigo + 1); }


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

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

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

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int get_property_int32(void *, char *);
char *get_property_string(void *, char *);
int /*<<< orphan*/ memory_region_init_ram(void *, int /*<<< orphan*/ *, char *,
                                          int, int /*<<< orphan*/ *);
void generic_ram_inst(void *dev, void *opaque) {
  char *name;
  int size;
  void *ram_dev = opaque;
  size = get_property_int32(dev, "/device_size");
  name = get_property_string(dev, "name");
  memory_region_init_ram(ram_dev, NULL, name, size, NULL);
}


x86 assembly (clang, -O0):
<generic_ram_inst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <get_property_int32@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <get_property_string@plt>
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
call   1050 <memory_region_init_ram@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_ram_inst>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
call   1040 <get_property_int32@plt>
mov    %eax,%ebp
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1030 <get_property_string@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rax,%rdx
mov    %ebp,%ecx
xor    %r8d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <memory_region_init_ram@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/device_size\00"
@.str.1 = [5 x i8] c"name\00"
define void @generic_ram_inst(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8*, i8** %3
%10 = call i32 @get_property_int32(i8* %9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = call i8* @get_property_string(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %12, i8** %5
%13 = load i8*, i8** %7
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i32 @memory_region_init_ram(i8* %13, i32* null, i8* %14, i32 %15, i32* null)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/device_size\00"
@.str.1 = [5 x i8] c"name\00"
define void @generic_ram_inst(i8* %0, i8* %1) {
%3 = tail call i32 @get_property_int32(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @get_property_string(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @memory_region_init_ram(i8* %1, i32* null, i8* %4, i32 %3, i32* null)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ display;
};
struct TYPE_4__ {
  TYPE_1__ xvisibility;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void *get_XEvent_xvisibility_display(void *_p) {
  return (void *)((XEvent *)_p)->xvisibility.display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XEvent_xvisibility_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
void assign(unsigned char dest[], unsigned char source[]) {
  dest[0] = source[0];
  dest[1] = source[1];
  dest[2] = source[2];
  dest[3] = source[3];
}


x86 assembly (clang, -O0):
<assign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assign>:
mov    (%rsi),%al
mov    %al,(%rdi)
mov    0x1(%rsi),%al
mov    %al,0x1(%rdi)
mov    0x2(%rsi),%al
mov    %al,0x2(%rdi)
mov    0x3(%rsi),%al
mov    %al,0x3(%rdi)
ret

LLVM IR (-O0):
define void @assign(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 %12, i8* %14
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 2
store i8 %17, i8* %19
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 3
store i8 %22, i8* %24
ret void
}

LLVM IR (-O2):
define void @assign(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = getelementptr inbounds i8, i8* %1, i64 1
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = getelementptr inbounds i8, i8* %1, i64 2
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %1, i64 3
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int gotodiff(int x, int y) {
  int result;
  if (x >= y)
    goto x_ge_y;
  result = y - x;
  goto done;
x_ge_y:
  result = x - y;
done:
  return result;
}


x86 assembly (clang, -O0):
<gotodiff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     111b <gotodiff+0x1b>
jmp    1129 <gotodiff+0x29>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1132 <gotodiff+0x32>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotodiff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovge %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gotodiff(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = sub nsw i32 %0, %1
%5 = sub nsw i32 %1, %0
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
/* Variables and functions */
int mbrlen(char const *, size_t, int /*<<< orphan*/ *);
int mblen(const char *s, size_t n) { return mbrlen(s, n, NULL); }


x86 assembly (clang, -O0):
<mblen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <mbrlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mblen>:
xor    %edx,%edx
jmp    1030 <mbrlen@plt>

LLVM IR (-O0):
define i32 @mblen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @mbrlen(i8* %5, i64 %6, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mblen(i8* %0, i64 %1) {
%3 = tail call i32 @mbrlen(i8* %0, i64 %1, i32* null)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
void main() {
  char a;
  printf("Enter an Alphabet: ");
  scanf("%c ", &a);
  if (a == 'b') {
    printf("%c ", a);
  } else {
    printf("error");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x62,%eax
jne    116a <main+0x4a>
movsbl -0x1(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1178 <main+0x58>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
cmpb   $0x62,0x7(%rsp)
jne    115c <main+0x3c>
lea    0xec6(%rip),%rdi
mov    $0x62,%esi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Enter an Alphabet: \00"
@.str.1 = [4 x i8] c"%c \00"
@.str.2 = [6 x i8] c"error\00"
define void @main() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 98
br i1 %6, label %7, label %11
7: ; preds = %0
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Enter an Alphabet: \00"
@.str.1 = [4 x i8] c"%c \00"
@.str.2 = [6 x i8] c"error\00"
define void @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 98
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 98)
br label %10
8: ; preds = %0
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}
void serial_purge() { return; }


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

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

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

LLVM IR (-O2):
define void @serial_purge() {
ret void
}
double pathcon_nm6_twice(double x) { return x + x; }


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

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

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

LLVM IR (-O2):
define double @pathcon_nm6_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ mcp2515_spi_select();
int /*<<< orphan*/ mcp2515_spi_transfer(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ mcp2515_spi_unselect();
void mcp2515_reset(void) {
  mcp2515_spi_select();
  mcp2515_spi_transfer(0xC0, NULL);
  mcp2515_spi_unselect();
}


x86 assembly (clang, -O0):
<mcp2515_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mcp2515_spi_select@plt>
mov    $0xc0,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <mcp2515_spi_transfer@plt>
mov    $0x0,%al
call   1050 <mcp2515_spi_unselect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcp2515_reset>:
push   %rax
xor    %eax,%eax
call   1030 <mcp2515_spi_select@plt>
mov    $0xc0,%edi
xor    %esi,%esi
call   1040 <mcp2515_spi_transfer@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <mcp2515_spi_unselect@plt>

LLVM IR (-O0):
define void @mcp2515_reset() {
%1 = call i32 (...) @mcp2515_spi_select()
%2 = call i32 @mcp2515_spi_transfer(i32 192, i32* null)
%3 = call i32 (...) @mcp2515_spi_unselect()
ret void
}

LLVM IR (-O2):
define void @mcp2515_reset() {
%1 = tail call i32 (...) @mcp2515_spi_select()
%2 = tail call i32 @mcp2515_spi_transfer(i32 192, i32* null)
%3 = tail call i32 (...) @mcp2515_spi_unselect()
ret void
}
int libhalloc_unlock() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @libhalloc_unlock() {
ret i32 0
}
void uncomm(char *s) {
  if (!s)
    return;
  while (*s) {
    if (*s == '\r' || *s == '\n' || *s == '#') {
      *s = 0;
      break;
    }
    s++;
  }
}


x86 assembly (clang, -O0):
<uncomm>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1118 <uncomm+0x18>
jmp    1177 <uncomm+0x77>
jmp    111d <uncomm+0x1d>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1177 <uncomm+0x77>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     115a <uncomm+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     115a <uncomm+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1166 <uncomm+0x66>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
jmp    1177 <uncomm+0x77>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111d <uncomm+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncomm>:
test   %rdi,%rdi
je     1129 <uncomm+0x29>
lea    0xef4(%rip),%rax
jmp    1114 <uncomm+0x14>
xchg   %ax,%ax
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0x23,%rcx
ja     1110 <uncomm+0x10>
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @uncomm(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %31
6: ; preds = %1
br label %7
7: ; preds = %28, %6
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %31
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 13
br i1 %15, label %26, label %16
16: ; preds = %11
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 10
br i1 %20, label %26, label %21
21: ; preds = %16
%22 = load i8*, i8** %2
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 35
br i1 %25, label %26, label %28
26: ; preds = %21, %16, %11
%27 = load i8*, i8** %2
store i8 0, i8* %27
br label %31
28: ; preds = %21
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %2
br label %7
31: ; preds = %5, %26, %7
ret void
}

LLVM IR (-O2):
define void @uncomm(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %7
%4 = phi i8* [ %8, %7 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %7 [
i8 0, label %9
i8 13, label %6
i8 10, label %6
i8 35, label %6
]
6: ; preds = %3, %3, %3
store i8 0, i8* %4
br label %9
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
9: ; preds = %3, %1, %6
ret void
}
/* Variables and functions */
scalar_t__ execvp(char *, char **);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *env[]) {
  if (execvp("./lab2", argv) < 0) {
    printf("Ошибка, не удалось запустить 2 лабу.\n");
  }
  exit(-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
call   1040 <execvp@plt>
cmp    $0x0,%rax
jge    1170 <main+0x40>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <execvp@plt>
test   %rax,%rax
jns    114e <main+0x1e>
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"./lab2\00"
@.str.1 = [66 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0, \D0\BD\D0\B5 \D1\83\D0\B4\D0\B0\D0\BB\D0\BE\D1\81\D1\8C \D0\B7\D0\B0\D0\BF\D1\83\D1\81\D1\82\D0\B8\D1\82\D1\8C 2 \D0\BB\D0\B0\D0\B1\D1\83.\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i8**, i8*** %6
%9 = call i64 @execvp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %3
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"./lab2\00"
@str = [65 x i8] c"\D0\9E\D1\88\D0\B8\D0\B1\D0\BA\D0\B0, \D0\BD\D0\B5 \D1\83\D0\B4\D0\B0\D0\BB\D0\BE\D1\81\D1\8C \D0\B7\D0\B0\D0\BF\D1\83\D1\81\D1\82\D0\B8\D1\82\D1\8C 2 \D0\BB\D0\B0\D0\B1\D1\83.\00"
define i32 @main(i32 %0, i8** %1, i8** nocapture readnone %2) {
%4 = tail call i64 @execvp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @exit(i32 -1)
unreachable
}
int smsdvb_debugfs_register(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smsdvb_debugfs_register() {
ret i32 0
}
/* Variables and functions */
int *malloc(int);
int *geta1() {
  int *p = malloc(sizeof(int));
  return p;
}


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

x86 assembly (clang, -O2):
<geta1>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i32* @geta1() {
%1 = tail call i32* @malloc(i32 4)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void child_signal(int unused) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<child_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<child_signal>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @child_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @child_signal(i32 %0) {
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int ext3_subtree_read(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @ext3_subtree_read(%struct.inode* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void nofork() {
  printf("Fork failed.  Not enough memory.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<nofork>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nofork>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Fork failed. Not enough memory.\0A\00"
define void @nofork() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"Fork failed. Not enough memory.\00"
define void @nofork() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void __cpuid(int info[4], int infoType) {
  __asm__ __volatile__("cpuid"
                       : "=a"(info[0]), "=b"(info[1]), "=c"(info[2]),
                         "=d"(info[3])
                       : "0"(infoType));
}


x86 assembly (clang, -O0):
<__cpuid>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%r8
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
cpuid
mov    %eax,%r9d
mov    -0x28(%rbp),%rax
mov    %ecx,%esi
mov    -0x20(%rbp),%rcx
mov    %r9d,(%r8)
mov    %ebx,0x4(%rdi)
mov    %esi,0x8(%rcx)
mov    %edx,0xc(%rax)
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cpuid>:
push   %rbx
mov    %esi,%eax
cpuid
mov    %eax,(%rdi)
mov    %ebx,0x4(%rdi)
mov    %ecx,0x8(%rdi)
mov    %edx,0xc(%rdi)
pop    %rbx
ret

LLVM IR (-O0):
define void @__cpuid(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 3
%13 = load i32, i32* %4
%14 = call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %13)
%15 = extractvalue { i32, i32, i32, i32 } %14, 0
%16 = extractvalue { i32, i32, i32, i32 } %14, 1
%17 = extractvalue { i32, i32, i32, i32 } %14, 2
%18 = extractvalue { i32, i32, i32, i32 } %14, 3
store i32 %15, i32* %6
store i32 %16, i32* %8
store i32 %17, i32* %10
store i32 %18, i32* %12
ret void
}

LLVM IR (-O2):
define void @__cpuid(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = getelementptr inbounds i32, i32* %0, i64 3
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "cpuid", "={ax},={bx},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %1)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %0
store i32 %8, i32* %3
store i32 %9, i32* %4
store i32 %10, i32* %5
ret void
}
void defaultISR(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @defaultISR() {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_ABuint16_reg(unsigned short val) {
  return ((val) & (0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xab,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_ABuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 171
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
OP(dd, d7) { op_d7(); }


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @op_d7()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d7()
ret i32 undef
}
int test10(int x) { return x / 10 > 0; }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
xor    %eax,%eax
cmp    $0xa,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @test10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test10(i32 %0) {
%2 = icmp sgt i32 %0, 9
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_random() {
  printf("NOT IMPLEMENTED:"
         "pa_random"
         "\n");
}


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

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

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


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

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

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

LLVM IR (-O2):
define void @genc_ngl_s() {
ret void
}
double gdtrc(a, b, x)
double a, b, x;
{
  if (x < 0.0) {
    mtherr("gdtrc", 1);
    return (0.0);
  }
  return (igamc(b, a * x));
}


x86 assembly (clang, -O0):
<gdtrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1165 <gdtrc+0x45>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <mtherr@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <gdtrc+0x64>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mov    $0x2,%al
call   1030 <igamc@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdtrc>:
push   %rax
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
jbe    1148 <gdtrc+0x28>
lea    0xeca(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <mtherr@plt>
xorpd  %xmm0,%xmm0
pop    %rax
ret
mulsd  %xmm2,%xmm3
movaps %xmm1,%xmm0
movapd %xmm3,%xmm1
mov    $0x2,%al
call   1030 <igamc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"gdtrc\00"
define double @gdtrc(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %7
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
store double 0.000000e+00, double* %4
br label %19
12: ; preds = %3
%13 = load double, double* %6
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = call i32 (double, double, ...) bitcast (i32 (...)* @igamc to i32 (double, double, ...)*)(double %13, double %16)
%18 = sitofp i32 %17 to double
store double %18, double* %4
br label %19
19: ; preds = %12, %10
%20 = load double, double* %4
ret double %20
}

LLVM IR (-O2):
@.str = [6 x i8] c"gdtrc\00"
define double @gdtrc(double %0, double %1, double %2) {
%4 = fcmp olt double %2, 0.000000e+00
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @mtherr to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1)
br label %11
7: ; preds = %3
%8 = fmul double %0, %2
%9 = tail call i32 (double, double, ...) bitcast (i32 (...)* @igamc to i32 (double, double, ...)*)(double %1, double %8)
%10 = sitofp i32 %9 to double
br label %11
11: ; preds = %7, %5
%12 = phi double [ 0.000000e+00, %5 ], [ %10, %7 ]
ret double %12
}
/* Variables and functions */
int io_in8(int);
void IDE_nobusy(void) {
  for (;;) {
    if ((io_in8(0x1f7) & (8 | 128)) == 8) {
      return;
    }
  }
}


x86 assembly (clang, -O0):
<IDE_nobusy>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <IDE_nobusy+0x9>
mov    $0x1f7,%edi
call   1030 <io_in8@plt>
and    $0x88,%eax
cmp    $0x8,%eax
jne    1133 <IDE_nobusy+0x23>
pop    %rbp
ret
jmp    1119 <IDE_nobusy+0x9>

x86 assembly (clang, -O2):
<IDE_nobusy>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1f7,%edi
call   1030 <io_in8@plt>
and    $0x88,%eax
cmp    $0x8,%eax
jne    1120 <IDE_nobusy+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @IDE_nobusy() {
br label %1
1: ; preds = %6, %0
%2 = call i32 @io_in8(i32 503)
%3 = and i32 %2, 136
%4 = icmp eq i32 %3, 8
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
br label %1
}

LLVM IR (-O2):
define void @IDE_nobusy() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @io_in8(i32 503)
%3 = and i32 %2, 136
%4 = icmp eq i32 %3, 8
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
float clamp(float value) {
  if (value < 0)
    return 0;
  if (value > 1)
    return 1;
  return value;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1123 <clamp+0x23>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <clamp+0x55>
movss  -0x8(%rbp),%xmm0
movss  0xed0(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114b <clamp+0x4b>
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1155 <clamp+0x55>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @clamp(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void stack_down() {
  int x = 2;
  printf("Address of local variable is %p\n", &x);
  printf("stack grows down \n");
}


x86 assembly (clang, -O0):
<stack_down>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_down>:
push   %rax
movl   $0x2,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Address of local variable is %p\0A\00"
@.str.1 = [19 x i8] c"stack grows down \0A\00"
define void @stack_down() {
%1 = alloca i32
store i32 2, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Address of local variable is %p\0A\00"
@str = [18 x i8] c"stack grows down \00"
define void @stack_down() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ebmb_node {
  int dummy;
};
struct eb_root {
  int dummy;
};

/* Variables and functions */
struct ebmb_node *__ebmb_lookup_longest(struct eb_root *, void const *);
struct ebmb_node *ebmb_lookup_longest(struct eb_root *root, const void *x) {
  return __ebmb_lookup_longest(root, x);
}


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

x86 assembly (clang, -O2):
<ebmb_lookup_longest>:
jmp    1030 <__ebmb_lookup_longest@plt>

LLVM IR (-O0):
%struct.ebmb_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebmb_node* @ebmb_lookup_longest(%struct.eb_root* %0, i8* %1) {
%3 = alloca %struct.eb_root*
%4 = alloca i8*
store %struct.eb_root* %0, %struct.eb_root** %3
store i8* %1, i8** %4
%5 = load %struct.eb_root*, %struct.eb_root** %3
%6 = load i8*, i8** %4
%7 = call %struct.ebmb_node* @__ebmb_lookup_longest(%struct.eb_root* %5, i8* %6)
ret %struct.ebmb_node* %7
}

LLVM IR (-O2):
%struct.ebmb_node = type { i32 }
%struct.eb_root = type { i32 }
define %struct.ebmb_node* @ebmb_lookup_longest(%struct.eb_root* %0, i8* %1) {
%3 = tail call %struct.ebmb_node* @__ebmb_lookup_longest(%struct.eb_root* %0, i8* %1)
ret %struct.ebmb_node* %3
}
/* Variables and functions */
int ENOSYS;
int proc_modify_policy_max(unsigned int cpu, unsigned long max_freq) {
  return -ENOSYS;
}


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

x86 assembly (clang, -O2):
<proc_modify_policy_max>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @proc_modify_policy_max(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* @ENOSYS
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @proc_modify_policy_max(i32 %0, i64 %1) {
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ x;
};
struct TYPE_4__ {
  TYPE_1__ max_ink_extent;
};
typedef TYPE_2__ XFontSetExtents;

/* Variables and functions */
short get_XFontSetExtents_max_ink_extent_x(void *_p) {
  return (short)((XFontSetExtents *)_p)->max_ink_extent.x;
}


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

x86 assembly (clang, -O2):
<get_XFontSetExtents_max_ink_extent_x>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define signext i16 @get_XFontSetExtents_max_ink_extent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define signext i16 @get_XFontSetExtents_max_ink_extent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret i16 %4
}