xunge/DecIR huggingface dataset:
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int nanosleep(struct timespec const *, struct timespec *);
int althrd_sleep(const struct timespec *ts, struct timespec *rem) {
  int ret = nanosleep(ts, rem);
  if (ret != 0) {
    ret = ((errno == EINTR) ? -1 : -2);
    errno = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<althrd_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <nanosleep@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116f <althrd_sleep+0x5f>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
mov    0x2e8d(%rip),%rax
mov    (%rax),%rsi
mov    $0xfffffffe,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    0x2e78(%rip),%rax
movq   $0x0,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<althrd_sleep>:
push   %rax
call   1030 <nanosleep@plt>
test   %eax,%eax
je     113f <althrd_sleep+0x2f>
mov    0x2ebf(%rip),%rcx
mov    (%rcx),%rdx
mov    0x2ead(%rip),%rsi
xor    %eax,%eax
cmp    (%rsi),%rdx
sete   %al
or     $0xfffffffe,%eax
movq   $0x0,(%rcx)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @althrd_sleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
%5 = alloca i32
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @nanosleep(%struct.timespec* %6, %struct.timespec* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64, i64* @errno
%13 = load i64, i64* @EINTR
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 -1, i32 -2
store i32 %16, i32* %5
store i64 0, i64* @errno
br label %17
17: ; preds = %11, %2
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @althrd_sleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
%9 = select i1 %8, i32 -1, i32 -2
store i64 0, i64* @errno
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ %9, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int day_of_year(int, int, int);
int /*<<< orphan*/ month_day(int, int, int *, int *);
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int a, b;
  printf("%dth day of the year\n", day_of_year(2001, 5, 30));
  month_day(2000, 366, &a, &b);
  printf("month = %d  day = %d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7d1,%edi
mov    $0x5,%esi
mov    $0x1e,%edx
call   1050 <day_of_year@plt>
mov    %eax,%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x7d0,%edi
mov    $0x16e,%esi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <month_day@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7d1,%edi
mov    $0x5,%esi
mov    $0x1e,%edx
call   1050 <day_of_year@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x7d0,%edi
mov    $0x16e,%esi
call   1030 <month_day@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%dth day of the year\0A\00"
@.str.1 = [22 x i8] c"month = %d day = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @day_of_year(i32 2001, i32 5, i32 30)
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @month_day(i32 2000, i32 366, i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"%dth day of the year\0A\00"
@.str.1 = [22 x i8] c"month = %d day = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @day_of_year(i32 2001, i32 5, i32 30)
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @month_day(i32 2000, i32 366, i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}
void foo626(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo626(i32 %0) {
ret void
}
void printchar(char **str, int c) {
  if (str) {
    **str = c;
    ++(*str);
  }
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1132 <printchar+0x32>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
test   %rdi,%rdi
je     110f <printchar+0xf>
mov    (%rdi),%rax
mov    %sil,(%rax)
addq   $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @printchar(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = icmp ne i8** %5, null
br i1 %6, label %7, label %15
7: ; preds = %2
%8 = load i32, i32* %4
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
store i8 %9, i8* %11
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %12
br label %15
15: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @printchar(i8** %0, i32 %1) {
%3 = icmp eq i8** %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = trunc i32 %1 to i8
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__0__IO__makeOutput();
void LedsP__Led2__makeOutput(void) {
  HplAtm128GeneralIOPinP__0__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__0__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
char *hlr_strmcpyI(char *to, char *from, int toLength) {
  to[toLength - 1] = '\0';
  strncpy(to, from, toLength - 1);
  return to;
}


x86 assembly (clang, -O0):
<hlr_strmcpyI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlr_strmcpyI>:
push   %rbx
mov    %rdi,%rbx
movslq %edx,%rdx
movb   $0x0,-0x1(%rdi,%rdx,1)
add    $0xffffffffffffffff,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @hlr_strmcpyI(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %7, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = call i32 @strncpy(i8* %12, i8* %13, i32 %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @hlr_strmcpyI(i8* returned %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
%7 = tail call i32 @strncpy(i8* %0, i8* %1, i32 %4)
ret i8* %0
}
float asinhf(float x) { return 0.0; }


x86 assembly (clang, -O0):
<asinhf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @asinhf(float %0) {
%2 = alloca float
store float %0, float* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @asinhf(float %0) {
ret float 0.000000e+00
}
void gtk_wrap_mode_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_wrap_mode_get_type() {
ret void
}
/* Variables and functions */
int mfspr(int);
int /*<<< orphan*/ mtspr(int, int);
void tick_init(void) {
  mtspr(((0 << (11)) + 17), 0x00000002 | mfspr(((0 << (11)) + 17)));
  mtspr(((10 << (11)) + 0),
        0x20000000 | 0x40000000 | ((50000000 / 100) & 0x0fffffff));
}


x86 assembly (clang, -O0):
<tick_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %eax,%esi
or     $0x2,%esi
mov    $0x11,%edi
call   1040 <mtspr@plt>
mov    $0x5000,%edi
mov    $0x6007a120,%esi
call   1040 <mtspr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tick_init>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
or     $0x2,%eax
mov    $0x11,%edi
mov    %eax,%esi
call   1040 <mtspr@plt>
mov    $0x5000,%edi
mov    $0x6007a120,%esi
pop    %rax
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @tick_init() {
%1 = call i32 @mfspr(i32 17)
%2 = or i32 2, %1
%3 = call i32 @mtspr(i32 17, i32 %2)
%4 = call i32 @mtspr(i32 20480, i32 1611112736)
ret void
}

LLVM IR (-O2):
define void @tick_init() {
%1 = tail call i32 @mfspr(i32 17)
%2 = or i32 %1, 2
%3 = tail call i32 @mtspr(i32 17, i32 %2)
%4 = tail call i32 @mtspr(i32 20480, i32 1611112736)
ret void
}
char *reg_enum_settings_next(void *handle, char *buffer, int buflen) {
  struct enumsettings *e = (struct enumsettings *)handle;
  char *otherbuf;
}


x86 assembly (clang, -O0):
<reg_enum_settings_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.enumsettings = type opaque
define i8* @reg_enum_settings_next(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca %struct.enumsettings*
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to %struct.enumsettings*
store %struct.enumsettings* %11, %struct.enumsettings** %8
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @reg_enum_settings_next(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i8* undef
}
int hwlist_lcd_dpi(const char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwlist_lcd_dpi(i8* nocapture readnone %0) {
ret i32 0
}
void tegra_serial_debug_init_irq_mode(unsigned int base, int irq,
                                      struct clk *clk, int signal_irq,
                                      int wakeup_irq) {}


x86 assembly (clang, -O0):
<tegra_serial_debug_init_irq_mode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.clk = type opaque
define void @tegra_serial_debug_init_irq_mode(i32 %0, i32 %1, %struct.clk* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.clk*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store %struct.clk* %2, %struct.clk** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret void
}

LLVM IR (-O2):
%struct.clk = type opaque
define void @tegra_serial_debug_init_irq_mode(i32 %0, i32 %1, %struct.clk* nocapture %2, i32 %3, i32 %4) {
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
int __maskrune(int, int);
scalar_t__ iswprint(int);
int wcwidth(wchar_t wc) {
  int width;
  if (wc == L'\0')
    return (0);
  width = __maskrune(wc, 0xe0000000L);
  return (width ? (int)((unsigned)width >> 30) : (iswprint(wc) ? 1 : -1));
}


x86 assembly (clang, -O0):
<wcwidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <wcwidth+0x21>
movl   $0x0,-0x4(%rbp)
jmp    118e <wcwidth+0x6e>
mov    -0x8(%rbp),%edi
mov    $0xe0000000,%esi
call   1040 <__maskrune@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1169 <wcwidth+0x49>
mov    -0xc(%rbp),%eax
shr    $0x1e,%eax
mov    %eax,-0x10(%rbp)
jmp    1188 <wcwidth+0x68>
mov    -0x8(%rbp),%edi
call   1030 <iswprint@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcwidth>:
push   %rbx
test   %edi,%edi
je     113a <wcwidth+0x1a>
mov    %edi,%ebx
mov    $0xe0000000,%esi
call   1040 <__maskrune@plt>
test   %eax,%eax
je     113e <wcwidth+0x1e>
shr    $0x1e,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <iswprint@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @wcwidth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %24
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @__maskrune(i32 %9, i32 -536870912)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %4
%15 = lshr i32 %14, 30
br label %22
16: ; preds = %8
%17 = load i32, i32* %3
%18 = call i64 @iswprint(i32 %17)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 1, i32 -1
br label %22
22: ; preds = %16, %13
%23 = phi i32 [ %15, %13 ], [ %21, %16 ]
store i32 %23, i32* %2
br label %24
24: ; preds = %22, %7
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @wcwidth(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = tail call i32 @__maskrune(i32 %0, i32 -536870912)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = lshr i32 %4, 30
br label %12
8: ; preds = %3
%9 = tail call i64 @iswprint(i32 %0)
%10 = icmp eq i64 %9, 0
%11 = select i1 %10, i32 -1, i32 1
br label %12
12: ; preds = %6, %8, %1
%13 = phi i32 [ 0, %1 ], [ %7, %6 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void error_print(char *arr) {
  fprintf(stderr,
          "\n%s reads intensity distribution and outputs the same negative\n",
          arr);
  fprintf(
      stderr,
      "\nUSAGE: %s  K < int_in > int_out \nwhere K is coefficient to multiply "
      "the negated intensity, may be\nnecessary to scale the distribution.\n\n",
      arr);
}


x86 assembly (clang, -O0):
<error_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error_print>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ec2(%rip),%r14
mov    (%r14),%edi
lea    0xed8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf06(%rip),%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [64 x i8] c"\0A%s reads intensity distribution and outputs the same negative\0A\00"
@.str.1 = [138 x i8] c"\0AUSAGE: %s K < int_in > int_out \0Awhere K is coefficient to multiply the negated intensity, may be\0Anecessary to scale the distribution.\0A\0A\00"
define void @error_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [64 x i8] c"\0A%s reads intensity distribution and outputs the same negative\0A\00"
@.str.1 = [138 x i8] c"\0AUSAGE: %s K < int_in > int_out \0Awhere K is coefficient to multiply the negated intensity, may be\0Anecessary to scale the distribution.\0A\0A\00"
define void @error_print(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([138 x i8], [138 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ switch_off_bits(unsigned char *, int);
void CTRL_REGSB_BITSET_mwup_disb(unsigned char *data) {
  switch_off_bits(data, (0x04));
}


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

x86 assembly (clang, -O2):
<CTRL_REGSB_BITSET_mwup_disb>:
mov    $0x4,%esi
jmp    1030 <switch_off_bits@plt>

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

LLVM IR (-O2):
define void @CTRL_REGSB_BITSET_mwup_disb(i8* %0) {
%2 = tail call i32 @switch_off_bits(i8* %0, i32 4)
ret void
}
void down_strange_bottom_quarks(void) {
  int __attribute__((unused)) down;
  int __attribute__((unused)) strange;
  int __attribute__((unused)) bottom;
}


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

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

LLVM IR (-O0):
define void @down_strange_bottom_quarks() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
ret void
}

LLVM IR (-O2):
define void @down_strange_bottom_quarks() {
ret void
}
/* Variables and functions */
double exp(double);
int pow(double, int);
double rho(double r) {
  return ((1.392302 * exp(-3.702623 * (r / 2.886166 - 1.))) /
          (1. + pow(r / 2.886166 - 0.790264, 20.)));
}


x86 assembly (clang, -O0):
<rho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xed6(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeb2(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe94(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe80(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x14,%edi
call   1040 <pow@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
movsd  0xe59(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rho>:
sub    $0x18,%rsp
movapd %xmm0,%xmm1
divsd  0xed0(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
mulsd  0xec6(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec1(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0xeb5(%rip),%xmm0
mov    $0x14,%edi
call   1040 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xea4(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
divsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rho(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 0x400716DE33269DF9
%5 = fsub double %4, 1.000000e+00
%6 = fmul double 0xC00D9EF8CEB356DA, %5
%7 = call double @exp(double %6)
%8 = fmul double 0x3FF646DE76427C7C, %7
%9 = load double, double* %2
%10 = fdiv double %9, 0x400716DE33269DF9
%11 = fsub double %10, 7.902640e-01
%12 = call i32 @pow(double %11, i32 20)
%13 = sitofp i32 %12 to double
%14 = fadd double 1.000000e+00, %13
%15 = fdiv double %8, %14
ret double %15
}

LLVM IR (-O2):
define double @rho(double %0) {
%2 = fdiv double %0, 0x400716DE33269DF9
%3 = fadd double %2, -1.000000e+00
%4 = fmul double %3, 0xC00D9EF8CEB356DA
%5 = tail call double @exp(double %4)
%6 = fmul double %5, 0x3FF646DE76427C7C
%7 = fadd double %2, -7.902640e-01
%8 = tail call i32 @pow(double %7, i32 20)
%9 = sitofp i32 %8 to double
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %6, %10
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
main() {
  printf("Sleep has started.\r\n");
  sleep(3600 * 24 * 28);
  printf("I have awoken from my long, long, long slumber, finally!!!");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x24ea00,%edi
call   1040 <sleep@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
mov    $0x24ea00,%edi
call   1050 <sleep@plt>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Sleep has started.\0D\0A\00"
@.str.1 = [59 x i8] c"I have awoken from my long, long, long slumber, finally!!!\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sleep(i32 2419200)
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [59 x i8] c"I have awoken from my long, long, long slumber, finally!!!\00"
@str = [20 x i8] c"Sleep has started.\0D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep(i32 2419200)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void f18a_killterm(void) { endwin(); }


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

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

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

LLVM IR (-O2):
define void @f18a_killterm() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, int);
void unaryOps() {
  printf("-%g = %g\n", 1.1, -1.1);
  printf("!%g = %d\n", 1.2, !1.2);
  printf("!%g = %d\n", 0.0, !0.0);
}


x86 assembly (clang, -O0):
<unaryOps>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rdi
movsd  0xee5(%rip),%xmm0
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
movsd  0xec4(%rip),%xmm0
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
xorps  %xmm0,%xmm0
mov    $0x1,%esi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<unaryOps>:
push   %rbx
lea    0xef8(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xee9(%rip),%rbx
movsd  0xecf(%rip),%xmm0
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"-%g = %g\0A\00"
@.str.1 = [10 x i8] c"!%g = %d\0A\00"
define void @unaryOps() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 1.100000e+00, i32 -1)
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 1.200000e+00, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"-%g = %g\0A\00"
@.str.1 = [10 x i8] c"!%g = %d\0A\00"
define void @unaryOps() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double 1.100000e+00, i32 -1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 1.200000e+00, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_mounts();
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ run_process(char *);
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  puts("Mounting...");
  do_mounts();
  run_process("/virt/init_stage2");
  printf("Init failed: %s\n", strerror(errno));
  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)
lea    0xe93(%rip),%rdi
call   1040 <puts@plt>
mov    $0x0,%al
call   1050 <do_mounts@plt>
lea    0xe8c(%rip),%rdi
call   1030 <run_process@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
mov    %rax,%rsi
lea    0xe81(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <do_mounts@plt>
lea    0xea1(%rip),%rdi
call   1030 <run_process@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
call   1070 <strerror@plt>
lea    0xe99(%rip),%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Mounting...\00"
@.str.1 = [18 x i8] c"/virt/init_stage2\00"
@.str.2 = [17 x i8] c"Init failed: %s\0A\00"
@errno = global i32 0
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 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @do_mounts()
%8 = call i32 @run_process(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Mounting...\00"
@.str.1 = [18 x i8] c"/virt/init_stage2\00"
@.str.2 = [17 x i8] c"Init failed: %s\0A\00"
@errno = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @do_mounts()
%5 = tail call i32 @run_process(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %7)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read_24u(const uint8_t *src) {
  uint32_t b0 = ((uint32_t)src[0]) << 16;
  uint32_t b1 = ((uint32_t)src[1]) << 8;
  uint32_t b2 = ((uint32_t)src[2]);
  return (b0 | b1 | b2);
}


x86 assembly (clang, -O0):
<read_24u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_24u>:
mov    (%rdi),%ecx
mov    0x8(%rdi),%eax
shl    $0x10,%ecx
shl    $0x8,%eax
or     %ecx,%eax
or     0x10(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_24u(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 16
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = or i32 %8, %4
%13 = or i32 %12, %11
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __syscall_exit(int);
void _exit(int status) { __syscall_exit(status); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <__syscall_exit@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
call   1030 <__syscall_exit@plt>

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

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @__syscall_exit(i32 %0)
unreachable
}
int test_imm_FAuint32_reg(unsigned int val) {
  return ((val) & (0xFA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FAuint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 250
%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_FAuint32_reg(i32 %0) {
%2 = and i32 %0, 250
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long gcd(long a, long b) {
  long c;
  while (b) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <gcd+0x3a>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int /*<<< orphan*/ f2(int);
int /*<<< orphan*/ f3(int);
int /*<<< orphan*/ f4(unsigned int);
int main() {
  f1(10);
  f2(-10);
  f3(10);
  f4(-10U);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1050 <f1@plt>
mov    $0xfffffff6,%edi
call   1030 <f2@plt>
mov    $0xa,%edi
call   1040 <f3@plt>
mov    $0xfffffff6,%edi
call   1060 <f4@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1050 <f1@plt>
mov    $0xfffffff6,%edi
call   1030 <f2@plt>
mov    $0xa,%edi
call   1040 <f3@plt>
mov    $0xfffffff6,%edi
call   1060 <f4@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 10)
%3 = call i32 @f2(i32 -10)
%4 = call i32 @f3(i32 10)
%5 = call i32 @f4(i32 -10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 10)
%2 = tail call i32 @f2(i32 -10)
%3 = tail call i32 @f3(i32 10)
%4 = tail call i32 @f4(i32 -10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
char *uint32_ntoa_r(int /*<<< orphan*/, char *, int);
char *uint32_htoa_r(uint32_t h_addr, char *buf, int buf_len) {
  return (uint32_ntoa_r(htonl(h_addr), buf, buf_len));
}


x86 assembly (clang, -O0):
<uint32_htoa_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <htonl@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <uint32_ntoa_r@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_htoa_r>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <htonl@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <uint32_ntoa_r@plt>

LLVM IR (-O0):
define i8* @uint32_htoa_r(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @htonl(i32 %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @uint32_ntoa_r(i32 %8, i8* %9, i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @uint32_htoa_r(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @htonl(i32 %0)
%5 = tail call i8* @uint32_ntoa_r(i32 %4, i8* %1, i32 %2)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void tenStar() {
  int i;
  for (i = 0; i < 10; i++) {
    printf("*");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<tenStar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1143 <tenStar+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <tenStar+0xf>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tenStar>:
push   %rax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @tenStar() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @tenStar() {
%1 = tail call i32 @putchar(i32 42)
%2 = tail call i32 @putchar(i32 42)
%3 = tail call i32 @putchar(i32 42)
%4 = tail call i32 @putchar(i32 42)
%5 = tail call i32 @putchar(i32 42)
%6 = tail call i32 @putchar(i32 42)
%7 = tail call i32 @putchar(i32 42)
%8 = tail call i32 @putchar(i32 42)
%9 = tail call i32 @putchar(i32 42)
%10 = tail call i32 @putchar(i32 42)
%11 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test1111(int p) {
  int l = 53;
  if (p) {
    if ((67 + l - 25) != 95)
      link_error();
  } else {
    if ((93 - l + 25) != 65)
      link_error();
  }
}


x86 assembly (clang, -O0):
<test1111>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x35,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114a <test1111+0x3a>
mov    -0x8(%rbp),%eax
add    $0x43,%eax
sub    $0x19,%eax
cmp    $0x5f,%eax
je     1145 <test1111+0x35>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    116a <test1111+0x5a>
mov    $0x5d,%eax
sub    -0x8(%rbp),%eax
add    $0x19,%eax
cmp    $0x41,%eax
je     1165 <test1111+0x55>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    116a <test1111+0x5a>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1111(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 53, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 67, %7
%9 = sub nsw i32 %8, 25
%10 = icmp ne i32 %9, 95
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 (...) @link_error()
br label %13
13: ; preds = %11, %6
br label %22
14: ; preds = %1
%15 = load i32, i32* %3
%16 = sub nsw i32 93, %15
%17 = add nsw i32 %16, 25
%18 = icmp ne i32 %17, 65
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = call i32 (...) @link_error()
br label %21
21: ; preds = %19, %14
br label %22
22: ; preds = %21, %13
ret void
}

LLVM IR (-O2):
define void @test1111(i32 %0) {
ret void
}
void EVP_PKEY_set1_EC_KEY(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_set1_EC_KEY() {
ret void
}
/* Variables and functions */
int anetTcpGenericConnect(char *, char *, int, int);
int anetTcpNonBlockConnect(char *err, char *addr, int port) {
  return anetTcpGenericConnect(err, addr, port, 1);
}


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

x86 assembly (clang, -O2):
<anetTcpNonBlockConnect>:
mov    $0x1,%ecx
jmp    1030 <anetTcpGenericConnect@plt>

LLVM IR (-O0):
define i32 @anetTcpNonBlockConnect(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @anetTcpGenericConnect(i8* %7, i8* %8, i32 %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @anetTcpNonBlockConnect(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @anetTcpGenericConnect(i8* %0, i8* %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int sock_op_put_fds(int sock_fd, int fds_num, const int *fds) { abort(); }


x86 assembly (clang, -O0):
<sock_op_put_fds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<sock_op_put_fds>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @sock_op_put_fds(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @sock_op_put_fds(i32 %0, i32 %1, i32* nocapture readnone %2) {
%4 = tail call i32 (...) @abort()
unreachable
}
int occampi_function_post_setup(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @occampi_function_post_setup() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arch_local_irq_save();
void arch_local_irq_disable(void) { arch_local_irq_save(); }


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

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

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

LLVM IR (-O2):
define void @arch_local_irq_disable() {
%1 = tail call i32 (...) @arch_local_irq_save()
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ xalloc_die();
void *xmalloc(size_t n) {
  void *p;
  p = malloc(n);
  if (p == 0 && n)
    xalloc_die();
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <xmalloc+0x36>
cmpq   $0x0,-0x8(%rbp)
je     1156 <xmalloc+0x36>
mov    $0x0,%al
call   1030 <xalloc_die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <xmalloc+0x20>
test   %r14,%r14
jne    1140 <xmalloc+0x20>
xor    %eax,%eax
call   1030 <xalloc_die@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i64, i64* %2
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @xalloc_die()
br label %13
13: ; preds = %11, %8, %1
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @xalloc_die()
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ acc_copyin(int *, int);
int /*<<< orphan*/ acc_present_or_copyin(int *, int);
int main(int argc, char *argv[]) {
  int i;
  acc_present_or_copyin(&i, sizeof i);
  acc_copyin(&i, sizeof i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1040 <acc_present_or_copyin@plt>
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
call   1030 <acc_copyin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <acc_present_or_copyin@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <acc_copyin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @acc_present_or_copyin(i32* %3, i32 4)
%6 = call i32 @acc_copyin(i32* %3, i32 4)
ret i32 0
}