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

/* Variables and functions */
extern uint32_t WDT_GetPeriod(uint32_t dwMs) {
  if ((dwMs < 4) || (dwMs > 16000)) {
    return 0;
  }
  return ((dwMs << 8) / 1000);
}


x86 assembly (clang, -O0):
<WDT_GetPeriod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jl     111e <WDT_GetPeriod+0x1e>
cmpl   $0x3e80,-0x8(%rbp)
jle    112a <WDT_GetPeriod+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    113b <WDT_GetPeriod+0x3b>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<WDT_GetPeriod>:
lea    -0x3e81(%rdi),%ecx
xor    %eax,%eax
cmp    $0xffffc183,%ecx
jb     111e <WDT_GetPeriod+0x1e>
shl    $0x8,%edi
imul   $0x10624dd3,%rdi,%rax
shr    $0x26,%rax
ret

LLVM IR (-O0):
define i32 @WDT_GetPeriod(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 4
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 16000
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %14
10: ; preds = %6
%11 = load i32, i32* %3
%12 = shl i32 %11, 8
%13 = sdiv i32 %12, 1000
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @WDT_GetPeriod(i32 %0) {
%2 = add i32 %0, -16001
%3 = icmp ult i32 %2, -15997
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = shl nuw nsw i32 %0, 8
%6 = udiv i32 %5, 1000
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int ehnlc_strcmp(char const *, char const *);
int ehnlc_strcoll(const char *s1, const char *s2) {
  return ehnlc_strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<ehnlc_strcoll>:
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 <ehnlc_strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_strcoll>:
jmp    1030 <ehnlc_strcmp@plt>

LLVM IR (-O0):
define i32 @ehnlc_strcoll(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 @ehnlc_strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ehnlc_strcoll(i8* %0, i8* %1) {
%3 = tail call i32 @ehnlc_strcmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
void *fonction(void *inutile) {
  for (;;) {
    fprintf(stderr, "fonction()\n");
    sleep(1);
  }
  return NULL;
}


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

x86 assembly (clang, -O2):
<fonction>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%r14
lea    0xece(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
jmp    1140 <fonction+0x20>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"fonction()\0A\00"
define i8* @fonction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 1)
br label %3
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"fonction()\0A\00"
define noalias i8* @fonction(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 1)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void free(void *a_ptr) { printf("Free: Do not come (static)\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Free: Do not come (static)\0A\00"
define void @free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Free: Do not come (static)\00"
define void @free(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t run_menu(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @run_menu() {
ret i32 0
}
/* Variables and functions */
float cosf(float);
__attribute__((__weak__, __always___)) float softboundmpx_cosf(float x) {
  return cosf(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_cosf>:
jmp    1030 <cosf@plt>

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

LLVM IR (-O2):
define weak float @softboundmpx_cosf(float %0) {
%2 = tail call float @cosf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ psd_free(void *);
void psd_freeif(void *block) {
  if (block != NULL)
    psd_free(block);
}


x86 assembly (clang, -O0):
<psd_freeif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <psd_freeif+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <psd_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psd_freeif>:
test   %rdi,%rdi
je     111a <psd_freeif+0xa>
jmp    1030 <psd_free@plt>
ret

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

LLVM IR (-O2):
define void @psd_freeif(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @psd_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t readint16(const uint8_t *c) {
  uint16_t total = c[1];
  total *= 0x100;
  total += c[0];
  return total;
}


x86 assembly (clang, -O0):
<readint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readint16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @readint16(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = mul nsw i32 %7, 256
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @readint16(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 8
%5 = load i32, i32* %0
%6 = add nsw i32 %4, %5
ret i32 %6
}
void regSetBounds(double *xpos, double *ypos, double *fieldx, double *fieldy) {
  xpos[0] = fieldx[0];
  xpos[1] = fieldx[1];
  ypos[0] = fieldy[0];
  ypos[1] = fieldy[1];
}


x86 assembly (clang, -O0):
<regSetBounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<regSetBounds>:
movsd  (%rdx),%xmm0
movsd  %xmm0,(%rdi)
movsd  0x8(%rdx),%xmm0
movsd  %xmm0,0x8(%rdi)
movsd  (%rcx),%xmm0
movsd  %xmm0,(%rsi)
movsd  0x8(%rcx),%xmm0
movsd  %xmm0,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @regSetBounds(double* nocapture writeonly %0, double* nocapture writeonly %1, double* nocapture %2, double* nocapture %3) {
%5 = load double, double* %2
store double %5, double* %0
%6 = getelementptr inbounds double, double* %2, i64 1
%7 = load double, double* %6
%8 = getelementptr inbounds double, double* %0, i64 1
store double %7, double* %8
%9 = load double, double* %3
store double %9, double* %1
%10 = getelementptr inbounds double, double* %3, i64 1
%11 = load double, double* %10
%12 = getelementptr inbounds double, double* %1, i64 1
store double %11, double* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strncmp(char *, char *, int);
void strncmp_diff_length_4() {
  char *x = "123";
  char *y = "12345";
  clang_analyzer_eval(strncmp(x, y, 3) == 0);
}


x86 assembly (clang, -O0):
<strncmp_diff_length_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_4>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_4() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i64 @strncmp(i8* %3, i8* %4, i32 3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @clang_analyzer_eval(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [6 x i8] c"12345\00"
define void @strncmp_diff_length_4() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 3)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
int get_crc32(unsigned int, unsigned char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
unsigned get_crc32_str(unsigned crcinit, const char *str) {
  return get_crc32(crcinit, (const unsigned char *)str, strlen(str));
}


x86 assembly (clang, -O0):
<get_crc32_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <get_crc32@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_crc32_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @get_crc32(i32 %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_crc32_str(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @get_crc32(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fread(unsigned char *, int, unsigned int, int /*<<< orphan*/ *);
unsigned lzw_readbuf(void *stream, unsigned char *buf, unsigned size) {
  return fread(buf, 1, size, (FILE *)stream);
}


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

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

LLVM IR (-O0):
define i32 @lzw_readbuf(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** %5
%8 = load i32, i32* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = call i32 @fread(i8* %7, i32 1, i32 %8, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @lzw_readbuf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fread(i8* %1, i32 1, i32 %2, i32* %4)
ret i32 %5
}
void byt_ec_evt_register_notify(struct notifier_block *nb) {}


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define void @byt_ec_evt_register_notify(%struct.notifier_block* nocapture %0) {
ret void
}
/* Type definitions */
struct sip_msg {
  int dummy;
};

/* Variables and functions */
int do_RR(struct sip_msg *, int);
int record_route(struct sip_msg *_m, char *_s1, char *_s2) {
  return do_RR(_m, 1);
}


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

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

LLVM IR (-O0):
%struct.sip_msg = type { i32 }
define i32 @record_route(%struct.sip_msg* %0, i8* %1, i8* %2) {
%4 = alloca %struct.sip_msg*
%5 = alloca i8*
%6 = alloca i8*
store %struct.sip_msg* %0, %struct.sip_msg** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.sip_msg*, %struct.sip_msg** %4
%8 = call i32 @do_RR(%struct.sip_msg* %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
%struct.sip_msg = type { i32 }
define i32 @record_route(%struct.sip_msg* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @do_RR(%struct.sip_msg* %0, i32 1)
ret i32 %4
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void panic(struct termios *t_restore) {
  tcsetattr(STDIN_FILENO, TCSANOW, t_restore);
  printf("%c[%dm", 0x1B, 0);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
lea    0xea2(%rip),%rdi
mov    $0x1b,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
call   1040 <tcsetattr@plt>
lea    0xeae(%rip),%rdi
mov    $0x1b,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
@.str = [7 x i8] c"%c[%dm\00"
define void @panic(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @STDIN_FILENO
%4 = load i32, i32* @TCSANOW
%5 = load %struct.termios*, %struct.termios** %2
%6 = call i32 @tcsetattr(i32 %3, i32 %4, %struct.termios* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 0)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDIN_FILENO = global i32 0
@TCSANOW = global i32 0
@.str = [7 x i8] c"%c[%dm\00"
define void @panic(%struct.termios* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = load i32, i32* @TCSANOW
%4 = tail call i32 @tcsetattr(i32 %2, i32 %3, %struct.termios* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 0)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int next_permutation(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", next_permutation(123456798));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x75bcd1e,%edi
call   1030 <next_permutation@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @next_permutation(i32 123456798)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @next_permutation(i32 123456798)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void CANIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000000))) |= ui32IntFlags;
}


x86 assembly (clang, -O0):
<CANIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,(%rcx)
ret

LLVM IR (-O0):
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 0
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @CANIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int A[], int size) {
  int i;
  for (i = 0; i < size; i++) {
    printf("%d ", A[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int dmp_cm_initialize(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dmp_cm_initialize() {
ret i32 0
}
void XDisplayHeight() {}


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

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

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

LLVM IR (-O2):
define void @XDisplayHeight() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void printz() { sleep(1); }


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

x86 assembly (clang, -O2):
<printz>:
mov    $0x1,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @printz() {
%1 = call i32 @sleep(i32 1)
ret void
}

LLVM IR (-O2):
define void @printz() {
%1 = tail call i32 @sleep(i32 1)
ret void
}
void RasterByteSwapEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x40)))) |= (0x00000008u);
}


x86 assembly (clang, -O0):
<RasterByteSwapEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x8,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterByteSwapEnable>:
add    $0x40,%edi
orl    $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @RasterByteSwapEnable(i32 %0) {
%2 = add i32 %0, 64
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 8
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *files_basename(const char *path) {
  const char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<files_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <files_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <files_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @files_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @files_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ patch_op_imm(unsigned int *, int /*<<< orphan*/,
                                int /*<<< orphan*/, int);
void patch_op_imm16(unsigned int *p_insn, uint16_t imm) {
  patch_op_imm(p_insn, imm, 0, 16);
}


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

x86 assembly (clang, -O2):
<patch_op_imm16>:
xor    %edx,%edx
mov    $0x10,%ecx
jmp    1030 <patch_op_imm@plt>

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

LLVM IR (-O2):
define void @patch_op_imm16(i32* %0, i32 %1) {
%3 = tail call i32 @patch_op_imm(i32* %0, i32 %1, i32 0, i32 16)
ret void
}
/* Variables and functions */
int mkostemps(char *, int, int /*<<< orphan*/);
int mkstemps(char *template, int suffixLength) {
  return mkostemps(template, suffixLength, 0);
}


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

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

LLVM IR (-O0):
define i32 @mkstemps(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 @mkostemps(i8* %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mkstemps(i8* %0, i32 %1) {
%3 = tail call i32 @mkostemps(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _printk(char *, char *);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printk(char *, char *);
_panic(char *msg) {
  _printk("Panic: %s\n", msg);
  printk("Panic: %s\n", msg);
  abort();
}


x86 assembly (clang, -O0):
<_panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1050 <_printk@plt>
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printk@plt>
mov    $0x0,%al
call   1040 <abort@plt>

x86 assembly (clang, -O2):
<_panic>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <_printk@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printk@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Panic: %s\0A\00"
define i32 @_panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @_printk(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printk(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"Panic: %s\0A\00"
define i32 @_panic(i8* %0) {
%2 = tail call i32 @_printk(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printk(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *);
int *realloc(int *, int);
void f_broken(int *p) {
  printf("p: %lu\n", p);
  p = realloc(p, 6 * 1024 * 1024 * sizeof(int));
  printf("p: %lu\n", p);
}


x86 assembly (clang, -O0):
<f_broken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1800000,%esi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_broken>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1800000,%esi
call   1040 <realloc@plt>
mov    %r14,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"p: %lu\0A\00"
define void @f_broken(i32* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = tail call i32* @realloc(i32* %0, i32 25165824)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void GarbageCollection() {
  printf("Garbage collection not implemented yet.\n"
         "Program terminated\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"Garbage collection not implemented yet.\0AProgram terminated\0A\00"
define void @GarbageCollection() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [59 x i8] c"Garbage collection not implemented yet.\0AProgram terminated\00"
define void @GarbageCollection() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
void *malloc(unsigned int);
void *rtlglue_malloc(unsigned int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<rtlglue_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @rtlglue_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
int test_imm_CBint16_reg(short val) {
  return ((val) & (0xCB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CBint16_reg(i16 signext %0) {
%2 = and i16 %0, 203
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int __hexchar_to_int(char digit) {
  return ((digit | 432) * 239217992 & 0xffffffff) >> 28;
}


x86 assembly (clang, -O0):
<__hexchar_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
or     $0x1b0,%eax
imul   $0xe422d48,%eax,%eax
and    $0xffffffff,%eax
shr    $0x1c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hexchar_to_int>:
or     $0x1b0,%edi
imul   $0xe422d48,%edi,%eax
shr    $0x1c,%eax
ret

LLVM IR (-O0):
define i32 @__hexchar_to_int(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = or i32 %4, 432
%6 = mul nsw i32 %5, 239217992
%7 = and i32 %6, -1
%8 = lshr i32 %7, 28
ret i32 %8
}

LLVM IR (-O2):
define i32 @__hexchar_to_int(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = or i32 %2, 432
%4 = mul nsw i32 %3, 239217992
%5 = lshr i32 %4, 28
ret i32 %5
}
int main() {
  int i = 12;
  sizeof(123);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 12, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void finn_mat4_identity(float *mat) {
  memset(mat, 0, sizeof(float) * 16);
  mat[0] = mat[5] = mat[10] = mat[15] = 1;
}


x86 assembly (clang, -O0):
<finn_mat4_identity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movss  0xec8(%rip),%xmm0
movss  %xmm0,0x3c(%rax)
mov    -0x8(%rbp),%rax
movss  0xeb7(%rip),%xmm0
movss  %xmm0,0x28(%rax)
mov    -0x8(%rbp),%rax
movss  0xea6(%rip),%xmm0
movss  %xmm0,0x14(%rax)
mov    -0x8(%rbp),%rax
movss  0xe95(%rip),%xmm0
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_mat4_identity>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x3f800000,0x3c(%rbx)
movl   $0x3f800000,0x28(%rbx)
movl   $0x3f800000,0x14(%rbx)
movl   $0x3f800000,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @finn_mat4_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @memset(float* %3, i32 0, i32 64)
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 15
store float 1.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 10
store float 1.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 5
store float 1.000000e+00, float* %10
%11 = load float*, float** %2
%12 = getelementptr inbounds float, float* %11, i64 0
store float 1.000000e+00, float* %12
ret void
}

LLVM IR (-O2):
define void @finn_mat4_identity(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 64)
%3 = getelementptr inbounds float, float* %0, i64 15
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds float, float* %0, i64 10
store float 1.000000e+00, float* %4
%5 = getelementptr inbounds float, float* %0, i64 5
store float 1.000000e+00, float* %5
store float 1.000000e+00, float* %0
ret void
}
void x_disconnect(struct sc *sc) {}


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

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

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

LLVM IR (-O2):
%struct.sc = type opaque
define void @x_disconnect(%struct.sc* nocapture %0) {
ret void
}
void av_tree_enumerate() {}


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

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

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

LLVM IR (-O2):
define void @av_tree_enumerate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ searchRange(int *, int, int, int *);
int main() {
  int nums[6] = {5, 7, 7, 8, 8, 10};
  int rs;
  searchRange(nums, 6, 7, &rs);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x7,%edx
lea    -0x24(%rbp),%rcx
call   1030 <searchRange@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rcx
mov    $0x6,%esi
mov    $0x7,%edx
call   1030 <searchRange@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
%4 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%5 = call i32 @searchRange(i32* %4, i32 6, i32 7, i32* %2)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [6 x i32] [i32 5, i32 7, i32 7, i32 8, i32 8, i32 10]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = alloca i32
%3 = bitcast [6 x i32]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%6 = call i32 @searchRange(i32* %5, i32 6, i32 7, i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int dup2(int oldfd, int newfd) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ed7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebe(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @dup2(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ f(double);
void should_fail() {
  double x = 2.0;
  f(x);
}


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

x86 assembly (clang, -O2):
<should_fail>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @should_fail() {
%1 = alloca double
store double 2.000000e+00, double* %1
%2 = load double, double* %1
%3 = call i32 @f(double %2)
ret void
}

LLVM IR (-O2):
define void @should_fail() {
%1 = tail call i32 @f(double 2.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *addr) {
  if (addr != 0) {
    free(addr);
  }
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void _Jv_voidClass(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_voidClass() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ input_array(int **);
int /*<<< orphan*/ print_array(int **);
int main() {
  int arr[5];
  int arr2d[3][3];
  input_array(arr2d);
  print_array(arr2d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <input_array@plt>
lea    -0x50(%rbp),%rdi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <input_array@plt>
mov    %rbx,%rdi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca [3 x [3 x i32]]
store i32 0, i32* %1
%4 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 0
%5 = bitcast [3 x i32]* %4 to i32**
%6 = call i32 @input_array(i32** %5)
%7 = getelementptr inbounds [3 x [3 x i32]], [3 x [3 x i32]]* %3, i64 0, i64 0
%8 = bitcast [3 x i32]* %7 to i32**
%9 = call i32 @print_array(i32** %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @input_array(i32** %3)
%5 = call i32 @print_array(i32** %3)
ret i32 0
}
/* Variables and functions */
int __builtin_ptx_read_nctaid_w();
int __builtin_ptx_read_nctaid_x();
int __builtin_ptx_read_nctaid_y();
int __builtin_ptx_read_nctaid_z();
__attribute__((device)) int read_nctaid() {
  int x = __builtin_ptx_read_nctaid_x();
  int y = __builtin_ptx_read_nctaid_y();
  int z = __builtin_ptx_read_nctaid_z();
  int w = __builtin_ptx_read_nctaid_w();
  return x + y + z + w;
}


x86 assembly (clang, -O0):
<read_nctaid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_ptx_read_nctaid_x@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <__builtin_ptx_read_nctaid_y@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <__builtin_ptx_read_nctaid_z@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <__builtin_ptx_read_nctaid_w@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_nctaid>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <__builtin_ptx_read_nctaid_x@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1050 <__builtin_ptx_read_nctaid_y@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1040 <__builtin_ptx_read_nctaid_z@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <__builtin_ptx_read_nctaid_w@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_nctaid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @__builtin_ptx_read_nctaid_x()
store i32 %5, i32* %1
%6 = call i32 (...) @__builtin_ptx_read_nctaid_y()
store i32 %6, i32* %2
%7 = call i32 (...) @__builtin_ptx_read_nctaid_z()
store i32 %7, i32* %3
%8 = call i32 (...) @__builtin_ptx_read_nctaid_w()
store i32 %8, i32* %4
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = add nsw i32 %11, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_nctaid() {
%1 = tail call i32 (...) @__builtin_ptx_read_nctaid_x()
%2 = tail call i32 (...) @__builtin_ptx_read_nctaid_y()
%3 = tail call i32 (...) @__builtin_ptx_read_nctaid_z()
%4 = tail call i32 (...) @__builtin_ptx_read_nctaid_w()
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}