xunge/DecIR huggingface dataset:
unsigned char inportb(unsigned short port) {
  unsigned char output;
  asm volatile("inb %1, %0" : "=a"(output) : "dN"(port));
  return output;
}


x86 assembly (clang, -O0):
<inportb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inportb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inportb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},{dx}N,~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
unsigned num_msg_blocks(size_t len) {
  return (len / 64) + ((len % 64) ? 1 : 0);
}


x86 assembly (clang, -O0):
<num_msg_blocks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
mov    -0x8(%rbp),%rsi
and    $0x3f,%rsi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_msg_blocks>:
mov    %rdi,%rax
shr    $0x6,%rax
and    $0x3f,%edi
cmp    $0x1,%rdi
sbb    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @num_msg_blocks(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 64
%5 = load i64, i64* %2
%6 = urem i64 %5, 64
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
%10 = sext i32 %9 to i64
%11 = add i64 %4, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @num_msg_blocks(i64 %0) {
%2 = lshr i64 %0, 6
%3 = and i64 %0, 63
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = add nuw nsw i64 %2, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int const uint8_t;

/* Variables and functions */
uint8_t linux_WTERMSIG(int const status) { return status & 0x7F; }


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

x86 assembly (clang, -O2):
<linux_WTERMSIG>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @linux_WTERMSIG(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
const char *sp_skip_whitespaces(const char *line) {
  while (*line && (*line == ' ' || *line == '\t'))
    line++;
  return line;
}


x86 assembly (clang, -O0):
<sp_skip_whitespaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <sp_skip_whitespaces+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1142 <sp_skip_whitespaces+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <sp_skip_whitespaces+0x58>
jmp    1169 <sp_skip_whitespaces+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <sp_skip_whitespaces+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sp_skip_whitespaces>:
mov    %rdi,%rax
jmp    1114 <sp_skip_whitespaces+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <sp_skip_whitespaces+0x10>
cmp    $0x9,%cl
je     1110 <sp_skip_whitespaces+0x10>
ret

LLVM IR (-O0):
define i8* @sp_skip_whitespaces(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %22, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 9
br label %18
18: ; preds = %13, %8
%19 = phi i1 [ true, %8 ], [ %17, %13 ]
br label %20
20: ; preds = %18, %3
%21 = phi i1 [ false, %3 ], [ %19, %18 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %2
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %2
br label %3
25: ; preds = %20
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
define i8* @sp_skip_whitespaces(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
]
5: ; preds = %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  printf("%lu\n", strlen("linux"));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lu\0A\00"
@.str.1 = [6 x i8] c"linux\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
unsigned char get_decimal_point(void) { return '.'; }


x86 assembly (clang, -O0):
<get_decimal_point>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2e,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_decimal_point>:
mov    $0x2e,%al
ret

LLVM IR (-O0):
define zeroext i8 @get_decimal_point() {
ret i8 46
}

LLVM IR (-O2):
define zeroext i8 @get_decimal_point() {
ret i8 46
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ exit_with_status_and_signal(int /*<<< orphan*/,
                                               int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((noreturn)) abort(void) {
  write(2, "GCN Kernel Aborted\n", 19);
  exit_with_status_and_signal(0, SIGABRT);
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <exit_with_status_and_signal@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0x13,%edx
call   1030 <write@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
call   1040 <exit_with_status_and_signal@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"GCN Kernel Aborted\0A\00"
@SIGABRT = global i32 0
define void @abort() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 19)
%2 = load i32, i32* @SIGABRT
%3 = call i32 @exit_with_status_and_signal(i32 0, i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c"GCN Kernel Aborted\0A\00"
@SIGABRT = global i32 0
define void @abort() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 19)
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @exit_with_status_and_signal(i32 0, i32 %2)
unreachable
}
/* Variables and functions */
void *thr2(void *arg) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @thr2(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int pythagoreanTripletProduct(int);
int main() {
  printf("%d\n", pythagoreanTripletProduct(1000));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
call   1040 <pythagoreanTripletProduct@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <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 @pythagoreanTripletProduct(i32 1000)
%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 @pythagoreanTripletProduct(i32 1000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/, char *, float *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
float pedir_float() {
  float numero;
  fprintf(stdout, "Introduce un numero: ");
  fscanf(stdin, "%f", &numero);
  return numero;
}


x86 assembly (clang, -O0):
<pedir_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1030 <fscanf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pedir_float>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <fscanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [22 x i8] c"Introduce un numero: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%f\00"
define float @pedir_float() {
%1 = alloca float
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fscanf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = load float, float* %1
ret float %6
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [22 x i8] c"Introduce un numero: \00"
@stdin = global i32 0
@.str.1 = [3 x i8] c"%f\00"
define float @pedir_float() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32 @fscanf(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%7 = load float, float* %1
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;

/* Variables and functions */
int /*<<< orphan*/ DH_free(int /*<<< orphan*/ *);
void freeDH(DH *dh) { DH_free(dh); }


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

x86 assembly (clang, -O2):
<freeDH>:
jmp    1030 <DH_free@plt>

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

LLVM IR (-O2):
define void @freeDH(i32* %0) {
%2 = tail call i32 @DH_free(i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ atanh(double);
long double atanhl(long double x) { return (long double)atanh((double)x); }


x86 assembly (clang, -O0):
<atanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <atanh@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanhl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <atanh@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @atanhl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @atanh(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @atanhl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @atanh(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
__attribute__((always_)) void set_task_cpu(struct task_struct *p,
                                           unsigned int cpu) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @set_task_cpu(%struct.task_struct* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ verify();
void cmd_verify(void) { verify(); }


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

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

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

LLVM IR (-O2):
define void @cmd_verify() {
%1 = tail call i32 (...) @verify()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void c_fclose_(FILE **fp) { fclose(*fp); }


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

x86 assembly (clang, -O2):
<c_fclose_>:
mov    (%rdi),%rdi
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @c_fclose_(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @fclose(i32* %2)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int main() {
  struct stat st;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.stat
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void trace_return_value(struct vm_method *vmm, unsigned long value) {}


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

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

LLVM IR (-O0):
%struct.vm_method = type opaque
define void @trace_return_value(%struct.vm_method* %0, i64 %1) {
%3 = alloca %struct.vm_method*
%4 = alloca i64
store %struct.vm_method* %0, %struct.vm_method** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
%struct.vm_method = type opaque
define void @trace_return_value(%struct.vm_method* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ printf(char *, int);
int uadd_ok(unsigned int, int /*<<< orphan*/);
int main() {
  printf("ok ? = %d\n", uadd_ok(1U, UINT_MAX));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"ok ? = %d\0A\00"
@UINT_MAX = global i32 0
define i32 @main() {
%1 = load i32, i32* @UINT_MAX
%2 = tail call i32 @uadd_ok(i32 1, i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ quad_t;
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ SYS_lseek;
off_t machdep_sys_lseek(int fd, off_t offset, int whence) {
  extern off_t __syscall();
  return (__syscall((quad_t)SYS_lseek, fd, 0, offset, whence));
}


x86 assembly (clang, -O0):
<machdep_sys_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%rax
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%r8d
xor    %edx,%edx
mov    $0x0,%al
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machdep_sys_lseek>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %edi,%esi
mov    0x2ed2(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
@SYS_lseek = global i64 0
define i32 @machdep_sys_lseek(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* @SYS_lseek
%8 = trunc i64 %7 to i32
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @__syscall to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %8, i32 %9, i32 0, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@SYS_lseek = global i64 0
define i32 @machdep_sys_lseek(i32 %0, i32 %1, i32 %2) {
%4 = load i64, i64* @SYS_lseek
%5 = trunc i64 %4 to i32
%6 = tail call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @__syscall to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %5, i32 %0, i32 0, i32 %1, i32 %2)
ret i32 %6
}
int _citrus_NONE_ctype_mbsinit(void *__restrict cl,
                               const void *__restrict pspriv,
                               int *__restrict nresult) {
  *nresult = 1;
  return (0);
}


x86 assembly (clang, -O0):
<_citrus_NONE_ctype_mbsinit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_citrus_NONE_ctype_mbsinit>:
movl   $0x1,(%rdx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_citrus_NONE_ctype_mbsinit(i8* noalias %0, i8* noalias %1, i32* noalias %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 i32*, i32** %6
store i32 1, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @_citrus_NONE_ctype_mbsinit(i8* noalias nocapture readnone %0, i8* noalias nocapture readnone %1, i32* noalias nocapture writeonly %2) {
store i32 1, i32* %2
ret i32 0
}
/* Variables and functions */
int I2C_Read(int, unsigned char, unsigned char *);
int STC3115_CheckI2cDeviceId(void) {
  unsigned char RegAddress;
  unsigned char data8;
  int status;
  RegAddress = 0x18;
  status = I2C_Read(1, RegAddress, &data8);
  if (status >= 0) {
    if (data8 == 0x14) {
      status = 0;
    } else {
      status = -2;
    }
  } else {
    status = -1;
  }
  return (status);
}


x86 assembly (clang, -O0):
<STC3115_CheckI2cDeviceId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x18,-0x1(%rbp)
mov    $0x1,%edi
lea    -0x2(%rbp),%rdx
movzbl -0x1(%rbp),%esi
call   1030 <I2C_Read@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1160 <STC3115_CheckI2cDeviceId+0x50>
movzbl -0x2(%rbp),%eax
cmp    $0x14,%eax
jne    1154 <STC3115_CheckI2cDeviceId+0x44>
movl   $0x0,-0x8(%rbp)
jmp    115b <STC3115_CheckI2cDeviceId+0x4b>
movl   $0xfffffffe,-0x8(%rbp)
jmp    1167 <STC3115_CheckI2cDeviceId+0x57>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_CheckI2cDeviceId>:
push   %rax
lea    0x7(%rsp),%rdx
mov    $0x1,%edi
mov    $0x18,%esi
call   1030 <I2C_Read@plt>
xor    %ecx,%ecx
cmpb   $0x14,0x7(%rsp)
sete   %cl
test   %eax,%eax
lea    -0x2(%rcx,%rcx,1),%ecx
mov    $0xffffffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC3115_CheckI2cDeviceId() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i32
store i8 24, i8* %1
%4 = load i8, i8* %1
%5 = call i32 @I2C_Read(i32 1, i8 zeroext %4, i8* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %0
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 20
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %3
br label %14
13: ; preds = %8
store i32 -2, i32* %3
br label %14
14: ; preds = %13, %12
br label %16
15: ; preds = %0
store i32 -1, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @STC3115_CheckI2cDeviceId() {
%1 = alloca i8
%2 = call i32 @I2C_Read(i32 1, i8 zeroext 24, i8* %1)
%3 = icmp sgt i32 %2, -1
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 20
%6 = select i1 %5, i32 0, i32 -2
%7 = select i1 %3, i32 %6, i32 -1
ret i32 %7
}
void intGenClean(struct LSD_SceneNodeInst const *inst, void *instData) {}


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

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

LLVM IR (-O0):
%struct.LSD_SceneNodeInst = type opaque
define void @intGenClean(%struct.LSD_SceneNodeInst* %0, i8* %1) {
%3 = alloca %struct.LSD_SceneNodeInst*
%4 = alloca i8*
store %struct.LSD_SceneNodeInst* %0, %struct.LSD_SceneNodeInst** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.LSD_SceneNodeInst = type opaque
define void @intGenClean(%struct.LSD_SceneNodeInst* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_server_destroy() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_server_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_destroy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_server_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char *strrchr(char *, char);
char *utilFileNameFromPath(char *path) {
  char *name = strrchr(path, '/');
  if (name) {
    return name + 1;
  } else {
    return path;
  }
}


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

x86 assembly (clang, -O2):
<utilFileNameFromPath>:
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* @utilFileNameFromPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strrchr(i8* %5, i8 signext 47)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %2
br label %14
12: ; preds = %1
%13 = load i8*, i8** %3
store i8* %13, i8** %2
br label %14
14: ; preds = %12, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @utilFileNameFromPath(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
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void FatalError(const char *str) { __coverity_panic__(); }


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

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

LLVM IR (-O0):
define void @FatalError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @__coverity_panic__()
ret void
}

LLVM IR (-O2):
define void @FatalError(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @__coverity_panic__()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int strcspn(char *, char *);
int main() {
  assert(strcspn("foo:bar:", ":") == 3);
  assert(strcspn("foo:bar:", "=of") == 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <strcspn@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea7(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1030 <strcspn@plt>
cmp    $0x0,%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
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"foo:bar:\00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [4 x i8] c"=of\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @strcspn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 3
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @strcspn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createSubExpression(struct memorycontainer *expression1,
                    struct memorycontainer *expression2) {
  return createExpression(0x0B, expression1, expression2);
}


x86 assembly (clang, -O0):
<createSubExpression>:
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    $0xb,%edi
call   1030 <createExpression@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createSubExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0xb,%edi
jmp    1030 <createExpression@plt>

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

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createSubExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 11, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
/* Type definitions */
typedef int Atom;

/* Variables and functions */
int AtomCompare(const void *a1, const void *a2) {
  const Atom *atom1 = a1;
  const Atom *atom2 = a2;
  return (*atom1 - *atom2);
}


x86 assembly (clang, -O0):
<AtomCompare>:
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    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x20(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @AtomCompare(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** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @AtomCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *, char const *, int);
void *realloc(void *, size_t);
void *srealloc(void *ptr, size_t size, const char *file) {
  void *res = realloc(ptr, size);
  if (!res && size)
    fail("%s: allocation of %d bytes failed\n", file, (int)size);
  return res;
}


x86 assembly (clang, -O0):
<srealloc>:
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    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1171 <srealloc+0x51>
cmpq   $0x0,-0x10(%rbp)
je     1171 <srealloc+0x51>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xe94(%rip),%rdi
call   1030 <fail@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srealloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r15
test   %rbx,%rbx
je     114e <srealloc+0x2e>
test   %r15,%r15
jne    114e <srealloc+0x2e>
lea    0xebc(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <fail@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%s: allocation of %d bytes failed\0A\00"
define i8* @srealloc(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i8* @realloc(i8* %8, i64 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %21, label %13
13: ; preds = %3
%14 = load i64, i64* %5
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i64, i64* %5
%19 = trunc i64 %18 to i32
%20 = call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %19)
br label %21
21: ; preds = %16, %13, %3
%22 = load i8*, i8** %7
ret i8* %22
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s: allocation of %d bytes failed\0A\00"
define noalias i8* @srealloc(i8* nocapture %0, i64 %1, i8* %2) {
%4 = tail call i8* @realloc(i8* %0, i64 %1)
%5 = icmp eq i8* %4, null
%6 = icmp ne i64 %1, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = trunc i64 %1 to i32
%10 = tail call i32 @fail(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %9)
br label %11
11: ; preds = %8, %3
ret i8* %4
}
void stress_itimer_handler(int sig) { (void)sig; }


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

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

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

LLVM IR (-O2):
define void @stress_itimer_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main(void) {
  int a, i;
#pragma omp target parallel shared(a) private(i)
  {
#pragma omp master
    a = 0;
#pragma omp barrier
#pragma omp for reduction(+ : a)
    for (i = 0; i < 1000; i++) {
      a += i;
    }
#pragma omp single
    {
      if (a != (1000 * (1000 - 1) / 2))
        printf("Incorrect result = %d, expected = %d!\n", a,
               (1000 * (1000 - 1) / 2));
      else
        printf("The result is correct = %d!\n", a);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1151 <main+0x41>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
cmpl   $0x79f2c,-0x8(%rbp)
je     1179 <main+0x69>
mov    -0x8(%rbp),%esi
lea    0xe98(%rip),%rdi
mov    $0x79f2c,%edx
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <main+0x7a>
mov    -0x8(%rbp),%esi
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [39 x i8] c"Incorrect result = %d, expected = %d!\0A\00"
@.str.1 = [29 x i8] c"The result is correct = %d!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%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* %2
%16 = icmp ne i32 %15, 499500
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32 %18, i32 499500)
br label %23
20: ; preds = %14
%21 = load i32, i32* %2
%22 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %20, %17
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [29 x i8] c"The result is correct = %d!\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 499500)
ret i32 0
}
void sigpipe_handler(int i) {}


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

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

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

LLVM IR (-O2):
define void @sigpipe_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_basic();
int /*<<< orphan*/ test_empty();
int /*<<< orphan*/ test_numbers();
int /*<<< orphan*/ test_worst_case();
int main(void) {
  test_empty();
  test_basic();
  test_numbers();
  test_worst_case();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_empty@plt>
mov    $0x0,%al
call   1060 <test_basic@plt>
mov    $0x0,%al
call   1030 <test_numbers@plt>
mov    $0x0,%al
call   1040 <test_worst_case@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_empty@plt>
xor    %eax,%eax
call   1060 <test_basic@plt>
xor    %eax,%eax
call   1030 <test_numbers@plt>
xor    %eax,%eax
call   1040 <test_worst_case@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_empty()
%3 = call i32 (...) @test_basic()
%4 = call i32 (...) @test_numbers()
%5 = call i32 (...) @test_worst_case()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_empty()
%2 = tail call i32 (...) @test_basic()
%3 = tail call i32 (...) @test_numbers()
%4 = tail call i32 (...) @test_worst_case()
ret i32 0
}
int test_imm_D0uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xD0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D0uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xd0,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D0uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 208
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void util_init() { ; }


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

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

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

LLVM IR (-O2):
define void @util_init() {
ret void
}
/* Variables and functions */
unsigned int reg_read32(int);
int /*<<< orphan*/ reg_write32(int, unsigned int);
void pic_disableirq(unsigned int irq) {
  reg_write32(0x14000008, reg_read32(0x14000008) & ~irq);
}


x86 assembly (clang, -O0):
<pic_disableirq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14000008,%edi
call   1030 <reg_read32@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
mov    $0x14000008,%edi
call   1040 <reg_write32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic_disableirq>:
push   %rbx
mov    %edi,%ebx
mov    $0x14000008,%edi
call   1030 <reg_read32@plt>
not    %ebx
and    %eax,%ebx
mov    $0x14000008,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <reg_write32@plt>

LLVM IR (-O0):
define void @pic_disableirq(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @reg_read32(i32 335544328)
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = and i32 %3, %5
%7 = call i32 @reg_write32(i32 335544328, i32 %6)
ret void
}

LLVM IR (-O2):
define void @pic_disableirq(i32 %0) {
%2 = tail call i32 @reg_read32(i32 335544328)
%3 = xor i32 %0, -1
%4 = and i32 %2, %3
%5 = tail call i32 @reg_write32(i32 335544328, i32 %4)
ret void
}
int array_good1_FP() {
  int a[10];
  for (int i = 0; i < 10; i++) {
    a[i] = 0;
  }
  return a[2];
}


x86 assembly (clang, -O0):
<array_good1_FP>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    112f <array_good1_FP+0x2f>
movslq -0x34(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    110b <array_good1_FP+0xb>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @array_good1_FP() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
testLess() { printf("%d < %d = %d\n", 10, 4, 10 < 4); }


x86 assembly (clang, -O0):
<testLess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLess>:
lea    0xee9(%rip),%rdi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d < %d = %d\0A\00"
define i32 @testLess() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 10, i32 4, i32 0)
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t addlm123(uint64_t x) { return x + -123; }


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

x86 assembly (clang, -O2):
<addlm123>:
lea    -0x7b(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @addlm123(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, -123
ret i64 %4
}

LLVM IR (-O2):
define i64 @addlm123(i64 %0) {
%2 = add nsw i64 %0, -123
ret i64 %2
}
/* Variables and functions */
int **__ctype_tolower_loc();
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, void *);
__attribute__((__weak__, __always___)) int const **
softboundmpx___ctype_tolower_loc(void) {
  int const **ret_ptr = __ctype_tolower_loc();
  __softboundmpx_store_return_metadata(
      (void *)ret_ptr, (void *)((char *)ret_ptr + sizeof(int *)));
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx___ctype_tolower_loc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <__ctype_tolower_loc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x8,%rsi
call   1030 <__softboundmpx_store_return_metadata@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx___ctype_tolower_loc>:
push   %rbx
xor    %eax,%eax
call   1040 <__ctype_tolower_loc@plt>
mov    %rax,%rbx
lea    0x8(%rax),%rsi
mov    %rax,%rdi
call   1030 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define weak i32** @softboundmpx___ctype_tolower_loc() {
%1 = alloca i32**
%2 = call i32** (...) @__ctype_tolower_loc()
store i32** %2, i32*** %1
%3 = load i32**, i32*** %1
%4 = bitcast i32** %3 to i8*
%5 = load i32**, i32*** %1
%6 = bitcast i32** %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 8
%8 = call i32 @__softboundmpx_store_return_metadata(i8* %4, i8* %7)
%9 = load i32**, i32*** %1
ret i32** %9
}

LLVM IR (-O2):
define weak i32** @softboundmpx___ctype_tolower_loc() {
%1 = tail call i32** (...) @__ctype_tolower_loc()
%2 = bitcast i32** %1 to i8*
%3 = getelementptr inbounds i32*, i32** %1, i64 1
%4 = bitcast i32** %3 to i8*
%5 = tail call i32 @__softboundmpx_store_return_metadata(i8* %2, i8* %4)
ret i32** %1
}
/* Variables and functions */
int rand();
void fillRandomly(int *p, int size) {
  int i;
  for (i = 0; i < size; ++i)
    p[i] = rand() % size;
}


x86 assembly (clang, -O0):
<fillRandomly>:
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    1156 <fillRandomly+0x46>
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fillRandomly+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fillRandomly>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1148 <fillRandomly+0x38>
mov    %esi,%r15d
mov    %rdi,%r14
mov    %esi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <fillRandomly+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @fillRandomly(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 = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fillRandomly(i32* nocapture writeonly %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 = tail call i32 (...) @rand()
%9 = srem i32 %8, %1
%10 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %9, i32* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}