xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isr_unhandled();
void dummy_handler(void) { isr_unhandled(); }


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

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

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

LLVM IR (-O2):
define void @dummy_handler() {
%1 = tail call i32 (...) @isr_unhandled()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void finish(int sig) { exit(0); }


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

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

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

LLVM IR (-O2):
define void @finish(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
int SafeMod(int a, int n) {
  int r = a % n;
  return (r >= 0) ? r : n + r;
}


x86 assembly (clang, -O0):
<SafeMod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1129 <SafeMod+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <SafeMod+0x32>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SafeMod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @SafeMod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sendByte(int);
void sendLEDFrame(int brightness, int r, int g, int b) {
  sendByte(224 | brightness);
  sendByte(b);
  sendByte(g);
  sendByte(r);
}


x86 assembly (clang, -O0):
<sendLEDFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
or     $0xe0,%edi
call   1030 <sendByte@plt>
mov    -0x10(%rbp),%edi
call   1030 <sendByte@plt>
mov    -0xc(%rbp),%edi
call   1030 <sendByte@plt>
mov    -0x8(%rbp),%edi
call   1030 <sendByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendLEDFrame>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %esi,%r14d
or     $0xe0,%edi
call   1030 <sendByte@plt>
mov    %ebx,%edi
call   1030 <sendByte@plt>
mov    %ebp,%edi
call   1030 <sendByte@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sendByte@plt>

LLVM IR (-O0):
define void @sendLEDFrame(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = or i32 224, %9
%11 = call i32 @sendByte(i32 %10)
%12 = load i32, i32* %8
%13 = call i32 @sendByte(i32 %12)
%14 = load i32, i32* %7
%15 = call i32 @sendByte(i32 %14)
%16 = load i32, i32* %6
%17 = call i32 @sendByte(i32 %16)
ret void
}

LLVM IR (-O2):
define void @sendLEDFrame(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = or i32 %0, 224
%6 = tail call i32 @sendByte(i32 %5)
%7 = tail call i32 @sendByte(i32 %3)
%8 = tail call i32 @sendByte(i32 %2)
%9 = tail call i32 @sendByte(i32 %1)
ret void
}
/* Variables and functions */
char *fatfs_getcwd(char *, size_t);
char *getcwd(char *buf, size_t size) { return fatfs_getcwd(buf, size); }


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

x86 assembly (clang, -O2):
<getcwd>:
jmp    1030 <fatfs_getcwd@plt>

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

LLVM IR (-O2):
define i8* @getcwd(i8* %0, i64 %1) {
%3 = tail call i8* @fatfs_getcwd(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int syscall(int, char const *, char const *);
int lremovexattr(const char *path, const char *name) {
  return syscall(236, path, name);
}


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

x86 assembly (clang, -O2):
<lremovexattr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xec,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @lremovexattr(i8* %0, i8* %1) {
%3 = tail call i32 @syscall(i32 236, i8* %0, i8* %1)
ret i32 %3
}
int test_imm_01int16_mem(short *val) {
  return ((*val) & (0x01 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_01int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_01int16_mem>:
testb  $0x1,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_01int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 1
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float LJUSB_GetLibraryVersion() { return 1.10; }


x86 assembly (clang, -O0):
<LJUSB_GetLibraryVersion>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LJUSB_GetLibraryVersion>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @LJUSB_GetLibraryVersion() {
ret float 0x3FF19999A0000000
}

LLVM IR (-O2):
define float @LJUSB_GetLibraryVersion() {
ret float 0x3FF19999A0000000
}
void XtAddExposureToRegion() {}


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

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

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

LLVM IR (-O2):
define void @XtAddExposureToRegion() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_doublevector(double *v, int nl, int nh) { free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_doublevector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_doublevector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_doublevector(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load double*, double** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds double, double* %7, i64 %9
%11 = bitcast double* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_doublevector(double* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double, double* %0, i64 %4
%6 = bitcast double* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Type definitions */
typedef int time_t;

/* Variables and functions */
time_t time(time_t *t) {
  if (t) {
    *t = 1131148800;
  }
  return 1131148800;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111d <time+0x1d>
mov    -0x8(%rbp),%rax
movl   $0x436bf600,(%rax)
mov    $0x436bf600,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
test   %rdi,%rdi
je     110b <time+0xb>
movl   $0x436bf600,(%rdi)
mov    $0x436bf600,%eax
ret

LLVM IR (-O0):
define i32 @time(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32*, i32** %2
store i32 1131148800, i32* %6
br label %7
7: ; preds = %5, %1
ret i32 1131148800
}

LLVM IR (-O2):
define i32 @time(i32* writeonly %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
store i32 1131148800, i32* %0
br label %4
4: ; preds = %3, %1
ret i32 1131148800
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    return (c + ' ');
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <ft_tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <ft_tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void Steam_RegisterInterfaceFuncs(void *hModule) {
  xlogf("%s(hModule = %p)\n", __func__, hModule);
}


x86 assembly (clang, -O0):
<Steam_RegisterInterfaceFuncs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee4(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Steam_RegisterInterfaceFuncs>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s(hModule = %p)\0A\00"
@__func__.Steam_RegisterInterfaceFuncs = [29 x i8] c"Steam_RegisterInterfaceFuncs\00"
define void @Steam_RegisterInterfaceFuncs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.Steam_RegisterInterfaceFuncs, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s(hModule = %p)\0A\00"
@__func__.Steam_RegisterInterfaceFuncs = [29 x i8] c"Steam_RegisterInterfaceFuncs\00"
define void @Steam_RegisterInterfaceFuncs(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @__func__.Steam_RegisterInterfaceFuncs, i64 0, i64 0), i8* %0)
ret void
}
int compare(const void *a, const void *b) {
  int *x = (int *)a;
  int *y = (int *)b;
  return *y - *x;
}


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_SET_UD_PIN() { set_io_bit(0x34, 1); }


x86 assembly (clang, -O0):
<TOSH_SET_UD_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x34,%edi
mov    $0x1,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_UD_PIN>:
mov    $0x34,%edi
mov    $0x1,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_UD_PIN() {
%1 = call i32 @set_io_bit(i32 52, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_UD_PIN() {
%1 = tail call i32 @set_io_bit(i32 52, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ CLOCKS_PER_SEC;
__attribute__((always_)) uint32_t
host_get_clocks_per_second_profiling_timer(void) {
  return CLOCKS_PER_SEC;
}


x86 assembly (clang, -O0):
<host_get_clocks_per_second_profiling_timer>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_get_clocks_per_second_profiling_timer>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define i32 @host_get_clocks_per_second_profiling_timer() {
%1 = load i32, i32* @CLOCKS_PER_SEC
ret i32 %1
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define i32 @host_get_clocks_per_second_profiling_timer() {
%1 = load i32, i32* @CLOCKS_PER_SEC
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void not_found(char *script_name) {
  char *title = "404 Not Found";
  (void)printf("Status: %s\nContent-type: "
               "text/html\n\n<HTML><HEAD><TITLE>%s</TITLE></"
               "HEAD>\n<BODY><H2>%s</H2>\nThe requested filename, %s, is set "
               "up to be redirected to another URL;\nhowever, the new URL has "
               "not yet been specified.\n</BODY></HTML>\n",
               title, title, title, script_name);
}


x86 assembly (clang, -O0):
<not_found>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_found>:
mov    %rdi,%r8
lea    0xef4(%rip),%rdi
lea    0xedf(%rip),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"404 Not Found\00"
@.str.1 = [227 x i8] c"Status: %s\0AContent-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0AThe requested filename, %s, is set up to be redirected to another URL;\0Ahowever, the new URL has not yet been specified.\0A</BODY></HTML>\0A\00"
define void @not_found(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str.1, i64 0, i64 0), i8* %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"404 Not Found\00"
@.str.1 = [227 x i8] c"Status: %s\0AContent-type: text/html\0A\0A<HTML><HEAD><TITLE>%s</TITLE></HEAD>\0A<BODY><H2>%s</H2>\0AThe requested filename, %s, is set up to be redirected to another URL;\0Ahowever, the new URL has not yet been specified.\0A</BODY></HTML>\0A\00"
define void @not_found(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int comp(char **, char **, int);
int main() {
  char a[2][2];
  a[0][0] = 'a';
  a[0][1] = 'b';
  a[1][0] = 'g';
  a[1][1] = 'b';
  assert(comp(&a[0], &a[1], 2) == -1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x4(%rbp)
movb   $0x62,-0x3(%rbp)
movb   $0x67,-0x2(%rbp)
movb   $0x62,-0x1(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x4(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1030 <comp@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x62676261,0x4(%rsp)
62
lea    0x6(%rsp),%rsi
lea    0x4(%rsp),%rdi
mov    $0x2,%edx
call   1030 <comp@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [2 x [2 x i8]]
%2 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 98, i8* %5
%6 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %6, i64 0, i64 0
store i8 103, i8* %7
%8 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 1
store i8 98, i8* %9
%10 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0
%11 = bitcast [2 x i8]* %10 to i8**
%12 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%13 = bitcast [2 x i8]* %12 to i8**
%14 = call i32 @comp(i8** %11, i8** %13, i32 2)
%15 = icmp eq i32 %14, -1
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [2 x [2 x i8]]
%2 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0, i64 0
store i8 97, i8* %2
%3 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 0, i64 1
store i8 98, i8* %3
%4 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 103, i8* %5
%6 = getelementptr inbounds [2 x [2 x i8]], [2 x [2 x i8]]* %1, i64 0, i64 1, i64 1
store i8 98, i8* %6
%7 = bitcast [2 x [2 x i8]]* %1 to i8**
%8 = bitcast [2 x i8]* %4 to i8**
%9 = call i32 @comp(i8** %7, i8** %8, i32 2)
%10 = icmp eq i32 %9, -1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}
/* Variables and functions */
int M_PI;
double fmod(double, int);
double range_radians(double r) {
  r = fmod(r, 2. * M_PI);
  if (r < 0.)
    r += 2. * M_PI;
  return r;
}


x86 assembly (clang, -O0):
<range_radians>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
cvtsi2sdl (%rax),%xmm2
movsd  0xecb(%rip),%xmm1
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <fmod@plt>
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1172 <range_radians+0x62>
mov    0x2e8c(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<range_radians>:
push   %rbx
mov    0x2ed0(%rip),%rbx
cvtsi2sdl (%rbx),%xmm1
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <fmod@plt>
cvtsi2sdl (%rbx),%xmm2
addsd  %xmm2,%xmm2
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
movapd %xmm1,%xmm3
andnpd %xmm0,%xmm3
andpd  %xmm2,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @range_radians(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @M_PI
%5 = sitofp i32 %4 to double
%6 = fmul double 2.000000e+00, %5
%7 = fptosi double %6 to i32
%8 = call double @fmod(double %3, i32 %7)
store double %8, double* %2
%9 = load double, double* %2
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i32, i32* @M_PI
%13 = sitofp i32 %12 to double
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %13, double %14)
store double %15, double* %2
br label %16
16: ; preds = %11, %1
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @range_radians(double %0) {
%2 = load i32, i32* @M_PI
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 2.000000e+00
%5 = fptosi double %4 to i32
%6 = tail call double @fmod(double %0, i32 %5)
%7 = fcmp olt double %6, 0.000000e+00
%8 = load i32, i32* @M_PI
%9 = sitofp i32 %8 to double
%10 = tail call double @llvm.fmuladd.f64(double %9, double 2.000000e+00, double %6)
%11 = select i1 %7, double %10, double %6
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ findLastString(char *, char *);
int /*<<< orphan*/ test(int /*<<< orphan*/, int);
void testFindLastString(void) {
  test(findLastString("abr", "abracadabra"), 7);
  test(findLastString("xxx", "abracadabra"), -1);
}


x86 assembly (clang, -O0):
<testFindLastString>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <findLastString@plt>
mov    %eax,%edi
mov    $0x7,%esi
call   1040 <test@plt>
lea    0xec6(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1030 <findLastString@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
call   1040 <test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFindLastString>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rbx
mov    %rbx,%rsi
call   1030 <findLastString@plt>
mov    %eax,%edi
mov    $0x7,%esi
call   1040 <test@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <findLastString@plt>
mov    %eax,%edi
mov    $0xffffffff,%esi
pop    %rbx
jmp    1040 <test@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abr\00"
@.str.1 = [12 x i8] c"abracadabra\00"
@.str.2 = [4 x i8] c"xxx\00"
define void @testFindLastString() {
%1 = call i32 @findLastString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test(i32 %1, i32 7)
%3 = call i32 @findLastString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @test(i32 %3, i32 -1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abr\00"
@.str.1 = [12 x i8] c"abracadabra\00"
@.str.2 = [4 x i8] c"xxx\00"
define void @testFindLastString() {
%1 = tail call i32 @findLastString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test(i32 %1, i32 7)
%3 = tail call i32 @findLastString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @test(i32 %3, i32 -1)
ret void
}
int lt(int x, int y) { return x < y; }


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
xor    %eax,%eax
cmp    %esi,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @lt(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 = icmp slt i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lt(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assertStringEqual(char *, char *);
int /*<<< orphan*/ mfree(char *);
char *mmalloc(size_t);
char *mrealloc(char *, size_t);
int /*<<< orphan*/ strcpy(char *, char *);
void testReallocPreserveData(void) {
  size_t s1 = 6, s2 = 32;
  char *ptr = mmalloc(s1);
  strcpy(ptr, "hello");
  ptr = mrealloc(ptr, s2);
  assertStringEqual("hello", ptr);
  mfree(ptr);
}


x86 assembly (clang, -O0):
<testReallocPreserveData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x6,-0x8(%rbp)
movq   $0x20,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <mmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mrealloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe5f(%rip),%rdi
call   1050 <assertStringEqual@plt>
mov    -0x18(%rbp),%rdi
call   1070 <mfree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testReallocPreserveData>:
push   %r14
push   %rbx
push   %rax
mov    $0x6,%edi
call   1060 <mmalloc@plt>
mov    %rax,%rbx
lea    0xe98(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    $0x20,%esi
mov    %rbx,%rdi
call   1040 <mrealloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <assertStringEqual@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <mfree@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define void @testReallocPreserveData() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i8*
store i64 6, i64* %1
store i64 32, i64* %2
%4 = load i64, i64* %1
%5 = call i8* @mmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = load i64, i64* %2
%10 = call i8* @mrealloc(i8* %8, i64 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i32 @assertStringEqual(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @mfree(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define void @testReallocPreserveData() {
%1 = tail call i8* @mmalloc(i64 6)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @mrealloc(i8* %1, i64 32)
%4 = tail call i32 @assertStringEqual(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @mfree(i8* %3)
ret void
}
/* Type definitions */
typedef double time_t;
typedef scalar_t__ suseconds_t;
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
scalar_t__ floor(double);
struct timeval wi_dtotv(double d) {
  struct timeval tv;
  tv.tv_sec = (time_t)floor(d);
  tv.tv_usec = (suseconds_t)((d - tv.tv_sec) * 1000000.0);
  return tv;
}


x86 assembly (clang, -O0):
<wi_dtotv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <floor@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wi_dtotv>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xecc(%rip),%xmm1
cvttsd2si %xmm1,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define { double, i64 } @wi_dtotv(double %0) {
%2 = alloca %struct.timeval
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call i64 @floor(double %4)
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store double %6, double* %7
%8 = load double, double* %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = fmul double %11, 1.000000e+06
%13 = fptosi double %12 to i64
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %13, i64* %14
%15 = bitcast %struct.timeval* %2 to { double, i64 }*
%16 = load { double, i64 }, { double, i64 }* %15
ret { double, i64 } %16
}

LLVM IR (-O2):
define { double, i64 } @wi_dtotv(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = sitofp i64 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+06
%6 = fptosi double %5 to i64
%7 = insertvalue { double, i64 } poison, double %3, 0
%8 = insertvalue { double, i64 } %7, i64 %6, 1
ret { double, i64 } %8
}
/* Variables and functions */
double cephes_j1f(double);
double sas_2J1x_x(double x) {
  return (x != 0.0) ? 2.0 * cephes_j1f(x) / x : 1.0;
}


x86 assembly (clang, -O0):
<sas_2J1x_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113a <sas_2J1x_x+0x2a>
jp     113a <sas_2J1x_x+0x2a>
jmp    1162 <sas_2J1x_x+0x52>
movsd  -0x8(%rbp),%xmm0
call   1030 <cephes_j1f@plt>
movaps %xmm0,%xmm1
movsd  0xeb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <sas_2J1x_x+0x64>
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1174 <sas_2J1x_x+0x64>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_2J1x_x>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    111d <sas_2J1x_x+0xd>
jnp    1132 <sas_2J1x_x+0x22>
movsd  %xmm0,(%rsp)
call   1030 <cephes_j1f@plt>
addsd  %xmm0,%xmm0
divsd  (%rsp),%xmm0
pop    %rax
ret
movsd  0xec6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sas_2J1x_x(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp une double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load double, double* %2
%7 = call double @cephes_j1f(double %6)
%8 = fmul double 2.000000e+00, %7
%9 = load double, double* %2
%10 = fdiv double %8, %9
br label %12
11: ; preds = %1
br label %12
12: ; preds = %11, %5
%13 = phi double [ %10, %5 ], [ 1.000000e+00, %11 ]
ret double %13
}

LLVM IR (-O2):
define double @sas_2J1x_x(double %0) {
%2 = fcmp une double %0, 0.000000e+00
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call double @cephes_j1f(double %0)
%5 = fmul double %4, 2.000000e+00
%6 = fdiv double %5, %0
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
void g_string_chunk_new() {}


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

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

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

LLVM IR (-O2):
define void @g_string_chunk_new() {
ret void
}
void DMTimerTriggerSet(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x44)))) = (0xFFFFFFFFu);
}


x86 assembly (clang, -O0):
<DMTimerTriggerSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x44,%eax
mov    %eax,%eax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<DMTimerTriggerSet>:
add    $0x44,%edi
movl   $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @DMTimerTriggerSet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 68
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 -1, i32* %6
ret void
}

LLVM IR (-O2):
define void @DMTimerTriggerSet(i32 %0) {
%2 = add i32 %0, 68
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 -1, i32* %4
ret void
}
/* Variables and functions */
int jvp_utf8_encode_length(int codepoint) {
  if (codepoint <= 0x7F)
    return 1;
  else if (codepoint <= 0x7FF)
    return 2;
  else if (codepoint <= 0xFFFF)
    return 3;
  else
    return 4;
}


x86 assembly (clang, -O0):
<jvp_utf8_encode_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jg     111d <jvp_utf8_encode_length+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1156 <jvp_utf8_encode_length+0x56>
cmpl   $0x7ff,-0x8(%rbp)
jg     1136 <jvp_utf8_encode_length+0x36>
movl   $0x2,-0x4(%rbp)
jmp    1156 <jvp_utf8_encode_length+0x56>
cmpl   $0xffff,-0x8(%rbp)
jg     114f <jvp_utf8_encode_length+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    1156 <jvp_utf8_encode_length+0x56>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jvp_utf8_encode_length>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1128 <jvp_utf8_encode_length+0x28>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1128 <jvp_utf8_encode_length+0x28>
cmp    $0x10000,%edi
mov    $0x4,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @jvp_utf8_encode_length(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
%7 = select i1 %6, i32 3, i32 4
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ c_nngetsloped(int, int, double *, int *);
void nngetsloped_(int *row, int *col, double *slope, int *ier) {
  c_nngetsloped(*row - 1, *col - 1, slope, ier);
}


x86 assembly (clang, -O0):
<nngetsloped_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
sub    $0x1,%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <c_nngetsloped@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nngetsloped_>:
mov    (%rdi),%edi
add    $0xffffffff,%edi
mov    (%rsi),%esi
add    $0xffffffff,%esi
jmp    1030 <c_nngetsloped@plt>

LLVM IR (-O0):
define void @nngetsloped_(i32* %0, i32* %1, double* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store double* %2, double** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = sub nsw i32 %10, 1
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = sub nsw i32 %13, 1
%15 = load double*, double** %7
%16 = load i32*, i32** %8
%17 = call i32 @c_nngetsloped(i32 %11, i32 %14, double* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @nngetsloped_(i32* nocapture %0, i32* nocapture %1, double* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = add nsw i32 %5, -1
%7 = load i32, i32* %1
%8 = add nsw i32 %7, -1
%9 = tail call i32 @c_nngetsloped(i32 %6, i32 %8, double* %2, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_json(int /*<<< orphan*/, char **, char **);
int /*<<< orphan*/ read_native_message();
void get_tick() {
  char *key;
  char *val;
  parse_json(read_native_message(), &key, &val);
}


x86 assembly (clang, -O0):
<get_tick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_native_message@plt>
mov    %eax,%edi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <parse_json@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tick>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1030 <read_native_message@plt>
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %eax,%edi
call   1040 <parse_json@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @get_tick() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i32 (...) @read_native_message()
%4 = call i32 @parse_json(i32 %3, i8** %1, i8** %2)
ret void
}

LLVM IR (-O2):
define void @get_tick() {
%1 = alloca i8*
%2 = alloca i8*
%3 = bitcast i8** %1 to i8*
%4 = bitcast i8** %2 to i8*
%5 = tail call i32 (...) @read_native_message()
%6 = call i32 @parse_json(i32 %5, i8** %1, i8** %2)
ret void
}
/* Variables and functions */
int mock_wait_for_call_num_higher_than(char const *, int /*<<< orphan*/, int);
int mock_wait_to_be_called(const char *fnc, int timeout) {
  return mock_wait_for_call_num_higher_than(fnc, 0, timeout);
}


x86 assembly (clang, -O0):
<mock_wait_to_be_called>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <mock_wait_for_call_num_higher_than@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mock_wait_to_be_called>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <mock_wait_for_call_num_higher_than@plt>

LLVM IR (-O0):
define i32 @mock_wait_to_be_called(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 = load i32, i32* %4
%7 = call i32 @mock_wait_for_call_num_higher_than(i8* %5, i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mock_wait_to_be_called(i8* %0, i32 %1) {
%3 = tail call i32 @mock_wait_for_call_num_higher_than(i8* %0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void aCFunctionWithContext(void *ctx, void (*function)(void *ctx)) {
  sleep(3);
  function(ctx);
}


x86 assembly (clang, -O0):
<aCFunctionWithContext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
call   1030 <sleep@plt>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aCFunctionWithContext>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x3,%edi
call   1030 <sleep@plt>
mov    %rbx,%rdi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

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

LLVM IR (-O2):
define void @aCFunctionWithContext(i8* %0, void (i8*)* nocapture %1) {
%3 = tail call i32 @sleep(i32 3)
tail call void %1(i8* %0)
ret void
}
int do_086() { return 86; }


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

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

LLVM IR (-O0):
define i32 @do_086() {
ret i32 86
}

LLVM IR (-O2):
define i32 @do_086() {
ret i32 86
}
/* Variables and functions */
long _test_and_set(int *, int);
__attribute__((always_)) long int testandset(int *spinlock) {
  return _test_and_set(spinlock, 1);
}


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

x86 assembly (clang, -O2):
<testandset>:
mov    $0x1,%esi
jmp    1030 <_test_and_set@plt>

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

LLVM IR (-O2):
define i64 @testandset(i32* %0) {
%2 = tail call i64 @_test_and_set(i32* %0, i32 1)
ret i64 %2
}
/* Variables and functions */
int sum_proper_divisors(int);
bool is_abundant(int n) { return n > 1 && sum_proper_divisors(n) > n; }


x86 assembly (clang, -O0):
<is_abundant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113b <is_abundant+0x2b>
mov    -0x4(%rbp),%edi
call   1030 <sum_proper_divisors@plt>
cmp    -0x4(%rbp),%eax
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_abundant>:
xor    %eax,%eax
cmp    $0x2,%edi
jl     1129 <is_abundant+0x19>
push   %rbx
mov    %edi,%ebx
call   1030 <sum_proper_divisors@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setg   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_abundant(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @sum_proper_divisors(i32 %6)
%8 = load i32, i32* %2
%9 = icmp sgt i32 %7, %8
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_abundant(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @sum_proper_divisors(i32 %0)
%5 = icmp sgt i32 %4, %0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int __nv_finitef(float);
int __finitef(float __a) { return __nv_finitef(__a); }


x86 assembly (clang, -O0):
<__finitef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__nv_finitef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__finitef>:
jmp    1030 <__nv_finitef@plt>

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

LLVM IR (-O2):
define i32 @__finitef(float %0) {
%2 = tail call i32 @__nv_finitef(float %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void info() { printf("Simplex LP solver\n"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Simplex LP solver\0A\00"
define void @info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"Simplex LP solver\00"
define void @info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
float Sleef_copysignf(float x, float y) { return __builtin_copysignf(x, y); }


x86 assembly (clang, -O0):
<Sleef_copysignf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movaps 0xee1(%rip),%xmm2
pand   %xmm2,%xmm1
movaps 0xee6(%rip),%xmm2
pand   %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_copysignf>:
andps  0xef9(%rip),%xmm1
andps  0xf02(%rip),%xmm0
orps   %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Sleef_copysignf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @llvm.copysign.f32(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @Sleef_copysignf(float %0, float %1) {
%3 = tail call float @llvm.copysign.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
scalar_t__ drv_CW_poll();
int /*<<< orphan*/ drv_CW_process_input();
int /*<<< orphan*/ drv_generic_serial_write(char const *, int const);
int /*<<< orphan*/ usleep(int);
void drv_CW_send(const char *string, const int len) {
  drv_generic_serial_write(string, len);
  usleep(20);
  if (drv_CW_poll())
    drv_CW_process_input();
}


x86 assembly (clang, -O0):
<drv_CW_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <drv_generic_serial_write@plt>
mov    $0x14,%edi
call   1060 <usleep@plt>
mov    $0x0,%al
call   1040 <drv_CW_poll@plt>
cmp    $0x0,%rax
je     117d <drv_CW_send+0x3d>
mov    $0x0,%al
call   1030 <drv_CW_process_input@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drv_CW_send>:
push   %rax
call   1050 <drv_generic_serial_write@plt>
mov    $0x14,%edi
call   1060 <usleep@plt>
xor    %eax,%eax
call   1040 <drv_CW_poll@plt>
test   %rax,%rax
je     1164 <drv_CW_send+0x24>
xor    %eax,%eax
pop    %rcx
jmp    1030 <drv_CW_process_input@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @drv_CW_send(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 = load i32, i32* %4
%7 = call i32 @drv_generic_serial_write(i8* %5, i32 %6)
%8 = call i32 @usleep(i32 20)
%9 = call i64 (...) @drv_CW_poll()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @drv_CW_process_input()
br label %13
13: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @drv_CW_send(i8* %0, i32 %1) {
%3 = tail call i32 @drv_generic_serial_write(i8* %0, i32 %1)
%4 = tail call i32 @usleep(i32 20)
%5 = tail call i64 (...) @drv_CW_poll()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @drv_CW_process_input()
br label %9
9: ; preds = %7, %2
ret void
}
int prf_strlen(char *str) {
  int i;
  i = 0;
  while (str[i])
    ++i;
  return (i);
}


x86 assembly (clang, -O0):
<prf_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <prf_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <prf_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prf_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <prf_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @prf_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}