xunge/DecIR huggingface dataset:
/* Variables and functions */
int popcount(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, int);
int main() {
  printf("popcount(%#x): %u\n", (unsigned int)0, popcount((unsigned int)0));
  ;
  printf("popcount(%#x): %u\n", (unsigned int)1, popcount((unsigned int)1));
  ;
  printf("popcount(%#x): %u\n", (unsigned int)-1, popcount((unsigned int)-1));
  ;
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <popcount@plt>
lea    0xed1(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <popcount@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <popcount@plt>
mov    %rbx,%rdi
mov    $0xffffffff,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"popcount(%#x): %u\0A\00"
define i32 @main() {
%1 = tail call i32 @popcount(i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 0, i32 %1)
%3 = tail call i32 @popcount(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 1, i32 %3)
%5 = tail call i32 @popcount(i32 -1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 -1, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _linuxrc_error(char const *message, int ret) {
  fputs("linuxrc"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_linuxrc_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_linuxrc_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"linuxrc: \00"
@stderr = global i32 0
define i32 @_linuxrc_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"linuxrc: \00"
@stderr = global i32 0
define i32 @_linuxrc_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
char *audio_moniker(void) { return ("unknown audio"); }


x86 assembly (clang, -O0):
<audio_moniker>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_moniker>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [14 x i8] c"unknown audio\00"
define i8* @audio_moniker() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown audio\00"
define i8* @audio_moniker() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
void CAN_Disable(int canid) {}


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

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

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

LLVM IR (-O2):
define void @CAN_Disable(i32 %0) {
ret void
}
/* Variables and functions */
double sin(double);
__attribute__((always_)) double sinc(double x) {
  if (x == 0.0)
    return 1.0;
  x = sin(x * (3.14159265358979323846)) / (x * (3.14159265358979323846));
  return x;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <sinc+0x37>
jp     1147 <sinc+0x37>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1179 <sinc+0x69>
movsd  0xeb1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  0xe9f(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1127 <sinc+0x17>
jp     1127 <sinc+0x17>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret
mulsd  0xed9(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %2
br label %15
7: ; preds = %1
%8 = load double, double* %3
%9 = fmul double %8, 0x400921FB54442D18
%10 = call double @sin(double %9)
%11 = load double, double* %3
%12 = fmul double %11, 0x400921FB54442D18
%13 = fdiv double %10, %12
store double %13, double* %3
%14 = load double, double* %3
store double %14, double* %2
br label %15
15: ; preds = %7, %6
%16 = load double, double* %2
ret double %16
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fmul double %0, 0x400921FB54442D18
%5 = tail call double @sin(double %4)
%6 = fdiv double %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
int fun(char x) {
  x = x + 1;
  {
    int y;
    y = 1;
    {
      int z = 1;
      ;
      x = x + y + z;
      return x;
    }
  }
}


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

x86 assembly (clang, -O2):
<fun>:
add    $0x3,%dil
movsbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = add nsw i32 %6, 1
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
store i32 1, i32* %3
store i32 1, i32* %4
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @fun(i8 signext %0) {
%2 = add i8 %0, 3
%3 = sext i8 %2 to i32
ret i32 %3
}
void DBGFR3AsSetAlias(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3AsSetAlias() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ stderr;
void waitEnter(void) {
  fprintf(stderr, "Press enter to continue...\n");
  (void)getchar();
}


x86 assembly (clang, -O0):
<waitEnter>:
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 <getchar@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Press enter to continue...\0A\00"
define void @waitEnter() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Press enter to continue...\0A\00"
define void @waitEnter() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getchar()
ret void
}
void commit_discard_dcache(void) {}


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

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

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

LLVM IR (-O2):
define void @commit_discard_dcache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vga_setpalette(int, int, int, int);
void gl_setpalettecolor(int c, int r, int g, int b) {
  vga_setpalette(c, r, g, b);
}


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

x86 assembly (clang, -O2):
<gl_setpalettecolor>:
jmp    1030 <vga_setpalette@plt>

LLVM IR (-O0):
define void @gl_setpalettecolor(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @vga_setpalette(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @gl_setpalettecolor(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @vga_setpalette(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ dac7568_write(int, int /*<<< orphan*/, int /*<<< orphan*/);
void dac7568_write_data(uint8_t ch, uint16_t value) {
  dac7568_write((0x00000000), ch, value);
}


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

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

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

LLVM IR (-O2):
define void @dac7568_write_data(i32 %0, i32 %1) {
%3 = tail call i32 @dac7568_write(i32 0, i32 %0, i32 %1)
ret void
}
int xtensa_uimm8x4(v)
int v;
{ return (v & 3) == 0 && (v >= 0 && v <= 1020); }


x86 assembly (clang, -O0):
<xtensa_uimm8x4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x3,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    113d <xtensa_uimm8x4+0x3d>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1137 <xtensa_uimm8x4+0x37>
cmpl   $0x3fc,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_uimm8x4>:
test   $0x3,%dil
sete   %al
cmp    $0x3fd,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @xtensa_uimm8x4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 1020
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br label %14
14: ; preds = %12, %1
%15 = phi i1 [ false, %1 ], [ %13, %12 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @xtensa_uimm8x4(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = icmp ult i32 %0, 1021
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char *strrchr(char *, char);
void trim_newline(char *str) {
  char *pos = strrchr(str, '\n');
  if (pos)
    *pos = '\0';
}


x86 assembly (clang, -O0):
<trim_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <trim_newline+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_newline>:
push   %rax
mov    $0xa,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1123 <trim_newline+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @trim_newline(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
size_t strcspn(char *, char *);
int _print_modified_time(struct stat file_stat) {
  char *m_time = ctime(&(file_stat.st_mtime));
  m_time[strcspn(m_time, "\n")] = 0;
  printf("%s", m_time);
  return 0;
}


x86 assembly (clang, -O0):
<_print_modified_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <strcspn@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_modified_time>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
lea    0xeb3(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcspn@plt>
movb   $0x0,(%rbx,%rax,1)
lea    0xea2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @_print_modified_time(i32 %0) {
%2 = alloca %struct.stat
%3 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 %0, i32* %3
%4 = call i8* @ctime(i32* %3)
%5 = call i64 @strcspn(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8 0, i8* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test1(void) {
  unsigned int l = 3 * 4 - 5 / 2;
  if (l != 10)
    link_error();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
je     1130 <test1+0x20>
mov    $0x0,%al
call   1030 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test1() {
%1 = alloca i32
store i32 10, i32* %1
%2 = load i32, i32* %1
%3 = icmp ne i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @link_error()
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @test1() {
ret void
}
int chirp_fs_confuga_do_acl_check() { return 1; }


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

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

LLVM IR (-O0):
define i32 @chirp_fs_confuga_do_acl_check() {
ret i32 1
}

LLVM IR (-O2):
define i32 @chirp_fs_confuga_do_acl_check() {
ret i32 1
}
/* Variables and functions */
scalar_t__ cset82(unsigned char const *, int const, int /*<<< orphan*/, int,
                  int, int *, int *, char *);
int x1__12(const unsigned char *data, const int data_len, int *p_err_no,
           int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 12 &&
         cset82(data, data_len, 0, 1, 12, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<x1__12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <x1__12+0x71>
xor    %eax,%eax
cmpl   $0xc,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <x1__12+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0xc,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <cset82@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1__12>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0xb,%ecx
ja     114d <x1__12+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0xc,%r8d
push   %r11
push   %r10
call   1030 <cset82@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @x1__12(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 12
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @cset82(i8* %0, i32 %1, i32 0, i32 1, i32 12, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
void g_node_n_nodes() {}


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

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

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

LLVM IR (-O2):
define void @g_node_n_nodes() {
ret void
}
/* Variables and functions */
#define EAGAIN 129
#define EINTR 128
int ignoreErrno(int ierrno) {
  switch (ierrno) {
  case EAGAIN:
  case EINTR:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ignoreErrno>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     1127 <ignoreErrno+0x27>
jmp    111b <ignoreErrno+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <ignoreErrno+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoreErrno>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @ignoreErrno(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 129, label %5
i32 128, label %5
]
5: ; preds = %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @ignoreErrno(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 128
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ crMemcpy(char *, char const *, unsigned int const);
unsigned int crStrlen(char const *);
void crStrncpy(char *dest, const char *src, unsigned int len) {
  const unsigned int str_len = crStrlen(src);
  if (str_len > len - 1) {
    crMemcpy(dest, src, len);
  } else {
    crMemcpy(dest, src, str_len + 1);
  }
}


x86 assembly (clang, -O0):
<crStrncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <crStrlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jbe    1165 <crStrncpy+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <crMemcpy@plt>
jmp    1178 <crStrncpy+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
call   1030 <crMemcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crStrncpy>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <crStrlen@plt>
lea    -0x1(%rbx),%ecx
lea    0x1(%rax),%edx
cmp    %ecx,%eax
cmova  %ebx,%edx
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <crMemcpy@plt>

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

LLVM IR (-O2):
define void @crStrncpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @crStrlen(i8* %1)
%5 = add i32 %2, -1
%6 = icmp ugt i32 %4, %5
%7 = add i32 %4, 1
%8 = select i1 %6, i32 %2, i32 %7
%9 = tail call i32 @crMemcpy(i8* %0, i8* %1, i32 %8)
ret void
}
/* Variables and functions */
char *strtok(char *, char *);
int words_count(char *string) {
  char *tokens;
  tokens = strtok(string, " ,.-!?");
  int count = 0;
  while (tokens != NULL) {
    count++;
    tokens = strtok(NULL, " ,.-!?");
  }
  return count;
}


x86 assembly (clang, -O0):
<words_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <words_count+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeaa(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1137 <words_count+0x27>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<words_count>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rsi
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <words_count+0x32>
lea    0xed2(%rip),%r14
xchg   %ax,%ax
add    $0x1,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <words_count+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c" ,.-!?\00"
define i32 @words_count(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
store i32 0, i32* %4
br label %7
7: ; preds = %10, %1
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* %13, i8** %3
br label %7
14: ; preds = %7
%15 = load i32, i32* %4
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c" ,.-!?\00"
define i32 @words_count(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %6, %4 ]
ret i32 %10
}
void BN_BLINDING_free(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_BLINDING_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int printmsg(int rc, const char *msg) {
  printf("%s failed: %m\n", msg);
  return rc;
}


x86 assembly (clang, -O0):
<printmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmsg>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%s failed: %m\0A\00"
define i32 @printmsg(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 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s failed: %m\0A\00"
define i32 @printmsg(i32 returned %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void output_level(FILE *outptr, int level) {
  int i;
  for (i = 0; i < level; ++i)
    fprintf(outptr, " ");
}


x86 assembly (clang, -O0):
<output_level>:
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    1150 <output_level+0x40>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <output_level+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_level>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1132 <output_level+0x22>
mov    %esi,%ebx
mov    %rdi,%r14
nopl   (%rax)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebx
jne    1120 <output_level+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @output_level(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 = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @output_level(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @fputc(i32 32, i32* %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void jle_near_rj(unsigned long saut) {
  put8(0x0F);
  put8(0x8E);
  put32(saut);
}


x86 assembly (clang, -O0):
<jle_near_rj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8e,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jle_near_rj>:
push   %rbx
mov    %rdi,%rbx
mov    $0xf,%edi
call   1030 <put8@plt>
mov    $0x8e,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @jle_near_rj(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 15)
%4 = call i32 @put8(i32 142)
%5 = load i64, i64* %2
%6 = call i32 @put32(i64 %5)
ret void
}

LLVM IR (-O2):
define void @jle_near_rj(i64 %0) {
%2 = tail call i32 @put8(i32 15)
%3 = tail call i32 @put8(i32 142)
%4 = tail call i32 @put32(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putdouble_fd(int, double);
void ft_putdouble(double d) { ft_putdouble_fd(1, d); }


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

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

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

LLVM IR (-O2):
define void @ft_putdouble(double %0) {
%2 = tail call i32 @ft_putdouble_fd(i32 1, double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int system(char *);
void systemCommand(char *command) {
  if (system(command) == -1) {
    printf("Error: failed system call %s\n", command);
    exit(0);
  }
}


x86 assembly (clang, -O0):
<systemCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <system@plt>
cmp    $0xffffffff,%eax
jne    1165 <systemCommand+0x35>
mov    -0x8(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<systemCommand>:
push   %rbx
mov    %rdi,%rbx
call   1030 <system@plt>
cmp    $0xffffffff,%eax
je     1140 <systemCommand+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Error: failed system call %s\0A\00"
define void @systemCommand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @system(i8* %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 @exit(i32 0)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Error: failed system call %s\0A\00"
define void @systemCommand(i8* %0) {
%2 = tail call i32 @system(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ openDirectory();
int main() {
  openDirectory();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @openDirectory()
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool ckDynMemLocIsDynMem(uint32_t loc) {
  return (0x00100000 < loc && loc < 0xbf800000);
}


x86 assembly (clang, -O0):
<ckDynMemLocIsDynMem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x100000,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jge    1127 <ckDynMemLocIsDynMem+0x27>
cmpl   $0xbf800000,-0x4(%rbp)
setb   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ckDynMemLocIsDynMem>:
xor    %eax,%eax
cmp    $0x100001,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @ckDynMemLocIsDynMem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 1048576, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp ult i32 %6, -1082130432
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ckDynMemLocIsDynMem(i32 %0) {
%2 = icmp sgt i32 %0, 1048576
%3 = zext i1 %2 to i32
ret i32 %3
}
void FilterDestroy(void *arg) { (void)arg; }


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

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

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

LLVM IR (-O2):
define void @FilterDestroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
bool nrf51_errata_77(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_77() {
ret i32 0
}
/* Variables and functions */
char *return_string(int a) {
  if (a == 0) {
    return NULL;
  }
  if (a == 1) {
    return "";
  }
  return "non-empty";
}


x86 assembly (clang, -O0):
<return_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111e <return_string+0x1e>
movq   $0x0,-0x8(%rbp)
jmp    1143 <return_string+0x43>
cmpl   $0x1,-0xc(%rbp)
jne    1138 <return_string+0x38>
lea    0xeda(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1143 <return_string+0x43>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_string>:
cmp    $0x1,%edi
lea    0xeff(%rip),%rax
lea    0xeef(%rip),%rcx
cmove  %rax,%rcx
xor    %eax,%eax
test   %edi,%edi
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c"non-empty\00"
define i8* @return_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c"non-empty\00"
define i8* @return_string(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* null, i8* %3
ret i8* %5
}
void f(int g) {
  g++;
  g--;
}


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

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, -1
store i32 %6, i32* %2
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
void acct_clear_integrals(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @acct_clear_integrals(%struct.task_struct* nocapture %0) {
ret void
}
int char_in_array(char c, char *array) {
  int i;
  for (i = 0; *(array + i) != '\0'; i++) {
    if (c == *(array + i)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<char_in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <char_in_array+0x61>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114e <char_in_array+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <char_in_array+0x68>
jmp    1153 <char_in_array+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <char_in_array+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_in_array>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <char_in_array+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <char_in_array+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <char_in_array+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @char_in_array(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %1, i64 %13
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %13, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = icmp eq i8 %11, %0
%13 = add nuw i64 %10, 1
br i1 %12, label %14, label %5
14: ; preds = %9, %5, %2
%15 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
unsigned char setBit(int, unsigned char, int);
unsigned char cmd_setBit(int workonbit, unsigned char workingbyte) {
  printf("Neuer Wert des Bits %d: %d\n", workonbit, 1);
  return setBit(workonbit, workingbyte, 1);
}


x86 assembly (clang, -O0):
<cmd_setBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%edx
movzbl -0x5(%rbp),%esi
call   1040 <setBit@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_setBit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <setBit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Neuer Wert des Bits %d: %d\0A\00"
define zeroext i8 @cmd_setBit(i32 %0, i8 zeroext %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 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %5, i32 1)
%7 = load i32, i32* %3
%8 = load i8, i8* %4
%9 = call zeroext i8 @setBit(i32 %7, i8 zeroext %8, i32 1)
ret i8 %9
}

LLVM IR (-O2):
@.str = [28 x i8] c"Neuer Wert des Bits %d: %d\0A\00"
define zeroext i8 @cmd_setBit(i32 %0, i8 zeroext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %0, i32 1)
%4 = tail call zeroext i8 @setBit(i32 %0, i8 zeroext %1, i32 1)
ret i8 %4
}
/* Type definitions */
struct timespec {
  int tv_sec;
  unsigned long long tv_nsec;
};

/* Variables and functions */
unsigned long long timespecDiff(struct timespec *timeA_p,
                                struct timespec *timeB_p) {
  return ((timeA_p->tv_sec * 1000000000) + timeA_p->tv_nsec) -
         ((timeB_p->tv_sec * 1000000000) + timeB_p->tv_nsec);
}


x86 assembly (clang, -O0):
<timespecDiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,(%rax),%eax
cltq
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%rax
mov    -0x10(%rbp),%rcx
imul   $0x3b9aca00,(%rcx),%ecx
movslq %ecx,%rcx
mov    -0x10(%rbp),%rdx
add    0x8(%rdx),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespecDiff>:
movslq (%rdi),%rax
imul   $0x3b9aca00,%rax,%rax
movslq (%rsi),%rcx
add    0x8(%rdi),%rax
imul   $0x3b9aca00,%rcx,%rcx
add    0x8(%rsi),%rcx
sub    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @timespecDiff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = load %struct.timespec*, %struct.timespec** %3
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 1
%12 = load i64, i64* %11
%13 = add i64 %9, %12
%14 = load %struct.timespec*, %struct.timespec** %4
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 1000000000
%18 = sext i32 %17 to i64
%19 = load %struct.timespec*, %struct.timespec** %4
%20 = getelementptr inbounds %struct.timespec, %struct.timespec* %19, i32 0, i32 1
%21 = load i64, i64* %20
%22 = add i64 %18, %21
%23 = sub i64 %13, %22
ret i64 %23
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @timespecDiff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%8 = load i64, i64* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%10 = load i32, i32* %9
%11 = mul nsw i32 %10, 1000000000
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%14 = load i64, i64* %13
%15 = add i64 %8, %6
%16 = add i64 %14, %12
%17 = sub i64 %15, %16
ret i64 %17
}
void kol_key_mode_set(unsigned mode) {
  asm volatile("int $0x40" ::"a"(66), "b"(1), "c"(mode));
}


x86 assembly (clang, -O0):
<kol_key_mode_set>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x42,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_key_mode_set>:
push   %rbx
mov    %edi,%ecx
mov    $0x42,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_key_mode_set(i32 %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 66, i32 1, i32 %0)
ret void
}