xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mygeti(int *);
int /*<<< orphan*/ stdout;
int read() {
  int x;
  do {
    fputs("Enter value: ", stdout);
    fflush(stdout);
  } while (!mygeti(&x));
  return x;
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
lea    -0x4(%rbp),%rdi
call   1050 <mygeti@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <read+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2ea0(%rip),%rbx
lea    0xeb9(%rip),%r14
lea    0xc(%rsp),%r15
nopl   0x0(%rax)
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <fputs@plt>
mov    (%rbx),%edi
call   1040 <fflush@plt>
mov    %r15,%rdi
call   1050 <mygeti@plt>
test   %eax,%eax
je     1150 <read+0x20>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Enter value: \00"
@stdout = global i32 0
define i32 @read() {
%1 = alloca i32
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
br label %7
7: ; preds = %2
%8 = call i32 @mygeti(i32* %1)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %2, label %11
11: ; preds = %7
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [14 x i8] c"Enter value: \00"
@stdout = global i32 0
define i32 @read() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = load i32, i32* @stdout
%5 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stdout
%7 = call i32 @fflush(i32 %6)
%8 = call i32 @mygeti(i32* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %3, label %10
10: ; preds = %3
%11 = load i32, i32* %1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void FatalError(char *err) {
  fprintf(stderr, "An error occured: %s %s\nExiting now...\n", err,
          strerror(errno));
  fflush(stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<FatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<FatalError>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2e92(%rip),%r14
mov    (%r14),%ebp
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
lea    0xe9a(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    (%r14),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"An error occured: %s %s\0AExiting now...\0A\00"
@errno = global i32 0
define void @FatalError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"An error occured: %s %s\0AExiting now...\0A\00"
@errno = global i32 0
define void @FatalError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
}
unsigned long XBlackPixelOfScreen() {}


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

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

LLVM IR (-O0):
define i64 @XBlackPixelOfScreen() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @XBlackPixelOfScreen() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ obelisk();
void town_square(void) {
  glPushMatrix();
  obelisk();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<town_square>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
mov    $0x0,%al
call   1030 <obelisk@plt>
mov    $0x0,%al
call   1040 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<town_square>:
push   %rax
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
xor    %eax,%eax
call   1030 <obelisk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glPopMatrix@plt>

LLVM IR (-O0):
define void @town_square() {
%1 = call i32 (...) @glPushMatrix()
%2 = call i32 (...) @obelisk()
%3 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @town_square() {
%1 = tail call i32 (...) @glPushMatrix()
%2 = tail call i32 (...) @obelisk()
%3 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int yogrt_remaining();
int yogrt_get_time(void) { return yogrt_remaining(); }


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

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

LLVM IR (-O0):
define i32 @yogrt_get_time() {
%1 = call i32 (...) @yogrt_remaining()
ret i32 %1
}

LLVM IR (-O2):
define i32 @yogrt_get_time() {
%1 = tail call i32 (...) @yogrt_remaining()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ set_bit(int *, int);
void set(int *bits, int *known) {
  int i;
  scanf("%d", &i);
  set_bit(bits, i);
  set_bit(known, i);
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <set_bit@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <set_bit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1030 <set_bit@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <set_bit@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @set(i32* %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @set_bit(i32* %0, i32 %6)
%8 = load i32, i32* %3
%9 = call i32 @set_bit(i32* %1, i32 %8)
ret void
}
/* Variables and functions */
unsigned long local_read_meminfo(char *);
unsigned long get_hugepage_bytes() {
  unsigned long pagesize = local_read_meminfo("Hugepagesize: %lu kB");
  if (pagesize < 0)
    return -1;
  return pagesize * 1024;
}


x86 assembly (clang, -O0):
<get_hugepage_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <local_read_meminfo@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jae    1140 <get_hugepage_bytes+0x30>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    114c <get_hugepage_bytes+0x3c>
mov    -0x10(%rbp),%rax
shl    $0xa,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hugepage_bytes>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <local_read_meminfo@plt>
shl    $0xa,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Hugepagesize: %lu kB\00"
define i64 @get_hugepage_bytes() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 @local_read_meminfo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp ult i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i64 -1, i64* %1
br label %10
7: ; preds = %0
%8 = load i64, i64* %2
%9 = mul i64 %8, 1024
store i64 %9, i64* %1
br label %10
10: ; preds = %7, %6
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
@.str = [21 x i8] c"Hugepagesize: %lu kB\00"
define i64 @get_hugepage_bytes() {
%1 = tail call i64 @local_read_meminfo(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = shl i64 %1, 10
ret i64 %2
}
void SobelXYRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @SobelXYRow_Any_SSE2() {
ret void
}
/* Type definitions */
struct _reent {
  int dummy;
};

/* Variables and functions */
void *malloc(size_t);
void *_malloc_r(struct _reent *r, size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<_malloc_r>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
%struct._reent = type { i32 }
define i8* @_malloc_r(%struct._reent* %0, i64 %1) {
%3 = alloca %struct._reent*
%4 = alloca i64
store %struct._reent* %0, %struct._reent** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i8* @malloc(i64 %5)
ret i8* %6
}

LLVM IR (-O2):
%struct._reent = type { i32 }
define noalias i8* @_malloc_r(%struct._reent* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
int stop_rain() {}


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

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

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

LLVM IR (-O2):
define i32 @stop_rain() {
ret i32 undef
}
void d_fetchsl(register const unsigned char **ptr, register signed long *dest) {
  *dest = (((signed long)(*ptr)[0] << 24) | ((unsigned long)(*ptr)[1] << 16) |
           ((unsigned long)(*ptr)[2] << 8) | ((unsigned long)(*ptr)[3] << 0));
  *ptr += 4;
}


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

x86 assembly (clang, -O2):
<d_fetchsl>:
mov    (%rdi),%rax
mov    (%rax),%ecx
shl    $0x20,%rcx
bswap  %rcx
mov    %rcx,(%rsi)
add    $0x4,%rax
mov    %rax,(%rdi)
ret

LLVM IR (-O0):
define void @d_fetchsl(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 i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = shl i64 %9, 24
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i64
%16 = shl i64 %15, 16
%17 = or i64 %10, %16
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = zext i8 %21 to i64
%23 = shl i64 %22, 8
%24 = or i64 %17, %23
%25 = load i8**, i8*** %3
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i64
%30 = shl i64 %29, 0
%31 = or i64 %24, %30
%32 = load i64*, i64** %4
store i64 %31, i64* %32
%33 = load i8**, i8*** %3
%34 = load i8*, i8** %33
%35 = getelementptr inbounds i8, i8* %34, i64 4
store i8* %35, i8** %33
ret void
}

LLVM IR (-O2):
define void @d_fetchsl(i8** nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i64
%6 = shl nuw nsw i64 %5, 24
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 16
%11 = or i64 %10, %6
%12 = getelementptr inbounds i8, i8* %3, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i64
%15 = shl nuw nsw i64 %14, 8
%16 = or i64 %11, %15
%17 = getelementptr inbounds i8, i8* %3, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = or i64 %16, %19
store i64 %20, i64* %1
%21 = getelementptr inbounds i8, i8* %3, i64 4
store i8* %21, i8** %0
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ this_comparison_is_not_decidable();
void bla4ne(int var) {
  if (var - 10 != INT_MAX - 10)
    this_comparison_is_not_decidable();
}


x86 assembly (clang, -O0):
<bla4ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
sub    $0xa,%ecx
cmp    %ecx,%eax
je     113c <bla4ne+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_not_decidable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla4ne>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    111c <bla4ne+0xc>
ret
xor    %eax,%eax
jmp    1030 <this_comparison_is_not_decidable@plt>

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @bla4ne(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = icmp eq i32 %2, %0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_not_decidable()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *, char const *);
void failwith(const char *string) { fail("%s\n", string); }


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

x86 assembly (clang, -O2):
<failwith>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <fail@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @failwith(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @fail(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @failwith(i8* %0) {
%2 = tail call i32 @fail(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int usb_receivebyte(unsigned char *);
void usb_flush() {
  unsigned char tempbyte;
  while (usb_receivebyte(&tempbyte) == 1)
    ;
}


x86 assembly (clang, -O0):
<usb_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
call   1030 <usb_receivebyte@plt>
cmp    $0x1,%eax
jne    112f <usb_flush+0x1f>
jmp    1118 <usb_flush+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_flush>:
push   %rbx
sub    $0x10,%rsp
lea    0xf(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <usb_receivebyte@plt>
cmp    $0x1,%eax
je     1120 <usb_flush+0x10>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @usb_flush() {
%1 = alloca i8
br label %2
2: ; preds = %5, %0
%3 = call i32 @usb_receivebyte(i8* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @usb_flush() {
%1 = alloca i8
br label %2
2: ; preds = %2, %0
%3 = call i32 @usb_receivebyte(i8* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %2, label %5
5: ; preds = %2
ret void
}
/* Variables and functions */
int strspn(char *, char *);
float strtod(char *, char **);
int get_float(char **s, float *f) {
  register char *t;
  t = *s + strspn(*s, ",;:"
                      " \f\n\r\t\v");
  *f = strtod(t, s);
  return (t != *s);
}


x86 assembly (clang, -O0):
<get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
lea    0xeb7(%rip),%rsi
call   1040 <strspn@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strtod@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
mov    (%rdi),%r15
lea    0xec8(%rip),%rsi
mov    %r15,%rdi
call   1040 <strspn@plt>
movslq %eax,%rbx
add    %r15,%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1030 <strtod@plt>
movss  %xmm0,(%r14)
xor    %eax,%eax
cmp    (%r12),%rbx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c",;: \0C\0A\0D\09\0B\00"
define i32 @get_float(i8** %0, float* %1) {
%3 = alloca i8**
%4 = alloca float*
%5 = alloca i8*
store i8** %0, i8*** %3
store float* %1, float** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = load i8**, i8*** %3
%9 = load i8*, i8** %8
%10 = call i32 @strspn(i8* %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %7, i64 %11
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %3
%15 = call float @strtod(i8* %13, i8** %14)
%16 = load float*, float** %4
store float %15, float* %16
%17 = load i8*, i8** %5
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = icmp ne i8* %17, %19
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@.str = [10 x i8] c",;: \0C\0A\0D\09\0B\00"
define i32 @get_float(i8** nocapture %0, float* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @strspn(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = tail call float @strtod(i8* %6, i8** %0)
store float %7, float* %1
%8 = load i8*, i8** %0
%9 = icmp ne i8* %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void __bitmap_subset(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__bitmap_subset>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bitmap_subset>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__bitmap_subset = [16 x i8] c"__bitmap_subset\00"
define void @__bitmap_subset() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.__bitmap_subset, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__bitmap_subset = [16 x i8] c"__bitmap_subset\00"
define void @__bitmap_subset() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.__bitmap_subset, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cm_print_error(char *, char const *const, char const *const);
scalar_t__ strcmp(char const *const, char const *const);
int string_not_equal_display_error(const char *const left,
                                   const char *const right) {
  if (strcmp(left, right) != 0) {
    return 1;
  }
  cm_print_error("\"%s\" == \"%s\"\n", left, right);
  return 0;
}


x86 assembly (clang, -O0):
<string_not_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1153 <string_not_equal_display_error+0x33>
movl   $0x1,-0x4(%rbp)
jmp    116e <string_not_equal_display_error+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9e(%rip),%rdi
call   1030 <cm_print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_not_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1150 <string_not_equal_display_error+0x30>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <cm_print_error@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"\22%s\22 == \22%s\22\0A\00"
define i32 @string_not_equal_display_error(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @cm_print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int reverse(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int result, num;
  printf("Informe um numero: \n");
  scanf("%d", &num);
  result = reverse(num);
  printf("%d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x18(%rbp),%edi
call   1030 <reverse@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <reverse@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str = [20 x i8] c"Informe um numero: \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @reverse(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
__attribute__((error("No FIFO"))) void cc3_pixbuf_rewind(void) {}


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

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

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

LLVM IR (-O2):
define void @cc3_pixbuf_rewind() {
ret void
}
int gcd(int m, int n) {
  if (m < n) {
    int t = m;
    m = n;
    n = t;
  }
  while (n != 0) {
    int r = m % n;
    m = n;
    n = r;
  }
  return m;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
cmpl   $0x0,-0x8(%rbp)
je     1152 <gcd+0x52>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %edi,%eax
cmp    %esi,%edi
mov    %esi,%edx
cmovl  %edi,%edx
cmovl  %esi,%eax
test   %edx,%edx
je     111d <gcd+0x1d>
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = icmp eq i32 %4, 0
br i1 %6, label %12, label %7
7: ; preds = %2, %7
%8 = phi i32 [ %9, %7 ], [ %5, %2 ]
%9 = phi i32 [ %10, %7 ], [ %4, %2 ]
%10 = srem i32 %8, %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = phi i32 [ %5, %2 ], [ %9, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, void *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t get32(void *data) {
  union {
    char bytes[4];
    uint32_t all;
  } x;
  memcpy(x.bytes, data, 4);
  return (ntohl(x.all));
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
push   %rax
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @get32(i8* %0) {
%2 = alloca i8*
%3 = alloca %union.anon
store i8* %0, i8** %2
%4 = bitcast %union.anon* %3 to [4 x i8]*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 4)
%8 = bitcast %union.anon* %3 to i32*
%9 = load i32, i32* %8
%10 = call i32 @ntohl(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%union.anon = type { i32 }
define i32 @get32(i8* %0) {
%2 = alloca %union.anon
%3 = bitcast %union.anon* %2 to i8*
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 4)
%5 = getelementptr inbounds %union.anon, %union.anon* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = call i32 @ntohl(i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a;
  int b;
  int ans;
  a = 5;
  b = 5;
  ans = a * a + 2 * a * b + b * b;
  printf("%d", ans);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %2
%9 = mul nsw i32 2, %8
%10 = load i32, i32* %3
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %7, %11
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = mul nsw i32 %13, %14
%16 = add nsw i32 %12, %15
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 100)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int get_tcr();
__attribute__((unused)) uint8_t get_fit_period() {
  return (get_tcr() >> (24)) & (0x3);
}


x86 assembly (clang, -O0):
<get_fit_period>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_tcr@plt>
sar    $0x18,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fit_period>:
push   %rax
xor    %eax,%eax
call   1030 <get_tcr@plt>
shr    $0x18,%eax
and    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_fit_period() {
%1 = call i32 (...) @get_tcr()
%2 = ashr i32 %1, 24
%3 = and i32 %2, 3
ret i32 %3
}

LLVM IR (-O2):
define i32 @get_fit_period() {
%1 = tail call i32 (...) @get_tcr()
%2 = lshr i32 %1, 24
%3 = and i32 %2, 3
ret i32 %3
}
char *findnc(char *str, int n, char ch) {
  for (; str[0] && n; str++)
    if (str[0] == ch)
      n--;
  return str;
}


x86 assembly (clang, -O0):
<findnc>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xe(%rbp)
je     112f <findnc+0x2f>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
test   $0x1,%al
jne    113f <findnc+0x3f>
jmp    1171 <findnc+0x71>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0xd(%rbp),%ecx
cmp    %ecx,%eax
jne    115b <findnc+0x5b>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1160 <findnc+0x60>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <findnc+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findnc>:
mov    %rdi,%rax
mov    (%rdi),%r8b
test   %r8b,%r8b
je     112d <findnc+0x2d>
test   %esi,%esi
je     112d <findnc+0x2d>
nop
xor    %edi,%edi
cmp    %dl,%r8b
sete   %cl
movzbl 0x1(%rax),%r8d
add    $0x1,%rax
test   %r8b,%r8b
je     112d <findnc+0x2d>
mov    %cl,%dil
sub    %edi,%esi
jne    1110 <findnc+0x10>
ret

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

LLVM IR (-O2):
define i8* @findnc(i8* %0, i32 %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp ne i8 %4, 0
%6 = icmp ne i32 %1, 0
%7 = and i1 %5, %6
br i1 %7, label %8, label %20
8: ; preds = %3, %8
%9 = phi i8 [ %16, %8 ], [ %4, %3 ]
%10 = phi i8* [ %15, %8 ], [ %0, %3 ]
%11 = phi i32 [ %14, %8 ], [ %1, %3 ]
%12 = icmp eq i8 %9, %2
%13 = sext i1 %12 to i32
%14 = add nsw i32 %11, %13
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
%18 = icmp ne i32 %14, 0
%19 = select i1 %17, i1 %18, i1 false
br i1 %19, label %8, label %20
20: ; preds = %8, %3
%21 = phi i8* [ %0, %3 ], [ %15, %8 ]
ret i8* %21
}
unsigned char clamp_byte(int x) {
  return ((x) < 0 ? (0) : ((x) > 255 ? 255 : (x)));
}


x86 assembly (clang, -O0):
<clamp_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <clamp_byte+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <clamp_byte+0x41>
cmpl   $0xff,-0x4(%rbp)
jle    1135 <clamp_byte+0x35>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <clamp_byte+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_byte>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovg  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @clamp_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 255
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ 255, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi i32 [ 0, %5 ], [ %13, %12 ]
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @clamp_byte(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ first_keycode;
};
struct TYPE_4__ {
  TYPE_1__ xmapping;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xmapping_first_keycode(void *_p) {
  return (int)((XEvent *)_p)->xmapping.first_keycode;
}


x86 assembly (clang, -O0):
<get_XEvent_xmapping_first_keycode>:
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_xmapping_first_keycode>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xmapping_first_keycode(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_xmapping_first_keycode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int exact_minmax_sym(int);
void call_exact_minmax_sym_Good() {
  int x = 5;
  int a[x];
  a[exact_minmax_sym(x) - 1] = 0;
}


x86 assembly (clang, -O0):
<call_exact_minmax_sym_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exact_minmax_sym@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_exact_minmax_sym_Good>:
mov    $0x5,%edi
jmp    1030 <exact_minmax_sym@plt>

LLVM IR (-O0):
define void @call_exact_minmax_sym_Good() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
store i32 5, i32* %1
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i32, i64 %5
store i64 %5, i64* %3
%8 = load i32, i32* %1
%9 = call i32 @exact_minmax_sym(i32 %8)
%10 = sub nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %7, i64 %11
store i32 0, i32* %12
%13 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @call_exact_minmax_sym_Good() {
%1 = tail call i32 @exact_minmax_sym(i32 5)
ret void
}
double log10(x)
double x;
{ return log(x) * 0.4342944819; }


x86 assembly (clang, -O0):
<log10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log10>:
push   %rax
call   1030 <log@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = fmul double %4, 0x3FDBCB7B1526003A
ret double %5
}

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double @log(double %0)
%3 = fmul double %2, 0x3FDBCB7B1526003A
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char, unsigned char,
                           char *);
void lineprint2(char *outf, long ctr, unsigned char *op, char *outstring) {
  sprintf(outf, "%02X %02X       %s", *op, *(op + 1), outstring);
}


x86 assembly (clang, -O0):
<lineprint2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%al
mov    -0x20(%rbp),%r8
lea    0xebc(%rip),%rsi
movzbl %cl,%edx
movzbl %al,%ecx
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lineprint2>:
mov    %rcx,%r8
movzbl (%rdx),%eax
movzbl 0x1(%rdx),%ecx
lea    0xedf(%rip),%rsi
mov    %eax,%edx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"%02X %02X %s\00"
define void @lineprint2(i8* %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = load i8, i8* %10
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = load i8*, i8** %8
%16 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 zeroext %11, i8 zeroext %14, i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"%02X %02X %s\00"
define void @lineprint2(i8* nocapture writeonly %0, i64 %1, i8* nocapture %2, i8* %3) {
%5 = load i8, i8* %2
%6 = getelementptr inbounds i8, i8* %2, i64 1
%7 = load i8, i8* %6
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8 zeroext %5, i8 zeroext %7, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
char *strstr(char *, char *);
void escape_space(char *buf) {
  char *p, *p2;
  p2 = buf;
  while ((p = strstr(p2, "\\ ")) != NULL) {
    *p++ = 0;
    strcat(buf, p);
    p2 = buf;
  }
}


x86 assembly (clang, -O0):
<escape_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     117e <escape_space+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <escape_space+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<escape_space>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1162 <escape_space+0x42>
lea    0xec1(%rip),%r14
nop
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
jne    1140 <escape_space+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"\\ \00"
define void @escape_space(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %8, %4 ], [ %2, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 0, i8* %5
%7 = tail call i32 @strcat(i8* %0, i8* %6)
%8 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Type definitions */
struct rlimit {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int getrlimit(int resource, struct rlimit *rlim) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<getrlimit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.rlimit = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @getrlimit(i32 %0, %struct.rlimit* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}