xunge/DecIR huggingface dataset:
int checkCopiedAlready(const char *path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @checkCopiedAlready(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double distance_to_line_ratio_xing(double, double, double, double, double,
                                   double, double *, double *, double *);
double distance_to_line_ratio(double latitude, double longitude,
                              double latitude_a, double longitude_a,
                              double latitude_b, double longitude_b,
                              double *ab_ratio) {
  double x_latitude, x_longitude;
  return distance_to_line_ratio_xing(latitude, longitude, latitude_a,
                                     longitude_a, latitude_b, longitude_b,
                                     &x_latitude, &x_longitude, ab_ratio);
}


x86 assembly (clang, -O0):
<distance_to_line_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
mov    %rdi,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
mov    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1030 <distance_to_line_ratio_xing@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_to_line_ratio>:
sub    $0x18,%rsp
mov    %rdi,%rdx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <distance_to_line_ratio_xing@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @distance_to_line_ratio(double %0, double %1, double %2, double %3, double %4, double %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double*
%15 = alloca double
%16 = alloca double
store double %0, double* %8
store double %1, double* %9
store double %2, double* %10
store double %3, double* %11
store double %4, double* %12
store double %5, double* %13
store double* %6, double** %14
%17 = load double, double* %8
%18 = load double, double* %9
%19 = load double, double* %10
%20 = load double, double* %11
%21 = load double, double* %12
%22 = load double, double* %13
%23 = load double*, double** %14
%24 = call double @distance_to_line_ratio_xing(double %17, double %18, double %19, double %20, double %21, double %22, double* %15, double* %16, double* %23)
ret double %24
}

LLVM IR (-O2):
define double @distance_to_line_ratio(double %0, double %1, double %2, double %3, double %4, double %5, double* %6) {
%8 = alloca double
%9 = alloca double
%10 = bitcast double* %8 to i8*
%11 = bitcast double* %9 to i8*
%12 = call double @distance_to_line_ratio_xing(double %0, double %1, double %2, double %3, double %4, double %5, double* %8, double* %9, double* %6)
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
size_t backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols_fd(void **, size_t, int /*<<< orphan*/);
void printStackTrace() {
  void *array[10];
  size_t size = backtrace(array, 10);
  backtrace_symbols_fd(array, size, STDERR_FILENO);
}


x86 assembly (clang, -O0):
<printStackTrace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    %rax,-0x58(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
call   1030 <backtrace_symbols_fd@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStackTrace>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <backtrace@plt>
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%edx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <backtrace_symbols_fd@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
define void @printStackTrace() {
%1 = alloca [10 x i8*]
%2 = alloca i64
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 10)
store i64 %4, i64* %2
%5 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%6 = load i64, i64* %2
%7 = load i32, i32* @STDERR_FILENO
%8 = call i32 @backtrace_symbols_fd(i8** %5, i64 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define void @printStackTrace() {
%1 = alloca [10 x i8*]
%2 = bitcast [10 x i8*]* %1 to i8*
%3 = getelementptr inbounds [10 x i8*], [10 x i8*]* %1, i64 0, i64 0
%4 = call i64 @backtrace(i8** %3, i32 10)
%5 = load i32, i32* @STDERR_FILENO
%6 = call i32 @backtrace_symbols_fd(i8** %3, i64 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  static int a[] = {3, 4};
  register int *b;
  int c;
  b = a;
  c = *b++ % 8;
  if (c != 3)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2efa(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
je     1167 <main+0x47>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@main.a = internal global [2 x i32] [i32 3, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @main.a, i64 0, i64 0), i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i32 1
store i32* %5, i32** %2
%6 = load i32, i32* %4
%7 = srem i32 %6, 8
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 3
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fputc(int, int /*<<< orphan*/ *);
int put_des_char(int c, FILE *fp) { return (fputc(c, fp)); }


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

x86 assembly (clang, -O2):
<put_des_char>:
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define i32 @put_des_char(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @fputc(i32 %0, i32* %1)
ret i32 %3
}
/* Type definitions */
struct wpa_ssid {
  int dummy;
};
struct parse_data {
  int dummy;
};

/* Variables and functions */
char *wpa_config_write_wep_key(struct wpa_ssid *, int);
char *wpa_config_write_wep_key1(const struct parse_data *data,
                                struct wpa_ssid *ssid) {
  return wpa_config_write_wep_key(ssid, 1);
}


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

x86 assembly (clang, -O2):
<wpa_config_write_wep_key1>:
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <wpa_config_write_wep_key@plt>

LLVM IR (-O0):
%struct.parse_data = type { i32 }
%struct.wpa_ssid = type { i32 }
define i8* @wpa_config_write_wep_key1(%struct.parse_data* %0, %struct.wpa_ssid* %1) {
%3 = alloca %struct.parse_data*
%4 = alloca %struct.wpa_ssid*
store %struct.parse_data* %0, %struct.parse_data** %3
store %struct.wpa_ssid* %1, %struct.wpa_ssid** %4
%5 = load %struct.wpa_ssid*, %struct.wpa_ssid** %4
%6 = call i8* @wpa_config_write_wep_key(%struct.wpa_ssid* %5, i32 1)
ret i8* %6
}

LLVM IR (-O2):
%struct.parse_data = type { i32 }
%struct.wpa_ssid = type { i32 }
define i8* @wpa_config_write_wep_key1(%struct.parse_data* nocapture readnone %0, %struct.wpa_ssid* %1) {
%3 = tail call i8* @wpa_config_write_wep_key(%struct.wpa_ssid* %1, i32 1)
ret i8* %3
}
/* Variables and functions */
int __builtin_wasm_trunc_saturate_u_i32_f64(double);
int trunc_saturate_u_i32_f64(double f) {
  return __builtin_wasm_trunc_saturate_u_i32_f64(f);
}


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

x86 assembly (clang, -O2):
<trunc_saturate_u_i32_f64>:
jmp    1030 <__builtin_wasm_trunc_saturate_u_i32_f64@plt>

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

LLVM IR (-O2):
define i32 @trunc_saturate_u_i32_f64(double %0) {
%2 = tail call i32 @__builtin_wasm_trunc_saturate_u_i32_f64(double %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void fa_write_u16(int in, FILE *fp) {
  unsigned char temp[2];
  temp[0] = in & 0xff;
  temp[1] = in >> 8;
  fwrite(temp, sizeof(*temp), 2, fp);
}


x86 assembly (clang, -O0):
<fa_write_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x12(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x11(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa_write_u16>:
push   %rax
mov    %rsi,%rcx
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @fa_write_u16(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca [2 x i8]
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %8, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = load i32*, i32** %4
%16 = call i32 @fwrite(i8* %14, i32 1, i32 2, i32* %15)
ret void
}

LLVM IR (-O2):
define void @fa_write_u16(i32 %0, i32* nocapture %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %0 to i8
store i8 %5, i8* %4
%6 = lshr i32 %0, 8
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 1, i32 2, i32* %1)
ret void
}
void XDefaultDepth() {}


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

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

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

LLVM IR (-O2):
define void @XDefaultDepth() {
ret void
}
/* Type definitions */
struct epoll_event {
  int dummy;
};

/* Variables and functions */
int epoll_pwait(int, struct epoll_event *, int, int, int /*<<< orphan*/ *);
int epoll_wait(int epfd, struct epoll_event *events, int maxevents,
               int timeout) {
  return epoll_pwait(epfd, events, maxevents, timeout, NULL);
}


x86 assembly (clang, -O0):
<epoll_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <epoll_pwait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_wait>:
xor    %r8d,%r8d
jmp    1030 <epoll_pwait@plt>

LLVM IR (-O0):
%struct.epoll_event = type { i32 }
define i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca %struct.epoll_event*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store %struct.epoll_event* %1, %struct.epoll_event** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load %struct.epoll_event*, %struct.epoll_event** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @epoll_pwait(i32 %9, %struct.epoll_event* %10, i32 %11, i32 %12, i32* null)
ret i32 %13
}

LLVM IR (-O2):
%struct.epoll_event = type { i32 }
define i32 @epoll_wait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3) {
%5 = tail call i32 @epoll_pwait(i32 %0, %struct.epoll_event* %1, i32 %2, i32 %3, i32* null)
ret i32 %5
}
int solve() {}


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

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

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

LLVM IR (-O2):
define i32 @solve() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void radio_df_cte_tx_aod_2us_set(uint8_t cte_len) {}


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

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

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

LLVM IR (-O2):
define void @radio_df_cte_tx_aod_2us_set(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ angelinaCall();
int /*<<< orphan*/ bigMacCall();
int /*<<< orphan*/ cleanup();
void Specification1(void) {
  {
    {
      bigMacCall();
      angelinaCall();
      cleanup();
    }
    return;
  }
}


x86 assembly (clang, -O0):
<Specification1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <bigMacCall@plt>
mov    $0x0,%al
call   1030 <angelinaCall@plt>
mov    $0x0,%al
call   1050 <cleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Specification1>:
push   %rax
xor    %eax,%eax
call   1040 <bigMacCall@plt>
xor    %eax,%eax
call   1030 <angelinaCall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup@plt>

LLVM IR (-O0):
define void @Specification1() {
%1 = call i32 (...) @bigMacCall()
%2 = call i32 (...) @angelinaCall()
%3 = call i32 (...) @cleanup()
ret void
}

LLVM IR (-O2):
define void @Specification1() {
%1 = tail call i32 (...) @bigMacCall()
%2 = tail call i32 (...) @angelinaCall()
%3 = tail call i32 (...) @cleanup()
ret void
}
int my_drv_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @my_drv_init() {
ret i32 0
}
int isQ(int c) { return c == 'q' || c == 'Q'; }


x86 assembly (clang, -O0):
<isQ>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x71,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <isQ+0x20>
cmpl   $0x51,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isQ>:
and    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x51,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isQ(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 113
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 81
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isQ(i32 %0) {
%2 = and i32 %0, -33
%3 = icmp eq i32 %2, 81
%4 = zext i1 %3 to i32
ret i32 %4
}
void errno_to_str(char *str) {}


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

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

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

LLVM IR (-O2):
define void @errno_to_str(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char getchar();
void neglect_input() {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<neglect_input>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <neglect_input+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <neglect_input+0x21>
jmp    1119 <neglect_input+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<neglect_input>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <neglect_input+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @neglect_input() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @neglect_input() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ raiseerror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *p, size_t size) {
  void *newp;
  newp = realloc(p, size);
  if (newp == NULL)
    raiseerror("realloc returned NULL");
  return newp;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1030 <raiseerror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xrealloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <raiseerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"realloc returned NULL\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @raiseerror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [22 x i8] c"realloc returned NULL\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @raiseerror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x53() {
  Assert_real((isalnum(83)),
              "/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_isalnum.c",
              420, ("isalnum should be 1 for S"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x53>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1a4,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x53>:
push   %rax
mov    $0x53,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1a4,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for S\00"
define void @t_isalnum_0x53() {
%1 = call i32 @isalnum(i32 83)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for S\00"
define void @t_isalnum_0x53() {
%1 = tail call i32 @isalnum(i32 83)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void create_HashMapImpl(void *AltType) { return; }


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

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

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

LLVM IR (-O2):
define void @create_HashMapImpl(i8* nocapture %0) {
ret void
}
void SPI1_DisableTxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI1_DisableTxInt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xba() {
  Assert_real((isodigit(186) == 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_isodigit.c",
              935, ("isodigit should be 0 for 0xba"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xba>:
push   %rax
mov    $0xba,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3a7,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xba\00"
define void @t_isodigit_0xba() {
%1 = call i64 @isodigit(i32 186)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 935, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xba\00"
define void @t_isodigit_0xba() {
%1 = tail call i64 @isodigit(i32 186)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 935, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ffvers(float *);
int /*<<< orphan*/ fp_msg(char *);
int /*<<< orphan*/ sprintf(char *, char *, float);
int fp_version(void) {
  float version;
  char cfitsioversion[40];
  fp_msg("1.6.0 (Feb 2011)");
  ffvers(&version);
  sprintf(cfitsioversion, " CFITSIO version %5.3f", version);
  fp_msg(cfitsioversion);
  fp_msg("\n");
  return (0);
}


x86 assembly (clang, -O0):
<fp_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
call   1030 <fp_msg@plt>
lea    -0x4(%rbp),%rdi
call   1040 <ffvers@plt>
lea    -0x30(%rbp),%rdi
movss  -0x4(%rbp),%xmm0
lea    0xeb4(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <fp_msg@plt>
lea    0xeb6(%rip),%rdi
call   1030 <fp_msg@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_version>:
push   %rbx
sub    $0x40,%rsp
lea    0xec4(%rip),%rdi
call   1030 <fp_msg@plt>
lea    0xc(%rsp),%rdi
call   1040 <ffvers@plt>
movss  0xc(%rsp),%xmm0
lea    0xeb9(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <fp_msg@plt>
lea    0xeb4(%rip),%rdi
call   1030 <fp_msg@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"1.6.0 (Feb 2011)\00"
@.str.1 = [23 x i8] c" CFITSIO version %5.3f\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @fp_version() {
%1 = alloca float
%2 = alloca [40 x i8]
%3 = call i32 @fp_msg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @ffvers(float* %1)
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%6 = load float, float* %1
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float %6)
%8 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%9 = call i32 @fp_msg(i8* %8)
%10 = call i32 @fp_msg(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"1.6.0 (Feb 2011)\00"
@.str.1 = [23 x i8] c" CFITSIO version %5.3f\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @fp_version() {
%1 = alloca float
%2 = alloca [40 x i8]
%3 = bitcast float* %1 to i8*
%4 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @fp_msg(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @ffvers(float* %1)
%7 = load float, float* %1
%8 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), float %7)
%9 = call i32 @fp_msg(i8* %4)
%10 = call i32 @fp_msg(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int vasprintf(char **, char const *, int /*<<< orphan*/);
char *btp_vasprintf(const char *format, va_list p) {
  int r;
  char *string_ptr;
  r = vasprintf(&string_ptr, format, p);
  if (r < 0) {
    fprintf(stderr, "btp: out of memory");
    exit(1);
  }
  return string_ptr;
}


x86 assembly (clang, -O0):
<btp_vasprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
call   1030 <vasprintf@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    117b <btp_vasprintf+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_vasprintf>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <vasprintf@plt>
test   %eax,%eax
js     1148 <btp_vasprintf+0x18>
mov    (%rsp),%rax
pop    %rcx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"btp: out of memory\00"
define i8* @btp_vasprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @vasprintf(i8** %6, i8* %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %6
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"btp: out of memory\00"
define i8* @btp_vasprintf(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i32 @vasprintf(i8** %3, i8* %0, i32 %1)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
%12 = load i8*, i8** %3
ret i8* %12
}
void swap(int i, int j, int *arr) {
  int tmp = arr[i];
  arr[i] = arr[j];
  arr[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %edi,%rax
mov    (%rdx,%rax,4),%ecx
movslq %esi,%rsi
mov    (%rdx,%rsi,4),%edi
mov    %edi,(%rdx,%rax,4)
mov    %ecx,(%rdx,%rsi,4)
ret

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

LLVM IR (-O2):
define void @swap(i32 %0, i32 %1, i32* nocapture %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %2, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ file1_func1();
int /*<<< orphan*/ file1_func3();
int /*<<< orphan*/ file2_func2();
int main(int argc, char **argv) {
  file1_func1();
  file1_func3();
  file2_func2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <file1_func1@plt>
mov    $0x0,%al
call   1040 <file1_func3@plt>
mov    $0x0,%al
call   1050 <file2_func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <file1_func1@plt>
xor    %eax,%eax
call   1040 <file1_func3@plt>
xor    %eax,%eax
call   1050 <file2_func2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @file1_func1()
%7 = call i32 (...) @file1_func3()
%8 = call i32 (...) @file2_func2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @file1_func1()
%4 = tail call i32 (...) @file1_func3()
%5 = tail call i32 (...) @file2_func2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sharedbuffer_end();
void sharedbuffer_reset() { sharedbuffer_end(); }


x86 assembly (clang, -O0):
<sharedbuffer_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <sharedbuffer_end@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sharedbuffer_reset() {
%1 = call i32 (...) @sharedbuffer_end()
ret void
}

LLVM IR (-O2):
define void @sharedbuffer_reset() {
%1 = tail call i32 (...) @sharedbuffer_end()
ret void
}
void to_uns_int_store(__float128 a, unsigned int *p) { *p = (unsigned int)a; }


x86 assembly (clang, -O0):
<to_uns_int_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movaps %xmm0,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movaps -0x10(%rbp),%xmm0
call   1130 <__fixunstfsi>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<to_uns_int_store>:
push   %rbx
mov    %rdi,%rbx
call   1110 <__fixunstfsi>
mov    %eax,(%rbx)
pop    %rbx
ret
nopl   (%rax)

LLVM IR (-O0):
define void @to_uns_int_store(fp128 %0, i32* %1) {
%3 = alloca fp128
%4 = alloca i32*
store fp128 %0, fp128* %3
store i32* %1, i32** %4
%5 = load fp128, fp128* %3
%6 = fptoui fp128 %5 to i32
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @to_uns_int_store(fp128 %0, i32* nocapture writeonly %1) {
%3 = fptoui fp128 %0 to i32
store i32 %3, i32* %1
ret void
}
/* Type definitions */
struct parameter {
  int dummy;
};

/* Variables and functions */
int com_xmatch(int, struct parameter *, int);
int com_gmatch(int p, struct parameter *param) {
  return com_xmatch(p, param, 1);
}


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

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

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

LLVM IR (-O2):
%struct.parameter = type { i32 }
define i32 @com_gmatch(i32 %0, %struct.parameter* %1) {
%3 = tail call i32 @com_xmatch(i32 %0, %struct.parameter* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
char *procparse_strerr(int);
int /*<<< orphan*/ stderr;
void do_or_die(int result, char *msg) {
  if (!result) {
    return;
  }
  fprintf(stderr, "Error: %s -- %s\n", msg, procparse_strerr(result));
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<do_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114f <do_or_die+0x1f>
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <procparse_strerr@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<do_or_die>:
test   %edi,%edi
jne    1135 <do_or_die+0x5>
ret
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x2e9e(%rip),%rax
mov    (%rax),%ebp
call   1030 <procparse_strerr@plt>
lea    0xeb0(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Error: %s -- %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @do_or_die(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 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
ret void
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %4
%11 = load i32, i32* %3
%12 = call i8* @procparse_strerr(i32 %11)
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Error: %s -- %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @do_or_die(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %5
4: ; preds = %2
ret void
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i8* @procparse_strerr(i32 %0)
%8 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
}
int f(char *x) {
  asm("f_label: .globl f_label");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @f(i8* nocapture readnone %0) {
tail call void asm sideeffect "f_label: .globl f_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
subr(int i) { printf("%i\n", i); }


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

x86 assembly (clang, -O2):
<subr>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @subr(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
/* Type definitions */
struct tms {
  float tms_utime;
};

/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
scalar_t__ sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ times(struct tms *);
float report_cpu_time() {
  struct tms buffer;
  float cputime;
  times(&buffer);
  cputime = (buffer.tms_utime) / (float)sysconf(_SC_CLK_TCK);
  return (cputime);
}


x86 assembly (clang, -O0):
<report_cpu_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <times@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_cpu_time>:
push   %rax
mov    %rsp,%rdi
call   1030 <times@plt>
movss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.tms = type { float }
@_SC_CLK_TCK = global i32 0
define float @report_cpu_time() {
%1 = alloca %struct.tms
%2 = alloca float
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%5 = load float, float* %4
%6 = load i32, i32* @_SC_CLK_TCK
%7 = call i64 @sysconf(i32 %6)
%8 = sitofp i64 %7 to float
%9 = fdiv float %5, %8
store float %9, float* %2
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
%struct.tms = type { float }
@_SC_CLK_TCK = global i32 0
define float @report_cpu_time() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load float, float* %4
%6 = load i32, i32* @_SC_CLK_TCK
%7 = tail call i64 @sysconf(i32 %6)
%8 = sitofp i64 %7 to float
%9 = fdiv float %5, %8
ret float %9
}
g() { return 22; }


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

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

LLVM IR (-O0):
define i32 @g() {
ret i32 22
}

LLVM IR (-O2):
define i32 @g() {
ret i32 22
}
void ad7160_feed_raw(void) {}


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

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

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

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

/* Variables and functions */
int pthread_mutex_unlock(int /*<<< orphan*/ *);
int mutex_unlock(pthread_mutex_t *mutex) { return pthread_mutex_unlock(mutex); }


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

x86 assembly (clang, -O2):
<mutex_unlock>:
jmp    1030 <pthread_mutex_unlock@plt>

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

LLVM IR (-O2):
define i32 @mutex_unlock(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *U_EMR_CORE5(int);
char *U_EMRBEGINPATH_set(void) { return (U_EMR_CORE5(59)); }


x86 assembly (clang, -O0):
<U_EMRBEGINPATH_set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
call   1030 <U_EMR_CORE5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRBEGINPATH_set>:
mov    $0x3b,%edi
jmp    1030 <U_EMR_CORE5@plt>

LLVM IR (-O0):
define i8* @U_EMRBEGINPATH_set() {
%1 = call i8* @U_EMR_CORE5(i32 59)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRBEGINPATH_set() {
%1 = tail call i8* @U_EMR_CORE5(i32 59)
ret i8* %1
}
/* Variables and functions */
int EXIT_FAILURE;
scalar_t__ EXIT_SUCCESS;
scalar_t__ ft_putchar_fd(char, int);
int ft_putstr_fd(char const *, int);
int ft_putendl_fd(char const *s, int fd) {
  int ret;
  ret = ft_putstr_fd(s, fd);
  ret = ft_putchar_fd('\n', fd) == EXIT_SUCCESS ? ret : EXIT_FAILURE;
  return (ret);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <ft_putstr_fd@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1040 <ft_putchar_fd@plt>
mov    0x2e86(%rip),%rcx
cmp    (%rcx),%rax
jne    1166 <ft_putendl_fd+0x46>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1172 <ft_putendl_fd+0x52>
mov    0x2e73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <ft_putstr_fd@plt>
mov    %eax,%ebx
mov    $0xa,%edi
mov    %ebp,%esi
call   1040 <ft_putchar_fd@plt>
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%rax
je     114d <ft_putendl_fd+0x2d>
mov    0x2e95(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putendl_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @ft_putstr_fd(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = call i64 @ft_putchar_fd(i8 signext 10, i32 %9)
%11 = load i64, i64* @EXIT_SUCCESS
%12 = icmp eq i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = load i32, i32* %5
br label %17
15: ; preds = %2
%16 = load i32, i32* @EXIT_FAILURE
br label %17
17: ; preds = %15, %13
%18 = phi i32 [ %14, %13 ], [ %16, %15 ]
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @ft_putendl_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_putstr_fd(i8* %0, i32 %1)
%4 = tail call i64 @ft_putchar_fd(i8 signext 10, i32 %1)
%5 = load i64, i64* @EXIT_SUCCESS
%6 = icmp eq i64 %4, %5
%7 = load i32, i32* @EXIT_FAILURE
%8 = select i1 %6, i32 %3, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int O_ACCMODE;
int O_RDONLY;
int fcntl(int, int /*<<< orphan*/);
int open_for_writing(int fd) {
  int flags, access_mode;
  flags = fcntl(fd, F_GETFL);
  if (flags == -1) {
    return 1;
  }
  access_mode = flags & O_ACCMODE;
  return (access_mode != O_RDONLY);
}


x86 assembly (clang, -O0):
<open_for_writing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1145 <open_for_writing+0x35>
movl   $0x1,-0x4(%rbp)
jmp    116b <open_for_writing+0x5b>
mov    -0xc(%rbp),%eax
mov    0x2ea1(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e82(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_for_writing>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
je     113f <open_for_writing+0x2f>
mov    %eax,%ecx
mov    0x2ec3(%rip),%rax
and    (%rax),%ecx
mov    0x2eaa(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%ecx
setne  %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_ACCMODE = global i32 0
@O_RDONLY = global i32 0
define i32 @open_for_writing(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* @F_GETFL
%8 = call i32 @fcntl(i32 %6, i32 %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %20
12: ; preds = %1
%13 = load i32, i32* %4
%14 = load i32, i32* @O_ACCMODE
%15 = and i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* @O_RDONLY
%18 = icmp ne i32 %16, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %12, %11
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_ACCMODE = global i32 0
@O_RDONLY = global i32 0
define i32 @open_for_writing(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* @O_ACCMODE
%7 = and i32 %6, %3
%8 = load i32, i32* @O_RDONLY
%9 = icmp ne i32 %7, %8
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %5
%12 = phi i32 [ %10, %5 ], [ 1, %1 ]
ret i32 %12
}