xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isBlank(char const *, size_t const);
int isNewLineChars(char const *, size_t const);
int isBlankNewLineChars(const char *ccp_input, const size_t i_offset) {
  return ((isBlank(ccp_input, i_offset) == 0)
              ? 0
              : isNewLineChars(ccp_input, i_offset));
}


x86 assembly (clang, -O0):
<isBlankNewLineChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <isBlank@plt>
cmp    $0x0,%rax
jne    1151 <isBlankNewLineChars+0x31>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    1161 <isBlankNewLineChars+0x41>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <isNewLineChars@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBlankNewLineChars>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <isBlank@plt>
test   %rax,%rax
je     1146 <isBlankNewLineChars+0x26>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <isNewLineChars@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @isBlankNewLineChars(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i64 @isBlank(i8* %5, i64 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @isNewLineChars(i8* %11, i64 %12)
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 0, %9 ], [ %13, %10 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @isBlankNewLineChars(i8* %0, i64 %1) {
%3 = tail call i64 @isBlank(i8* %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @isNewLineChars(i8* %0, i64 %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M70_f(char *s) {
  debug("M70_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M70_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M70_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"M70_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M70_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"M70_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M70_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ doit();
int main() {
  doit();
  abort();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @doit()
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ emsStat(int *const);
void ems_stat_(int *const status) {

  emsStat(status);
  return;
}


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

x86 assembly (clang, -O2):
<ems_stat_>:
jmp    1030 <emsStat@plt>

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

LLVM IR (-O2):
define void @ems_stat_(i32* %0) {
%2 = tail call i32 @emsStat(i32* %0)
ret void
}
void NV12ToRGB24Row_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB24Row_Any_NEON() {
ret void
}
void outdw(unsigned short portnum, unsigned int data) {
  __asm__ __volatile__("out %%eax, %%dx" ::"a"(data), "d"(portnum));
}


x86 assembly (clang, -O0):
<outdw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x2(%rbp),%dx
out    %eax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outdw>:
mov    %esi,%eax
mov    %edi,%edx
out    %eax,(%dx)
ret

LLVM IR (-O0):
define void @outdw(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i16, i16* %3
ret void
}

LLVM IR (-O2):
define void @outdw(i16 zeroext %0, i32 %1) {
tail call void asm sideeffect "out %eax, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1, i16 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ writelogfile(int, int, char *, char *);
void writelogfile0(int severity, int trouble, char *text) {
  writelogfile(severity, trouble, "%s", text);
}


x86 assembly (clang, -O0):
<writelogfile0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rcx
lea    0xecd(%rip),%rdx
call   1030 <writelogfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writelogfile0>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <writelogfile@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @writelogfile0(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @writelogfile(i32 %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
int tegra_drm_fb_prepare(struct drm_device *drm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.drm_device = type opaque
define i32 @tegra_drm_fb_prepare(%struct.drm_device* nocapture readnone %0) {
ret i32 0
}
int __backtrace(void **array, int size) { return -1; }


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

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

LLVM IR (-O0):
define i32 @__backtrace(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @__backtrace(i8** nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void sockerror(char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<sockerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sockerror>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @sockerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sockerror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  FILE *fp;
  int x, x1;
  fp = fopen("abc.txt", "r");
  fscanf(fp, "%d%d", &x, &x1);
  printf("%d%d", x, x1);
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <fscanf@plt>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
lea    0xeb6(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
lea    0xea9(%rip),%r14
lea    0x4(%rsp),%rdx
mov    %rsp,%rcx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <fscanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [5 x i8] c"%d%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = call i32 @fclose(i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int /*<<< orphan*/ my_putstr(char *);
int my_show_wordtab(char **tab) {
  int lp;
  lp = -1;
  while (tab[++lp] != 0) {
    my_putstr(tab[lp]);
    my_putchar('\n');
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_show_wordtab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     116e <my_show_wordtab+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
jmp    1133 <my_show_wordtab+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_show_wordtab>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114b <my_show_wordtab+0x2b>
add    $0x8,%rbx
call   1040 <my_putstr@plt>
mov    $0xa,%edi
call   1030 <my_putchar@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <my_show_wordtab+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @my_show_wordtab(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %2, %1 ]
%7 = tail call i32 @my_putstr(i8* %6)
%8 = tail call i32 @my_putchar(i8 signext 10)
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i32 0
}
void glUniformMatrix3x4fv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniformMatrix3x4fv() {
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ detail;
};
struct TYPE_4__ {
  TYPE_1__ xconfigurerequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigurerequest_detail(void *_p) {
  return (int)((XEvent *)_p)->xconfigurerequest.detail;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xconfigurerequest_detail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xconfigurerequest_detail(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int hostapd_acs_completed(struct hostapd_iface *iface, int err) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define i32 @hostapd_acs_completed(%struct.hostapd_iface* nocapture readnone %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
unsigned int GET32(int);
unsigned int uart_lcr(void) { return (GET32((0x20000000 + 0x00215054))); }


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

x86 assembly (clang, -O2):
<uart_lcr>:
mov    $0x20215054,%edi
jmp    1030 <GET32@plt>

LLVM IR (-O0):
define i32 @uart_lcr() {
%1 = call i32 @GET32(i32 539054164)
ret i32 %1
}

LLVM IR (-O2):
define i32 @uart_lcr() {
%1 = tail call i32 @GET32(i32 539054164)
ret i32 %1
}
void __aeabi_unwind_cpp_pr0() {}


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

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

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

LLVM IR (-O2):
define void @__aeabi_unwind_cpp_pr0() {
ret void
}
int compare_uchar(const void *c1, const void *c2) {
  unsigned char a, b;
  a = (long)c1;
  b = (long)c2;
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<compare_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    %al,-0x12(%rbp)
movzbl -0x11(%rbp),%eax
movzbl -0x12(%rbp),%ecx
cmp    %ecx,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzbl -0x11(%rbp),%ecx
movzbl -0x12(%rbp),%edx
cmp    %edx,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_uchar>:
movzbl %dil,%ecx
movzbl %sil,%edx
xor    %eax,%eax
cmp    %edx,%ecx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @compare_uchar(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
%9 = trunc i64 %8 to i8
store i8 %9, i8* %5
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i64
%12 = trunc i64 %11 to i8
store i8 %12, i8* %6
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = icmp sgt i32 %14, %16
%18 = zext i1 %17 to i32
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = icmp slt i32 %20, %22
%24 = zext i1 %23 to i32
%25 = sub nsw i32 %18, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_uchar(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = and i32 %4, 255
%8 = and i32 %6, 255
%9 = icmp ugt i32 %7, %8
%10 = zext i1 %9 to i32
%11 = icmp ult i32 %7, %8
%12 = sext i1 %11 to i32
%13 = add nsw i32 %12, %10
ret i32 %13
}
int execl(name, args)
char *name;
int args;
{
  extern char **environ;
  return execve(name, &args, environ);
}


x86 assembly (clang, -O0):
<execl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%rdx
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1030 <execve@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execl>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%rdx
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <execve@plt>
pop    %rcx
ret

LLVM IR (-O0):
@environ = external global i8**
define i32 @execl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** @environ
%7 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i32*, i8**, ...)*)(i8* %5, i32* %4, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
@environ = external global i8**
define i32 @execl(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i8**, i8*** @environ
%5 = call i32 (i8*, i32*, i8**, ...) bitcast (i32 (...)* @execve to i32 (i8*, i32*, i8**, ...)*)(i8* %0, i32* %3, i8** %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int open(char *, int /*<<< orphan*/);
int main(void) {
  char *path = "/etc/passwd";
  int fd = open(path, O_RDONLY);
  if (fd >= 0) {
    dup2(fd, fd);
    close(fd);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     117c <main+0x4c>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <dup2@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
js     115c <main+0x2c>
mov    %eax,%ebx
mov    %eax,%edi
mov    %eax,%esi
call   1030 <dup2@plt>
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"/etc/passwd\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2
%4 = load i8*, i8** %2
%5 = load i32, i32* @O_RDONLY
%6 = call i32 @open(i8* %4, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %0
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @dup2(i32 %10, i32 %11)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
br label %15
15: ; preds = %9, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"/etc/passwd\00"
@O_RDONLY = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = tail call i32 @dup2(i32 %2, i32 %2)
%6 = tail call i32 @close(i32 %2)
br label %7
7: ; preds = %4, %0
ret i32 0
}
void *memrev32(void *p) {
  unsigned char *x = p, t;
  t = x[0];
  x[0] = x[3];
  x[3] = t;
  t = x[1];
  x[1] = x[2];
  x[2] = t;
  return p;
}


x86 assembly (clang, -O0):
<memrev32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memrev32>:
mov    %rdi,%rax
mov    (%rdi),%cl
mov    0x3(%rdi),%dl
mov    %dl,(%rdi)
mov    %cl,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define i8* @memrev32(i8* returned %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret i8* %0
}
float CA_RSqrt(float number) {
  long i;
  float x, y;
  x = number * 0.5;
  y = number;
  i = *(long *)&y;
  i = 0x5f3759df - (i >> 1);
  y = *(float *)&i;
  y = y * (1.5 - (x * y * y));
  return y;
}


x86 assembly (clang, -O0):
<CA_RSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
sar    $0x1,%rcx
mov    $0x5f3759df,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe85(%rip),%xmm1
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @CA_RSqrt(float %0) {
%2 = alloca float
%3 = alloca i64
%4 = alloca float
%5 = alloca float
store float %0, float* %2
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double %7, 5.000000e-01
%9 = fptrunc double %8 to float
store float %9, float* %4
%10 = load float, float* %2
store float %10, float* %5
%11 = bitcast float* %5 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = ashr i64 %13, 1
%15 = sub nsw i64 1597463007, %14
store i64 %15, i64* %3
%16 = bitcast i64* %3 to float*
%17 = load float, float* %16
store float %17, float* %5
%18 = load float, float* %5
%19 = fpext float %18 to double
%20 = load float, float* %4
%21 = load float, float* %5
%22 = fmul float %20, %21
%23 = load float, float* %5
%24 = fmul float %22, %23
%25 = fpext float %24 to double
%26 = fsub double 1.500000e+00, %25
%27 = fmul double %19, %26
%28 = fptrunc double %27 to float
store float %28, float* %5
%29 = load float, float* %5
ret float %29
}

LLVM IR (-O2):
define float @CA_RSqrt(float %0) {
ret float poison
}
/* Variables and functions */
int powerOfTwo(int);
int numberOfNodesInCompleteBinaryTree(int height) {
  return powerOfTwo(height) - 1;
}


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

x86 assembly (clang, -O2):
<numberOfNodesInCompleteBinaryTree>:
push   %rax
call   1030 <powerOfTwo@plt>
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @numberOfNodesInCompleteBinaryTree(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @powerOfTwo(i32 %3)
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @numberOfNodesInCompleteBinaryTree(i32 %0) {
%2 = tail call i32 @powerOfTwo(i32 %0)
%3 = add nsw i32 %2, -1
ret i32 %3
}
void USBEndpointDMADisable(unsigned long ulBase, unsigned long ulEndpoint,
                           unsigned long ulFlags) {
  if (ulFlags & 0x00002000) {
    (*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) +
                                  0x00000113))) &= ~0x00000010;
  } else {
    (*((volatile unsigned char *)(ulBase + (ulEndpoint - 0x10) +
                                  0x00000117))) &= ~0x00000020;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x2000,%rax
cmp    $0x0,%rax
je     114a <USBEndpointDMADisable+0x4a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x113(%rax),%cl
movzbl %cl,%ecx
and    $0xffffffef,%ecx
mov    %cl,0x113(%rax)
jmp    116b <USBEndpointDMADisable+0x6b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x10,%rcx
add    %rcx,%rax
mov    0x117(%rax),%cl
movzbl %cl,%ecx
and    $0xffffffdf,%ecx
mov    %cl,0x117(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDMADisable>:
and    $0x2000,%edx
mov    %rdx,%rax
shr    $0xd,%rax
xor    %ecx,%ecx
test   %rdx,%rdx
sete   %cl
add    %rsi,%rdi
shl    $0x4,%al
add    $0xdf,%al
and    %al,0x103(%rdi,%rcx,4)
ret

LLVM IR (-O0):
define void @USBEndpointDMADisable(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = and i64 %7, 8192
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %21
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %5
%13 = sub i64 %12, 16
%14 = add i64 %11, %13
%15 = add i64 %14, 275
%16 = inttoptr i64 %15 to i8*
%17 = load volatile i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, -17
%20 = trunc i32 %19 to i8
store volatile i8 %20, i8* %16
br label %32
21: ; preds = %3
%22 = load i64, i64* %4
%23 = load i64, i64* %5
%24 = sub i64 %23, 16
%25 = add i64 %22, %24
%26 = add i64 %25, 279
%27 = inttoptr i64 %26 to i8*
%28 = load volatile i8, i8* %27
%29 = zext i8 %28 to i32
%30 = and i32 %29, -33
%31 = trunc i32 %30 to i8
store volatile i8 %31, i8* %27
br label %32
32: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
define void @USBEndpointDMADisable(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %2, 8192
%5 = icmp eq i64 %4, 0
%6 = add i64 %1, %0
%7 = select i1 %5, i64 263, i64 259
%8 = select i1 %5, i8 -33, i8 -17
%9 = add i64 %6, %7
%10 = inttoptr i64 %9 to i8*
%11 = load volatile i8, i8* %10
%12 = and i8 %11, %8
store volatile i8 %12, i8* %10
ret void
}
/* Variables and functions */
long long __infer_nondet_long_long_int();
long long int llround(double x) { return __infer_nondet_long_long_int(); }


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

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

LLVM IR (-O0):
define i64 @llround(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i64 (...) @__infer_nondet_long_long_int()
ret i64 %3
}

LLVM IR (-O2):
define i64 @llround(double %0) {
%2 = tail call i64 (...) @__infer_nondet_long_long_int()
ret i64 %2
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int c, nbcara = 0;
  while ((c = getchar()) != EOF) {
    if (c != ' ' || c != '\t' || c != '\n')
      nbcara = 0;
    else
      nbcara++;
  }
  printf("\n%d\n", nbcara);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     1187 <main+0x67>
cmpl   $0x20,-0x8(%rbp)
jne    116d <main+0x4d>
cmpl   $0x9,-0x8(%rbp)
jne    116d <main+0x4d>
cmpl   $0xa,-0x8(%rbp)
je     1179 <main+0x59>
movl   $0x0,-0xc(%rbp)
jmp    1182 <main+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1130 <main+0x10>
lea    0xebe(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = load i32, i32* @EOF
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
double now();
double chg_now() { return now(); }


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

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

LLVM IR (-O0):
define double @chg_now() {
%1 = call double (...) @now()
ret double %1
}

LLVM IR (-O2):
define double @chg_now() {
%1 = tail call double (...) @now()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
double *allocateDoubleArray1D(int size) {
  double *array = (double *)malloc(size * sizeof(double));
  if (array == NULL) {
    printf("\n*** Array Allocation Failed! ***\n");
    printf("\nExiting...\n");
    exit(-1);
  }
  return array;
}


x86 assembly (clang, -O0):
<allocateDoubleArray1D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <allocateDoubleArray1D+0x4b>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocateDoubleArray1D>:
push   %rax
shl    $0x3,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <allocateDoubleArray1D+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"\0A*** Array Allocation Failed! ***\0A\00"
@.str.1 = [13 x i8] c"\0AExiting...\0A\00"
define double* @allocateDoubleArray1D(i32 %0) {
%2 = alloca i32
%3 = alloca double*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
store double* %9, double** %3
%10 = load double*, double** %3
%11 = icmp eq double* %10, null
br i1 %11, label %12, label %16
12: ; preds = %1
%13 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @exit(i32 -1)
unreachable
16: ; preds = %1
%17 = load double*, double** %3
ret double* %17
}

LLVM IR (-O2):
@str = [34 x i8] c"\0A*** Array Allocation Failed! ***\00"
@str.2 = [12 x i8] c"\0AExiting...\00"
define double* @allocateDoubleArray1D(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = inttoptr i64 %3 to double*
ret double* %10
}
/* Variables and functions */
long double _strtold(char const *, int /*<<< orphan*/);
long double _atold(const char *ascii) { return _strtold(ascii, 0); }


x86 assembly (clang, -O0):
<_atold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <_strtold@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_atold>:
xor    %esi,%esi
jmp    1030 <_strtold@plt>

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

LLVM IR (-O2):
define x86_fp80 @_atold(i8* %0) {
%2 = tail call x86_fp80 @_strtold(i8* %0, i32 0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ UnityPrintChar(char const *);
void UnityPrint(const char *string) {
  const char *pch = string;
  if (pch != NULL) {
    while (*pch) {
      UnityPrintChar(pch);
      pch++;
    }
  }
}


x86 assembly (clang, -O0):
<UnityPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1160 <UnityPrint+0x50>
jmp    1134 <UnityPrint+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <UnityPrint+0x4b>
mov    -0x10(%rbp),%rdi
call   1030 <UnityPrintChar@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <UnityPrint+0x24>
jmp    1160 <UnityPrint+0x50>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnityPrint>:
push   %rbx
test   %rdi,%rdi
je     1132 <UnityPrint+0x22>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1132 <UnityPrint+0x22>
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <UnityPrintChar@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <UnityPrint+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @UnityPrint(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %3, %6
%7 = phi i8* [ %9, %6 ], [ %0, %3 ]
%8 = tail call i32 @UnityPrintChar(i8* %7)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ key15;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int open_dev(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ read(int, int *, int);
int main() {
  int gpio_fd = 0;
  int key15 = 0x0f;
  gpio_fd = open_dev("/dev/s5pv210-key15-simple");
  while (1) {
    read(gpio_fd, &key15, sizeof(key15));
    if (key15 != 0)
      printf("key15=%d\n", key15);
  }
  close(gpio_fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xf,-0xc(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <open_dev@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read@plt>
cmpl   $0x0,-0xc(%rbp)
je     1186 <main+0x56>
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    115c <main+0x2c>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0xf,0xc(%rsp)
lea    0xeb8(%rip),%rdi
call   1030 <open_dev@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%r14
lea    0xebf(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1050 <read@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     1160 <main+0x30>
mov    %r15,%rdi
call   1040 <printf@plt>
jmp    1160 <main+0x30>

LLVM IR (-O0):
@.str = [26 x i8] c"/dev/s5pv210-key15-simple\00"
@.str.1 = [10 x i8] c"key15=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 15, i32* %3
%4 = call i32 @open_dev(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
br label %5
5: ; preds = %0, %13
%6 = load i32, i32* %2
%7 = call i32 @read(i32 %6, i32* %3, i32 4)
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10, %5
br label %5
}

LLVM IR (-O2):
@.str = [26 x i8] c"/dev/s5pv210-key15-simple\00"
@.str.1 = [10 x i8] c"key15=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 15, i32* %1
%3 = tail call i32 @open_dev(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %10, %0
%5 = call i32 @read(i32 %3, i32* %1, i32 4)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %10
10: ; preds = %8, %4
br label %4
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ _IO_read_base;
  scalar_t__ _IO_read_end;
};
typedef TYPE_1__ FILE;

/* Variables and functions */
int getFileSize(FILE *stream) {
  return (int)(stream->_IO_read_end - stream->_IO_read_base);
}


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

x86 assembly (clang, -O2):
<getFileSize>:
mov    0x8(%rdi),%eax
sub    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i64 }
define i32 @getFileSize(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%3 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sub nsw i64 %5, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i64 }
define i32 @getFileSize(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = sub nsw i64 %3, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ tx();
int /*<<< orphan*/ tx_done();
void txn(int n) {
  while (n--) {
    tx();
    tx();
    tx_done();
  }
}


x86 assembly (clang, -O0):
<txn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1159 <txn+0x39>
mov    $0x0,%al
call   1040 <tx@plt>
mov    $0x0,%al
call   1040 <tx@plt>
mov    $0x0,%al
call   1030 <tx_done@plt>
jmp    112b <txn+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txn>:
push   %rbx
test   %edi,%edi
je     114a <txn+0x2a>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <tx@plt>
xor    %eax,%eax
call   1040 <tx@plt>
xor    %eax,%eax
call   1030 <tx_done@plt>
add    $0xffffffff,%ebx
jne    1130 <txn+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @txn(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @tx()
%7 = tail call i32 (...) @tx()
%8 = tail call i32 (...) @tx_done()
%9 = icmp eq i32 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
ret void
}
void cpy(char **dst, char *src) {
  int i;
  for (i = 0; src[i]; i++)
    (*dst)[i] = src[i];
  *dst = &(*dst)[i];
}


x86 assembly (clang, -O0):
<cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     114c <cpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <cpy+0x13>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq -0x14(%rbp),%rax
add    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpy>:
mov    (%rsi),%al
test   %al,%al
je     1129 <cpy+0x29>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    (%rdi),%rdx
mov    %al,(%rdx,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <cpy+0x10>
mov    %ecx,%eax
add    %rax,(%rdi)
ret
xor    %eax,%eax
add    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @cpy(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = phi i8 [ %12, %5 ], [ %3, %2 ]
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 %6
store i8 %7, i8* %9
%10 = add nuw nsw i64 %6, 1
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5
%15 = and i64 %10, 4294967295
br label %16
16: ; preds = %14, %2
%17 = phi i64 [ 0, %2 ], [ %15, %14 ]
%18 = load i8*, i8** %0
%19 = getelementptr inbounds i8, i8* %18, i64 %17
store i8* %19, i8** %0
ret void
}