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


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

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

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

LLVM IR (-O2):
define void @IntMasterFIQDisable() {
%1 = tail call i32 (...) @CPUfiqd()
ret void
}
void beep(unsigned int freq, unsigned int duration, unsigned int unk) {}


x86 assembly (clang, -O0):
<beep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @beep(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
ret void
}

LLVM IR (-O2):
define void @beep(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int read32(void *);
int /*<<< orphan*/ write32(void *, int);
void clrbits32(uint32_t bits, void *addr) {
  write32(addr, read32(addr) & ~bits);
}


x86 assembly (clang, -O0):
<clrbits32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <read32@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <write32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrbits32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <read32@plt>
not    %ebp
and    %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write32@plt>

LLVM IR (-O0):
define void @clrbits32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @read32(i8* %6)
%8 = load i32, i32* %3
%9 = xor i32 %8, -1
%10 = and i32 %7, %9
%11 = call i32 @write32(i8* %5, i32 %10)
ret void
}

LLVM IR (-O2):
define void @clrbits32(i32 %0, i8* %1) {
%3 = tail call i32 @read32(i8* %1)
%4 = xor i32 %0, -1
%5 = and i32 %3, %4
%6 = tail call i32 @write32(i8* %1, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hyptop_exit(int /*<<< orphan*/);
void l_sig_exit(int sig) {
  (void)sig;
  hyptop_exit(0);
}


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

x86 assembly (clang, -O2):
<l_sig_exit>:
xor    %edi,%edi
jmp    1030 <hyptop_exit@plt>

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

LLVM IR (-O2):
define void @l_sig_exit(i32 %0) {
%2 = tail call i32 @hyptop_exit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help_command() {
  printf("help"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"help\00"
define void @help_command() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int test(int *p) {
  printf("%p\n", p);
  printf("%d\n", *p);
  printf("%d\n", p[1]);
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%esi
lea    0xed3(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @test(i32* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = load i32, i32* %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
char *strdup(char const *);
char *tosString_strdup(const char *s) { return strdup(s); }


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

x86 assembly (clang, -O2):
<tosString_strdup>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @tosString_strdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
ret i8* %2
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
__attribute__((unused)) double ls_ts_to_tmo(struct timespec ts) {
  double s = ts.tv_sec;
  double ns = ts.tv_nsec;
  return s + ns / 1e9;
}


x86 assembly (clang, -O0):
<ls_ts_to_tmo>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_ts_to_tmo>:
divsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @ls_ts_to_tmo(double %0, double %1) {
%3 = alloca %struct.timespec
%4 = alloca double
%5 = alloca double
%6 = bitcast %struct.timespec* %3 to { double, double }*
%7 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 0
store double %0, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %6, i32 0, i32 1
store double %1, double* %8
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%10 = load double, double* %9
store double %10, double* %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%12 = load double, double* %11
store double %12, double* %5
%13 = load double, double* %4
%14 = load double, double* %5
%15 = fdiv double %14, 1.000000e+09
%16 = fadd double %13, %15
ret double %16
}

LLVM IR (-O2):
define double @ls_ts_to_tmo(double %0, double %1) {
%3 = fdiv double %1, 1.000000e+09
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
float mycalc(float, float);
int /*<<< orphan*/ printf(char *, float, float, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float x, y, z;
  scanf("%f %f", &x, &y);
  z = mycalc(x, y);
  printf("%f plus %f = %f\n", x, y, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <mycalc@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
call   1040 <mycalc@plt>
movaps %xmm0,%xmm2
movss  0x4(%rsp),%xmm0
movss  (%rsp),%xmm1
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [17 x i8] c"%f plus %f = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%5 = load float, float* %1
%6 = load float, float* %2
%7 = call float @mycalc(float %5, float %6)
store float %7, float* %3
%8 = load float, float* %1
%9 = load float, float* %2
%10 = load float, float* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %8, float %9, float %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [17 x i8] c"%f plus %f = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = call float @mycalc(float %6, float %7)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), float %9, float %10, float %8)
ret i32 0
}
/* Variables and functions */
double atan(double);
double atand_(double x) { return atan(x); }


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

x86 assembly (clang, -O2):
<atand_>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define double @atand_(double %0) {
%2 = tail call double @atan(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
void readLine(char *buffer) {
  do {
    *(buffer++) = getchar();
  } while (*(buffer - 1) != '\n');
  *(--buffer) = '\0';
}


x86 assembly (clang, -O0):
<readLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl -0x1(%rax),%eax
cmp    $0xa,%eax
jne    111c <readLine+0xc>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,-0x1(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readLine>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    $0xa,%al
jne    1120 <readLine+0x10>
movb   $0x0,-0x1(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @readLine(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 (...) @getchar()
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %5, i8* %3
%7 = and i32 %4, 255
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %2
9: ; preds = %2
store i8 0, i8* %3
ret void
}
char *maildir_getlink(const char *filename) { return (0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @maildir_getlink(i8* nocapture readnone %0) {
ret i8* null
}
int is_base64_pad(int c) { return c == '='; }


x86 assembly (clang, -O0):
<is_base64_pad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x3d,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_base64_pad>:
xor    %eax,%eax
cmp    $0x3d,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_base64_pad(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 61
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_base64_pad(i32 %0) {
%2 = icmp eq i32 %0, 61
%3 = zext i1 %2 to i32
ret i32 %3
}
void cpu_init(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_init() {
ret void
}
char lower_case(char c) { return ((char)(c + 32)); }


x86 assembly (clang, -O0):
<lower_case>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_case>:
lea    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @lower_case(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @lower_case(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void CursorXYKAYPRO(int x, int y) { printf("\033=%c%c", y + 31, x + 31); }


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

x86 assembly (clang, -O2):
<CursorXYKAYPRO>:
add    $0x1f,%esi
lea    0x1f(%rdi),%edx
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B=%c%c\00"
define void @CursorXYKAYPRO(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = add nsw i32 %5, 31
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 31
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B=%c%c\00"
define void @CursorXYKAYPRO(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 31
%4 = add nsw i32 %0, 31
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
void uart_puts_p(const char *progmem_s) {}


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

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

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

LLVM IR (-O2):
define void @uart_puts_p(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(int /*<<< orphan*/);
int /*<<< orphan*/ termattrs();
void cmd_termattrs(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_int(termattrs());
}


x86 assembly (clang, -O0):
<cmd_termattrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_termattrs+0x27>
jmp    117f <cmd_termattrs+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1030 <termattrs@plt>
mov    %eax,%edi
call   1060 <report_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_termattrs>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_termattrs+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1030 <termattrs@plt>
mov    %eax,%edi
pop    %rax
jmp    1060 <report_int@plt>

LLVM IR (-O0):
define void @cmd_termattrs(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 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @termattrs()
%12 = call i32 @report_int(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_termattrs(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @termattrs()
%8 = tail call i32 @report_int(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
int test_imm_68uint32_reg(unsigned int val) {
  return ((val) & (0x68 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_68uint32_reg(i32 %0) {
%2 = and i32 %0, 104
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int cpufreq_limit_put(struct cpufreq_limit_handle *handle, int release) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.cpufreq_limit_handle = type opaque
define i32 @cpufreq_limit_put(%struct.cpufreq_limit_handle* nocapture readnone %0, i32 %1) {
ret i32 0
}
int sysfs_create_file(struct kobject *k, const struct attribute *a) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.attribute = type opaque
define i32 @sysfs_create_file(%struct.kobject* nocapture readnone %0, %struct.attribute* nocapture readnone %1) {
ret i32 0
}
int c() { return 10; }


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

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

LLVM IR (-O0):
define i32 @c() {
ret i32 10
}

LLVM IR (-O2):
define i32 @c() {
ret i32 10
}
/* Variables and functions */
long strlen(char *);
char *get_cmd_file_name(char *bin_file_name) {
  char *rtr_val = bin_file_name;
  long length = strlen(bin_file_name);
  rtr_val[length - 3] = 't';
  rtr_val[length - 2] = 'x';
  rtr_val[length - 1] = 't';
  return rtr_val;
}


x86 assembly (clang, -O0):
<get_cmd_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x3,%rcx
movb   $0x74,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x2,%rcx
movb   $0x78,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x74,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cmd_file_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movw   $0x7874,-0x3(%rax,%rbx,1)
movb   $0x74,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_cmd_file_name(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %4
%8 = load i8*, i8** %3
%9 = load i64, i64* %4
%10 = sub nsw i64 %9, 3
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 116, i8* %11
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = sub nsw i64 %13, 2
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 120, i8* %15
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = sub nsw i64 %17, 1
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 116, i8* %19
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @get_cmd_file_name(i8* returned %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, -3
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 116, i8* %4
%5 = add nsw i64 %2, -2
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 120, i8* %6
%7 = add nsw i64 %2, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 116, i8* %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  abort();
  printf("undead\n");
  exit(1);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @abort()
unreachable
}
void bitset_clear_all() {}


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

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

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

LLVM IR (-O2):
define void @bitset_clear_all() {
ret void
}
isdotdot(p) register char *p;
{
  if (p && *p++ == '.' && *p++ == '.' && *p++ == '\0')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<isdotdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <isdotdot+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1170 <isdotdot+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1170 <isdotdot+0x70>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1170 <isdotdot+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1177 <isdotdot+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdotdot>:
test   %rdi,%rdi
je     1116 <isdotdot+0x16>
cmpb   $0x2e,(%rdi)
jne    1116 <isdotdot+0x16>
cmpb   $0x2e,0x1(%rdi)
jne    1116 <isdotdot+0x16>
cmpb   $0x0,0x2(%rdi)
je     1119 <isdotdot+0x19>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isdotdot(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 46
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 46
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10, %6, %3, %1
br label %15
15: ; preds = %10, %14
%16 = phi i32 [ 0, %14 ], [ 1, %10 ]
ret i32 %16
}
int test_imm_0Aint8_mem(signed char *val) {
  return ((*val) & (-0x0A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -10
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void finalize_con() {
  putchar(0x1B);
  putchar('[');
  putchar('0');
  putchar(';');
  putchar('m');
}


x86 assembly (clang, -O0):
<finalize_con>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x3b,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
call   1030 <putchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<finalize_con>:
push   %rax
mov    $0x1b,%edi
call   1030 <putchar@plt>
mov    $0x5b,%edi
call   1030 <putchar@plt>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x3b,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @finalize_con() {
%1 = call i32 @putchar(i8 signext 27)
%2 = call i32 @putchar(i8 signext 91)
%3 = call i32 @putchar(i8 signext 48)
%4 = call i32 @putchar(i8 signext 59)
%5 = call i32 @putchar(i8 signext 109)
ret void
}

LLVM IR (-O2):
define void @finalize_con() {
%1 = tail call i32 @putchar(i8 signext 27)
%2 = tail call i32 @putchar(i8 signext 91)
%3 = tail call i32 @putchar(i8 signext 48)
%4 = tail call i32 @putchar(i8 signext 59)
%5 = tail call i32 @putchar(i8 signext 109)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
void largeAdjustmentLT(unsigned a) {
  char *b = ((void *)0);
  if (a + 2 < 1)
    b = malloc(1);
  if (a == (0x7fffffff * 2U + 1U) - 1 || a == (0x7fffffff * 2U + 1U))
    free(b);
  else if (a < (0x7fffffff * 2U + 1U) - 1)
    return;
  return;
}


x86 assembly (clang, -O0):
<largeAdjustmentLT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
cmp    $0x1,%eax
jae    1150 <largeAdjustmentLT+0x30>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0xfffffffe,-0x4(%rbp)
je     1164 <largeAdjustmentLT+0x44>
cmpl   $0xffffffff,-0x4(%rbp)
jne    1172 <largeAdjustmentLT+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    1186 <largeAdjustmentLT+0x66>
cmpl   $0xfffffffe,-0x4(%rbp)
jae    1181 <largeAdjustmentLT+0x61>
jmp    118b <largeAdjustmentLT+0x6b>
jmp    1186 <largeAdjustmentLT+0x66>
jmp    118b <largeAdjustmentLT+0x6b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<largeAdjustmentLT>:
cmp    $0xffffffff,%edi
je     1141 <largeAdjustmentLT+0x21>
cmp    $0xfffffffe,%edi
jne    1148 <largeAdjustmentLT+0x28>
push   %rax
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
add    $0x8,%rsp
jmp    1030 <free@plt>
xor    %edi,%edi
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @largeAdjustmentLT(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* null, i8** %3
%4 = load i32, i32* %2
%5 = add i32 %4, 2
%6 = icmp ult i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i8* @malloc(i32 1)
store i8* %8, i8** %3
br label %9
9: ; preds = %7, %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, -2
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %12, %9
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
br label %23
18: ; preds = %12
%19 = load i32, i32* %2
%20 = icmp ult i32 %19, -2
br i1 %20, label %21, label %22
21: ; preds = %18
br label %24
22: ; preds = %18
br label %23
23: ; preds = %22, %15
br label %24
24: ; preds = %23, %21
ret void
}

LLVM IR (-O2):
define void @largeAdjustmentLT(i32 %0) {
switch i32 %0, label %7 [
i32 -2, label %2
i32 -1, label %4
]
2: ; preds = %1
%3 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %4
4: ; preds = %1, %2
%5 = phi i8* [ %3, %2 ], [ null, %1 ]
%6 = tail call i32 @free(i8* %5)
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int test_csv_out(char *, char *);
bool test_csv_out4() {
  return test_csv_out("hello\nworld", "\"hello\nworld\"");
}


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

x86 assembly (clang, -O2):
<test_csv_out4>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <test_csv_out@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"hello\0Aworld\00"
@.str.1 = [14 x i8] c"\22hello\0Aworld\22\00"
define i32 @test_csv_out4() {
%1 = call i32 @test_csv_out(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello\0Aworld\00"
@.str.1 = [14 x i8] c"\22hello\0Aworld\22\00"
define i32 @test_csv_out4() {
%1 = tail call i32 @test_csv_out(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int px4_arch_configgpio(uint32_t pinset) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @px4_arch_configgpio(i32 %0) {
ret i32 -1
}
main() { sizeof(int[]){1}; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_error(char const *);
int /*<<< orphan*/ terminate();
void error_die(const char *msg) {
  log_error(msg);
  terminate();
}


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

x86 assembly (clang, -O2):
<error_die>:
push   %rax
call   1030 <log_error@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <terminate@plt>

LLVM IR (-O0):
define void @error_die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_error(i8* %3)
%5 = call i32 (...) @terminate()
ret void
}

LLVM IR (-O2):
define void @error_die(i8* %0) {
%2 = tail call i32 @log_error(i8* %0)
%3 = tail call i32 (...) @terminate()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
void *scheduler3(void *variables3) {
  int vars;
  int *p_vars = (int *)variables3;
  vars = *p_vars;
  while (1) {
    system("netstat -anp | grep perl | awk '{print $7}' | cut -d / -f1 | xargs "
           "kill");
    sleep(vars);
  }
}


x86 assembly (clang, -O0):
<scheduler3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
jmp    113d <scheduler3+0x1d>

x86 assembly (clang, -O2):
<scheduler3>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%ebx
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <system@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
jmp    1130 <scheduler3+0x10>

LLVM IR (-O0):
@.str = [72 x i8] c"netstat -anp | grep perl | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define i8* @scheduler3(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
store i32 %8, i32* %3
br label %9
9: ; preds = %1, %9
%10 = call i32 @system(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 @sleep(i32 %11)
br label %9
}

LLVM IR (-O2):
@.str = [72 x i8] c"netstat -anp | grep perl | awk '{print $7}' | cut -d / -f1 | xargs kill\00"
define noalias i8* @scheduler3(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @system(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sleep(i32 %3)
br label %4
}
/* Variables and functions */
int EAGAIN;
int read(int, char *, int);
int clear_rx(int fd) {
  static char rx_buf[2048];
  int n;
  do {
    n = read(fd, rx_buf, 2048);
    if (n == EAGAIN)
      return 0;
    if (n < 0) {
      break;
    }
  } while (n);
  return 0;
}


x86 assembly (clang, -O0):
<clear_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x800,%edx
call   1030 <read@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%eax
jne    1150 <clear_rx+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1175 <clear_rx+0x65>
cmpl   $0x0,-0xc(%rbp)
jge    115f <clear_rx+0x4f>
jmp    116e <clear_rx+0x5e>
jmp    1164 <clear_rx+0x54>
cmpl   $0x0,-0xc(%rbp)
jne    111b <clear_rx+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_rx>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0x2f22(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x800,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1148 <clear_rx+0x38>
cmp    (%r15),%eax
jne    1130 <clear_rx+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@clear_rx.rx_buf = internal global [2048 x i8] zeroinitializer
@EAGAIN = global i32 0
define i32 @clear_rx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %3
%7 = call i32 @read(i32 %6, i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @clear_rx.rx_buf, i64 0, i64 0), i32 2048)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* @EAGAIN
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
store i32 0, i32* %2
br label %21
12: ; preds = %5
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %12
br label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
br i1 %19, label %5, label %20
20: ; preds = %17, %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@clear_rx.rx_buf = internal global [2048 x i8] zeroinitializer
@EAGAIN = global i32 0
define i32 @clear_rx(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @read(i32 %0, i8* getelementptr inbounds ([2048 x i8], [2048 x i8]* @clear_rx.rx_buf, i64 0, i64 0), i32 2048)
%4 = load i32, i32* @EAGAIN
%5 = icmp ne i32 %3, %4
%6 = icmp sgt i32 %3, 0
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Timer0A_Disarm();
int /*<<< orphan*/ Timer1A_Disarm();
int /*<<< orphan*/ Timer2A_Disarm();
int /*<<< orphan*/ Timer3A_Disarm();
void Player_Pause() {
  Timer0A_Disarm();
  Timer1A_Disarm();
  Timer2A_Disarm();
  Timer3A_Disarm();
}


x86 assembly (clang, -O0):
<Player_Pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Timer0A_Disarm@plt>
mov    $0x0,%al
call   1060 <Timer1A_Disarm@plt>
mov    $0x0,%al
call   1050 <Timer2A_Disarm@plt>
mov    $0x0,%al
call   1040 <Timer3A_Disarm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Player_Pause>:
push   %rax
xor    %eax,%eax
call   1030 <Timer0A_Disarm@plt>
xor    %eax,%eax
call   1060 <Timer1A_Disarm@plt>
xor    %eax,%eax
call   1050 <Timer2A_Disarm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Timer3A_Disarm@plt>

LLVM IR (-O0):
define void @Player_Pause() {
%1 = call i32 (...) @Timer0A_Disarm()
%2 = call i32 (...) @Timer1A_Disarm()
%3 = call i32 (...) @Timer2A_Disarm()
%4 = call i32 (...) @Timer3A_Disarm()
ret void
}

LLVM IR (-O2):
define void @Player_Pause() {
%1 = tail call i32 (...) @Timer0A_Disarm()
%2 = tail call i32 (...) @Timer1A_Disarm()
%3 = tail call i32 (...) @Timer2A_Disarm()
%4 = tail call i32 (...) @Timer3A_Disarm()
ret void
}
unsigned int le2int(unsigned char *buf) {
  return ((buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]);
}


x86 assembly (clang, -O0):
<le2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @le2int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Thrd_Flush_Buffer(int, int);
unsigned int Thrd_Show_Bits(int, int);
unsigned int Thrd_Get_Bits(int t, int N) {
  unsigned int Val;
  {
    Val = Thrd_Show_Bits(t, N);
    Thrd_Flush_Buffer(t, N);
    return (Val);
  }
}


x86 assembly (clang, -O0):
<Thrd_Get_Bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <Thrd_Show_Bits@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <Thrd_Flush_Buffer@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Thrd_Get_Bits>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <Thrd_Show_Bits@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <Thrd_Flush_Buffer@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Thrd_Get_Bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @Thrd_Show_Bits(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @Thrd_Flush_Buffer(i32 %9, i32 %10)
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @Thrd_Get_Bits(i32 %0, i32 %1) {
%3 = tail call i32 @Thrd_Show_Bits(i32 %0, i32 %1)
%4 = tail call i32 @Thrd_Flush_Buffer(i32 %0, i32 %1)
ret i32 %3
}
int my_func() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @my_func() {
ret i32 0
}
void test_no_clause() {
  int i;
#pragma omp target teams distribute simd
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target teams distribute simd
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_no_clause() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
ret void
}

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  int x;
  printf("Calcular la suma de los enteros del 1 al...");
  scanf("%d", &n);
  x = (n * (n + 1)) / 2;
  printf("La suma de los enteros del 1 al %d es %d \n", n, x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebe(%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    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0x1(%rsi),%eax
imul   %esi,%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Calcular la suma de los enteros del 1 al...\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"La suma de los enteros del 1 al %d es %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %6, %8
%10 = sdiv i32 %9, 2
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"Calcular la suma de los enteros del 1 al...\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [43 x i8] c"La suma de los enteros del 1 al %d es %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
%7 = mul nsw i32 %6, %5
%8 = sdiv i32 %7, 2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %8)
ret i32 0
}