xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_, const)) uint8_t BE32ToBE8(uint32_t be32) {
  return be32 >> 24;
}


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

x86 assembly (clang, -O2):
<BE32ToBE8>:
mov    %edi,%eax
sar    $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @BE32ToBE8(i32 %0) {
%2 = ashr i32 %0, 24
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abs(int);
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(int /*<<< orphan*/);
int intlen(int i) { return (i ? floor(log10(abs(i))) + 1 : 1); }


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1166 <intlen+0x36>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%edi
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <intlen+0x43>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1173 <intlen+0x43>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
test   %edi,%edi
je     1142 <intlen+0x22>
push   %rax
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %eax,%edi
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @intlen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @abs(i32 %6)
%8 = call i32 @log10(i32 %7)
%9 = call i32 @floor(i32 %8)
%10 = add nsw i32 %9, 1
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi i32 [ %10, %5 ], [ 1, %11 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @intlen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%5 = tail call i32 @log10(i32 %4)
%6 = tail call i32 @floor(i32 %5)
%7 = add nsw i32 %6, 1
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void seller_usr1() { printf("please get off the bus!\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"please get off the bus!\0A\00"
define void @seller_usr1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"please get off the bus!\00"
define void @seller_usr1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
void assert2(void) { ((void)0); }


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

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

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

LLVM IR (-O2):
define void @assert2() {
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t Function10Int64(int64_t a, int64_t b, int64_t c, int64_t d, int64_t e,
                        int64_t f, int64_t g, int64_t h, int64_t i, int64_t j) {
  return a + b + c + d + e + f + g + h + i + j;
}


x86 assembly (clang, -O0):
<Function10Int64>:
push   %rbp
mov    %rsp,%rbp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
add    0x10(%rbp),%rax
add    0x18(%rbp),%rax
add    0x20(%rbp),%rax
add    0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function10Int64>:
lea    (%rdi,%rsi,1),%rax
add    %rdx,%rax
add    %rcx,%rax
add    %r8,%rax
add    %r9,%rax
add    0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    0x18(%rsp),%rax
add    0x20(%rsp),%rax
ret

LLVM IR (-O0):
define i64 @Function10Int64(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
store i64 %0, i64* %11
store i64 %1, i64* %12
store i64 %2, i64* %13
store i64 %3, i64* %14
store i64 %4, i64* %15
store i64 %5, i64* %16
store i64 %6, i64* %17
store i64 %7, i64* %18
store i64 %8, i64* %19
store i64 %9, i64* %20
%21 = load i64, i64* %11
%22 = load i64, i64* %12
%23 = add nsw i64 %21, %22
%24 = load i64, i64* %13
%25 = add nsw i64 %23, %24
%26 = load i64, i64* %14
%27 = add nsw i64 %25, %26
%28 = load i64, i64* %15
%29 = add nsw i64 %27, %28
%30 = load i64, i64* %16
%31 = add nsw i64 %29, %30
%32 = load i64, i64* %17
%33 = add nsw i64 %31, %32
%34 = load i64, i64* %18
%35 = add nsw i64 %33, %34
%36 = load i64, i64* %19
%37 = add nsw i64 %35, %36
%38 = load i64, i64* %20
%39 = add nsw i64 %37, %38
ret i64 %39
}

LLVM IR (-O2):
define i64 @Function10Int64(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7, i64 %8, i64 %9) {
%11 = add nsw i64 %1, %0
%12 = add nsw i64 %11, %2
%13 = add nsw i64 %12, %3
%14 = add nsw i64 %13, %4
%15 = add nsw i64 %14, %5
%16 = add nsw i64 %15, %6
%17 = add nsw i64 %16, %7
%18 = add nsw i64 %17, %8
%19 = add nsw i64 %18, %9
ret i64 %19
}
/* Type definitions */
struct timeval {
  int dummy;
};
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_gettime(int /*<<< orphan*/, struct timespec *);
int /*<<< orphan*/ timespec_to_timeval(struct timespec *, struct timeval *);
int _gettimeofday(struct timeval *tp, void *tzp) {
  int ret;
  struct timespec ts;
  (void)tzp;
  ret = clock_gettime(CLOCK_REALTIME, &ts);
  timespec_to_timeval(&ts, tp);
  (void)ret;
  return 0;
}


x86 assembly (clang, -O0):
<_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <clock_gettime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x18(%rbp),%rdi
call   1040 <timespec_to_timeval@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gettimeofday>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%r14
mov    %r14,%rsi
call   1030 <clock_gettime@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <timespec_to_timeval@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @_gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.timespec
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i32, i32* @CLOCK_REALTIME
%9 = call i32 @clock_gettime(i32 %8, %struct.timespec* %6)
store i32 %9, i32* %5
%10 = load %struct.timeval*, %struct.timeval** %3
%11 = call i32 @timespec_to_timeval(%struct.timespec* %6, %struct.timeval* %10)
%12 = load i32, i32* %5
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @_gettimeofday(%struct.timeval* %0, i8* nocapture readnone %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to i8*
%5 = load i32, i32* @CLOCK_REALTIME
%6 = call i32 @clock_gettime(i32 %5, %struct.timespec* %3)
%7 = call i32 @timespec_to_timeval(%struct.timespec* %3, %struct.timeval* %0)
ret i32 0
}
int test_imm_17int32_reg(int val) { return ((val) & (0x17 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_17int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x17,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_17int32_reg(i32 %0) {
%2 = and i32 %0, 23
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int cmd_quit() { exit(0); }


x86 assembly (clang, -O0):
<cmd_quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<cmd_quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @cmd_quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int wpas_dbus_register_persistent_group(struct wpa_supplicant *wpa_s,
                                        struct wpa_ssid *ssid) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_dbus_register_persistent_group(%struct.wpa_supplicant* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpa_ssid*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define i32 @wpas_dbus_register_persistent_group(%struct.wpa_supplicant* nocapture readnone %0, %struct.wpa_ssid* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t countBits(uint64_t n) {
  int32_t c;
  for (c = 0; n; c++) {
    n &= n - 1;
  }
  return c;
}


x86 assembly (clang, -O0):
<countBits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <countBits+0x3c>
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
and    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <countBits+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countBits>:
xor    %eax,%eax
test   %rdi,%rdi
je     111d <countBits+0x1d>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rdi),%rcx
add    $0x1,%rax
and    %rcx,%rdi
jne    1110 <countBits+0x10>
ret

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

LLVM IR (-O2):
define i64 @countBits(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i64 %5, -1
%7 = and i64 %6, %5
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i64 [ 0, %1 ], [ %8, %3 ]
ret i64 %11
}
void write_buffer() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_24(int /*<<< orphan*/ const *, int);
uint32_t
hci_event_extended_inquiry_response_get_class_of_device(const uint8_t *event) {
  return little_endian_read_24(event, 11);
}


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

x86 assembly (clang, -O2):
<hci_event_extended_inquiry_response_get_class_of_device>:
mov    $0xb,%esi
jmp    1030 <little_endian_read_24@plt>

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

LLVM IR (-O2):
define i32 @hci_event_extended_inquiry_response_get_class_of_device(i32* %0) {
%2 = tail call i32 @little_endian_read_24(i32* %0, i32 11)
ret i32 %2
}
double multiply(double a, double b) { return a * b; }


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

x86 assembly (clang, -O2):
<multiply>:
mulsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @multiply(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int stack_overflow(void) {
  printf("Stack overflow!\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Stack overflow!\0A\00"
define i32 @stack_overflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [16 x i8] c"Stack overflow!\00"
define i32 @stack_overflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
char setBit(char c, int index, int bit) {
  if (bit == 1)
    return (c | (1 << (index - 1)));
  else
    return (c & (~(1 << (index - 1))));
}


x86 assembly (clang, -O0):
<setBit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1137 <setBit+0x37>
movsbl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <setBit+0x52>
movsbl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit>:
lea    -0x1(%rsi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
or     %dil,%cl
not    %al
and    %dil,%al
cmp    $0x1,%edx
movzbl %cl,%ecx
movzbl %al,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @setBit(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %18
10: ; preds = %3
%11 = load i8, i8* %5
%12 = sext i8 %11 to i32
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = shl i32 1, %14
%16 = or i32 %12, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %4
br label %27
18: ; preds = %3
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = load i32, i32* %6
%22 = sub nsw i32 %21, 1
%23 = shl i32 1, %22
%24 = xor i32 %23, -1
%25 = and i32 %20, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
br label %27
27: ; preds = %18, %10
%28 = load i8, i8* %4
ret i8 %28
}

LLVM IR (-O2):
define signext i8 @setBit(i8 signext %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 1
%5 = add nsw i32 %1, -1
%6 = shl nuw i32 1, %5
%7 = trunc i32 %6 to i8
%8 = or i8 %7, %0
%9 = xor i8 %7, -1
%10 = and i8 %9, %0
%11 = select i1 %4, i8 %8, i8 %10
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ printAsymDCT(int /*<<< orphan*/, int);
int /*<<< orphan*/ stdout;
int main(int _argc, char *_argv[]) { printAsymDCT(stdout, 4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    $0x4,%esi
call   1030 <printAsymDCT@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stdout
%6 = call i32 @printAsymDCT(i32 %5, i32 4)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @printAsymDCT(i32 %3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i, sum = 0;
  for (i = 1; i <= 100; i++) {
    if (i % 3 == 0)
      sum += i;
  }
  printf("%d", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     1167 <main+0x57>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1154 <main+0x44>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1159 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1683)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ execlp(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Running ps with execlp\n");
  execlp("ls", "ls", 0);
  printf("Done.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rsi
xor    %edx,%edx
mov    %rsi,%rdi
call   1040 <execlp@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    %rdi,%rsi
xor    %edx,%edx
call   1040 <execlp@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Running ps with execlp\0A\00"
@.str.1 = [3 x i8] c"ls\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"ls\00"
@str = [23 x i8] c"Running ps with execlp\00"
@str.3 = [6 x i8] c"Done.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put_crlf();
void put_newlines(int n) {
  while (n-- > 0) {
    put_crlf();
  }
}


x86 assembly (clang, -O0):
<put_newlines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    113b <put_newlines+0x2b>
mov    $0x0,%al
call   1030 <put_crlf@plt>
jmp    111b <put_newlines+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_newlines>:
push   %rbx
test   %edi,%edi
jle    112f <put_newlines+0x1f>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <put_crlf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <put_newlines+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @put_newlines(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @put_crlf()
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @put_newlines(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @put_crlf()
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
int octeon_is_simulation(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @octeon_is_simulation() {
ret i32 1
}
float fmap(float x, float in_min, float in_max, float out_min, float out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


x86 assembly (clang, -O0):
<fmap>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmap>:
subss  %xmm1,%xmm0
subss  %xmm3,%xmm4
mulss  %xmm4,%xmm0
subss  %xmm1,%xmm2
divss  %xmm2,%xmm0
addss  %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @fmap(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fsub float %11, %12
%14 = load float, float* %10
%15 = load float, float* %9
%16 = fsub float %14, %15
%17 = fmul float %13, %16
%18 = load float, float* %8
%19 = load float, float* %7
%20 = fsub float %18, %19
%21 = fdiv float %17, %20
%22 = load float, float* %9
%23 = fadd float %21, %22
ret float %23
}

LLVM IR (-O2):
define float @fmap(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %1
%7 = fsub float %4, %3
%8 = fmul float %6, %7
%9 = fsub float %2, %1
%10 = fdiv float %8, %9
%11 = fadd float %10, %3
ret float %11
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos4iv(int /*<<< orphan*/ *);
void RasterPos4iv(GLint v[4]) { glRasterPos4iv(v); }


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

x86 assembly (clang, -O2):
<RasterPos4iv>:
jmp    1030 <glRasterPos4iv@plt>

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

LLVM IR (-O2):
define void @RasterPos4iv(i32* %0) {
%2 = tail call i32 @glRasterPos4iv(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void tty(const char *txt) { puts(txt); }


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

x86 assembly (clang, -O2):
<tty>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @tty(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void keyboard(unsigned char key, int x, int y) {
  x = 0;
  y = 0;
  switch (key) {
  case 27:
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<keyboard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x1(%rbp),%al
sub    $0x1b,%al
jne    1149 <keyboard+0x39>
jmp    1142 <keyboard+0x32>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard>:
cmp    $0x1b,%dil
je     1117 <keyboard+0x7>
ret
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %11 [
i32 27, label %9
]
9: ; preds = %3
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @keyboard(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 27
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xb5() {
  Assert_real((isascii(181) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              910, ("isascii should be 0 for 0xb5"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xb5\00"
define void @t_isascii_0xb5() {
%1 = tail call i64 @isascii(i32 181)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 910, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct field_attr {
  int dummy;
};

/* Variables and functions */
struct field_attr *fieldtrie_insert_n(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
struct field_attr *fieldtrie_insert(char const *s) {
  return fieldtrie_insert_n(s, strlen(s));
}


x86 assembly (clang, -O0):
<fieldtrie_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <fieldtrie_insert_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.field_attr = type { i32 }
define %struct.field_attr* @fieldtrie_insert(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call %struct.field_attr* @fieldtrie_insert_n(i8* %3, i32 %5)
ret %struct.field_attr* %6
}

LLVM IR (-O2):
%struct.field_attr = type { i32 }
define %struct.field_attr* @fieldtrie_insert(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call %struct.field_attr* @fieldtrie_insert_n(i8* %0, i32 %2)
ret %struct.field_attr* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
struct c2dec_context_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int c2dec_write(struct c2dec_context_s *ctx, uint8_t *buf, uint32_t nsamples) {
  printf("c2dec process, len=%d\n", nsamples);
}


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

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

LLVM IR (-O0):
%struct.c2dec_context_s = type { i32 }
@.str = [23 x i8] c"c2dec process, len=%d\0A\00"
define i32 @c2dec_write(%struct.c2dec_context_s* %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.c2dec_context_s*
%6 = alloca i32*
%7 = alloca i32
store %struct.c2dec_context_s* %0, %struct.c2dec_context_s** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
%struct.c2dec_context_s = type { i32 }
@.str = [23 x i8] c"c2dec process, len=%d\0A\00"
define i32 @c2dec_write(%struct.c2dec_context_s* nocapture readnone %0, i32* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Type definitions */
struct mg_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_DEL;
int /*<<< orphan*/ mg_ev_mgr_epoll_ctl(struct mg_connection *,
                                       int /*<<< orphan*/);
void mg_ev_mgr_remove_conn(struct mg_connection *nc) {
  mg_ev_mgr_epoll_ctl(nc, EPOLL_CTL_DEL);
}


x86 assembly (clang, -O0):
<mg_ev_mgr_remove_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
call   1030 <mg_ev_mgr_epoll_ctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_ev_mgr_remove_conn>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <mg_ev_mgr_epoll_ctl@plt>

LLVM IR (-O0):
%struct.mg_connection = type { i32 }
@EPOLL_CTL_DEL = global i32 0
define void @mg_ev_mgr_remove_conn(%struct.mg_connection* %0) {
%2 = alloca %struct.mg_connection*
store %struct.mg_connection* %0, %struct.mg_connection** %2
%3 = load %struct.mg_connection*, %struct.mg_connection** %2
%4 = load i32, i32* @EPOLL_CTL_DEL
%5 = call i32 @mg_ev_mgr_epoll_ctl(%struct.mg_connection* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.mg_connection = type { i32 }
@EPOLL_CTL_DEL = global i32 0
define void @mg_ev_mgr_remove_conn(%struct.mg_connection* %0) {
%2 = load i32, i32* @EPOLL_CTL_DEL
%3 = tail call i32 @mg_ev_mgr_epoll_ctl(%struct.mg_connection* %0, i32 %2)
ret void
}
int g5_get_number_of_pipelines(void) { return (4); }


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

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

LLVM IR (-O0):
define i32 @g5_get_number_of_pipelines() {
ret i32 4
}

LLVM IR (-O2):
define i32 @g5_get_number_of_pipelines() {
ret i32 4
}
/* Variables and functions */
long double __gammal_r_finite(long double, int *);
long double tgammal(long double __d) {
  signed int __local_signgam = 0;
  long double __res;
  __res = __gammal_r_finite(__d, &__local_signgam);
  return __local_signgam < 0 ? -__res : __res;
}


x86 assembly (clang, -O0):
<tgammal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
movl   $0x0,-0x14(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    -0x14(%rbp),%rdi
call   1030 <__gammal_r_finite@plt>
fstpt  -0x30(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1150 <tgammal+0x40>
fldt   -0x30(%rbp)
fchs
fstpt  -0x3c(%rbp)
jmp    1156 <tgammal+0x46>
fldt   -0x30(%rbp)
fstpt  -0x3c(%rbp)
fldt   -0x3c(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgammal>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
movl   $0x0,0x14(%rsp)
fstpt  (%rsp)
lea    0x14(%rsp),%rdi
call   1030 <__gammal_r_finite@plt>
cmpl   $0x0,0x14(%rsp)
sets   %al
fld    %st(0)
fchs
test   %al,%al
fxch   %st(1)
fcmovne %st(1),%st
fstp   %st(1)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @tgammal(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca i32
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
store i32 0, i32* %3
%5 = load x86_fp80, x86_fp80* %2
%6 = call x86_fp80 @__gammal_r_finite(x86_fp80 %5, i32* %3)
store x86_fp80 %6, x86_fp80* %4
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load x86_fp80, x86_fp80* %4
%11 = fneg x86_fp80 %10
br label %14
12: ; preds = %1
%13 = load x86_fp80, x86_fp80* %4
br label %14
14: ; preds = %12, %9
%15 = phi x86_fp80 [ %11, %9 ], [ %13, %12 ]
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @tgammal(x86_fp80 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call x86_fp80 @__gammal_r_finite(x86_fp80 %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
%7 = fneg x86_fp80 %4
%8 = select i1 %6, x86_fp80 %7, x86_fp80 %4
ret x86_fp80 %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: addpattern [-i trxfile] [-o binfile] [-B board_id] [-p pattern] "
      "[-s serial] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4|5}] -h\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [133 x i8] c"Usage: addpattern [-i trxfile] [-o binfile] [-B board_id] [-p pattern] [-s serial] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4|5}] -h\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [133 x i8] c"Usage: addpattern [-i trxfile] [-o binfile] [-B board_id] [-p pattern] [-s serial] [-g] [-b] [-v v#.#.#] [-r #.#] [-{0|1|2|4|5}] -h\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int strcmp(char *, char *);
int depSort(const void *p1, const void *p2) {
  char *s1, *s2;
  s1 = *(char **)p1;
  s2 = *(char **)p2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<depSort>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @depSort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @strcmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @depSort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int format;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_format(void *_p, int _v) { ((XImage *)_p)->format = (int)_v; }


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

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

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

LLVM IR (-O2):
define void @set_XImage_format(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
OP(fd, d7) {
  illegal_1();
  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 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_d7@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <illegal_1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <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 (...) @illegal_1()
%7 = call i32 (...) @op_d7()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_d7()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int mq_send(int /*<<< orphan*/, char *, int, int);
void send(mqd_t mq, char *msg) {
  if (mq_send(mq, msg, 8192, 1) == -1) {
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x2000,%edx
mov    $0x1,%ecx
call   1030 <mq_send@plt>
cmp    $0xffffffff,%eax
jne    115c <send+0x3c>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send>:
push   %rax
mov    $0x2000,%edx
mov    $0x1,%ecx
call   1030 <mq_send@plt>
cmp    $0xffffffff,%eax
je     1137 <send+0x17>
pop    %rax
ret
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @send(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @mq_send(i32 %5, i8* %6, i32 8192, i32 1)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @send(i32 %0, i8* %1) {
%3 = tail call i32 @mq_send(i32 %0, i8* %1, i32 8192, i32 1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ time;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
unsigned long get_XPropertyEvent_time(void *_p) {
  return (unsigned long)((XPropertyEvent *)_p)->time;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XPropertyEvent_time(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int HelpItem143(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem143() {
ret i32 0
}
char *cgiMultListShadowPrefix() { return "multishad."; }


x86 assembly (clang, -O0):
<cgiMultListShadowPrefix>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMultListShadowPrefix>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"multishad.\00"
define i8* @cgiMultListShadowPrefix() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [11 x i8] c"multishad.\00"
define i8* @cgiMultListShadowPrefix() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
double SIN(statlink, x)
int *statlink;
double x;
{ return (_sin(x)); }


x86 assembly (clang, -O0):
<SIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1030 <_sin@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIN>:
push   %rax
mov    $0x1,%al
call   1030 <_sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SIN(i32* %0, double %1) {
%3 = alloca i32*
%4 = alloca double
store i32* %0, i32** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call i32 (double, ...) bitcast (i32 (...)* @_sin to i32 (double, ...)*)(double %5)
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @SIN(i32* nocapture readnone %0, double %1) {
%3 = tail call i32 (double, ...) bitcast (i32 (...)* @_sin to i32 (double, ...)*)(double %1)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(char *s) {
  fprintf(stderr, "usage: gf_example_3\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"usage: gf_example_3\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}