xunge/DecIR huggingface dataset:
int SearchWordInTweet(unsigned *tweet, unsigned len, unsigned wordId) {
  unsigned int i = 0;
  while (i < len) {
    if (tweet[i] == wordId)
      return i;
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<SearchWordInTweet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    114d <SearchWordInTweet+0x4d>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    113f <SearchWordInTweet+0x3f>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1154 <SearchWordInTweet+0x54>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <SearchWordInTweet+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SearchWordInTweet>:
mov    $0xffffffff,%eax
test   %esi,%esi
je     111e <SearchWordInTweet+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <SearchWordInTweet+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <SearchWordInTweet+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @SearchWordInTweet(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
scalar_t__ make_big_window(char *, int, int, int, int);
int vis5d_init_window(char *title, int x, int y, int width, int height) {
  if (make_big_window(title, x, y, width, height)) {
    return 0;
  } else {
    return -7;
  }
}


x86 assembly (clang, -O0):
<vis5d_init_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1030 <make_big_window@plt>
cmp    $0x0,%rax
je     1155 <vis5d_init_window+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115c <vis5d_init_window+0x4c>
movl   $0xfffffff9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vis5d_init_window>:
push   %rax
call   1030 <make_big_window@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0xfffffff9,%eax
cmovne %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vis5d_init_window(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i64 @make_big_window(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 -7, i32 0
ret i32 %8
}
void debug_print(const char *message, ...) {}


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

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

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

LLVM IR (-O2):
define void @debug_print(i8* nocapture %0, ...) {
ret void
}
unsigned le_uint24_read(const void *ptr) {
  const unsigned char *ptr8 = (const unsigned char *)ptr;
  return (unsigned)ptr8[0] | (unsigned)ptr8[1] << 8 | (unsigned)ptr8[2] << 16;
}


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

x86 assembly (clang, -O2):
<le_uint24_read>:
movzwl (%rdi),%ecx
movzbl 0x2(%rdi),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @le_uint24_read(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 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %8, %13
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 16
%20 = or i32 %14, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @le_uint24_read(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}
void avcodec_default_get_buffer2() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_default_get_buffer2() {
ret void
}
int test_imm_9Cuint8_reg(unsigned char val) {
  return ((val) & (0x9C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x9c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_9Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -100
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void handler(int signum) {
  printf("\n %s: \n", __func__);
  printf("We have received signal :  %d \n", signum);
  printf(" exit from sighandler \n");
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xed7(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee1(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.handler = [8 x i8] c"handler\00"
@.str.1 = [32 x i8] c"We have received signal : %d \0A\00"
@.str.2 = [24 x i8] c" exit from sighandler \0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.handler, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %s: \0A\00"
@__func__.handler = [8 x i8] c"handler\00"
@.str.1 = [32 x i8] c"We have received signal : %d \0A\00"
@str = [23 x i8] c" exit from sighandler \00"
define void @handler(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__func__.handler, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
__attribute__((no, noclone)) void bar(char x) {
  if (x != 0x54 && x != (char)0x87)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x54,%eax
je     113d <bar+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0xffffff87,%eax
je     113d <bar+0x2d>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x87,%dil
je     111c <bar+0xc>
cmp    $0x54,%dil
jne    111d <bar+0xd>
ret
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 84
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, -121
br i1 %9, label %10, label %11
10: ; preds = %6
unreachable
11: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @bar(i8 signext %0) {
switch i8 %0, label %2 [
i8 -121, label %3
i8 84, label %3
]
2: ; preds = %1
tail call void @abort()
unreachable
3: ; preds = %1, %1
ret void
}
/* Variables and functions */
scalar_t__ calloc(size_t, int);
int /*<<< orphan*/ nrerror(char *);
short *svector0(long nl, long nh) {
  short *v;
  v = (short *)calloc((size_t)(nh - nl + 1 + 0), sizeof(short));
  if (!v)
    nrerror("allocation failure in svector0()");
  return v - nl + 0;
}


x86 assembly (clang, -O0):
<svector0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
mov    $0x2,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1165 <svector0+0x45>
lea    0xea0(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svector0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x1(%rsi),%rdi
mov    $0x2,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <svector0+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <nrerror@plt>
add    %r14,%r14
sub    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"allocation failure in svector0()\00"
define i16* @svector0(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = call i64 @calloc(i64 %10, i32 2)
%12 = inttoptr i64 %11 to i16*
store i16* %12, i16** %5
%13 = load i16*, i16** %5
%14 = icmp ne i16* %13, null
br i1 %14, label %17, label %15
15: ; preds = %2
%16 = call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %2
%18 = load i16*, i16** %5
%19 = load i64, i64* %3
%20 = sub i64 0, %19
%21 = getelementptr inbounds i16, i16* %18, i64 %20
%22 = getelementptr inbounds i16, i16* %21, i64 0
ret i16* %22
}

LLVM IR (-O2):
@.str = [33 x i8] c"allocation failure in svector0()\00"
define i16* @svector0(i64 %0, i64 %1) {
%3 = sub i64 1, %0
%4 = add i64 %3, %1
%5 = tail call i64 @calloc(i64 %4, i32 2)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @nrerror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = sub i64 0, %0
%11 = inttoptr i64 %5 to i16*
%12 = getelementptr inbounds i16, i16* %11, i64 %10
ret i16* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char fgetc(int /*<<< orphan*/ *);
void gotochar(FILE *file, char character) {
  while (fgetc(file) != character)
    ;
}


x86 assembly (clang, -O0):
<gotochar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
movsbl %al,%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     113f <gotochar+0x2f>
jmp    1122 <gotochar+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gotochar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    %bpl,%al
jne    1120 <gotochar+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @gotochar(i32* %0, i8 signext %1) {
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %12, %2
%6 = load i32*, i32** %3
%7 = call signext i8 @fgetc(i32* %6)
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %13
12: ; preds = %5
br label %5
13: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @gotochar(i32* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call signext i8 @fgetc(i32* %0)
%5 = icmp eq i8 %4, %1
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ remove(char *);
bool files_delete(char *path) {
  assert(path);
  return remove(path) == 0;
}


x86 assembly (clang, -O0):
<files_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_delete>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @files_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @remove(i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @files_delete(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i64 @remove(i8* %0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
char *EndOfString(char *string) {
  while (*string)
    string++;
  return string;
}


x86 assembly (clang, -O0):
<EndOfString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1126 <EndOfString+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <EndOfString+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EndOfString>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rax)
lea    0x1(%rax),%rax
jne    1110 <EndOfString+0x10>
ret

LLVM IR (-O0):
define i8* @EndOfString(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
br label %3
10: ; preds = %3
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @EndOfString(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
void test1() { asm volatile("test1_ill: ud2"); }


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

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

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

LLVM IR (-O2):
define void @test1() {
tail call void asm sideeffect "test1_ill: ud2", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int FS460_powerdown();
int /*<<< orphan*/ initialize_device_settings();
int /*<<< orphan*/ isr_enable_interrupts(int);
int set_defaults();
int FS460_reset(void) {
  int err;
  err = FS460_powerdown();
  if (err)
    return err;
  initialize_device_settings();
  err = set_defaults();
  if (err)
    return err;
  isr_enable_interrupts(1);
  return 0;
}


x86 assembly (clang, -O0):
<FS460_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <FS460_powerdown@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1167 <FS460_reset+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119e <FS460_reset+0x5e>
mov    $0x0,%al
call   1050 <initialize_device_settings@plt>
mov    $0x0,%al
call   1030 <set_defaults@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118d <FS460_reset+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119e <FS460_reset+0x5e>
mov    $0x1,%edi
call   1040 <isr_enable_interrupts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS460_reset>:
push   %rax
xor    %eax,%eax
call   1060 <FS460_powerdown@plt>
test   %eax,%eax
je     114e <FS460_reset+0xe>
pop    %rcx
ret
xor    %eax,%eax
call   1050 <initialize_device_settings@plt>
xor    %eax,%eax
call   1030 <set_defaults@plt>
test   %eax,%eax
jne    114c <FS460_reset+0xc>
mov    $0x1,%edi
call   1040 <isr_enable_interrupts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FS460_reset() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @FS460_powerdown()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = load i32, i32* %2
store i32 %7, i32* %1
br label %17
8: ; preds = %0
%9 = call i32 (...) @initialize_device_settings()
%10 = call i32 (...) @set_defaults()
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i32, i32* %2
store i32 %14, i32* %1
br label %17
15: ; preds = %8
%16 = call i32 @isr_enable_interrupts(i32 1)
store i32 0, i32* %1
br label %17
17: ; preds = %15, %13, %6
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @FS460_reset() {
%1 = tail call i32 (...) @FS460_powerdown()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = tail call i32 (...) @initialize_device_settings()
%5 = tail call i32 (...) @set_defaults()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @isr_enable_interrupts(i32 1)
br label %9
9: ; preds = %3, %0, %7
%10 = phi i32 [ 0, %7 ], [ %1, %0 ], [ %5, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int c, char **argv) {
  printf("This is just a dummy program to satisfy premake");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%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
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"This is just a dummy program to satisfy premake\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"This is just a dummy program to satisfy premake\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ USART_transmit(int);
void sendBufferOverflow() {
  USART_transmit(0xEE);
  USART_transmit(0xFF);
  USART_transmit(0xEF);
}


x86 assembly (clang, -O0):
<sendBufferOverflow>:
push   %rbp
mov    %rsp,%rbp
mov    $0xee,%edi
call   1030 <USART_transmit@plt>
mov    $0xff,%edi
call   1030 <USART_transmit@plt>
mov    $0xef,%edi
call   1030 <USART_transmit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendBufferOverflow>:
push   %rax
mov    $0xee,%edi
call   1030 <USART_transmit@plt>
mov    $0xff,%edi
call   1030 <USART_transmit@plt>
mov    $0xef,%edi
pop    %rax
jmp    1030 <USART_transmit@plt>

LLVM IR (-O0):
define void @sendBufferOverflow() {
%1 = call i32 @USART_transmit(i32 238)
%2 = call i32 @USART_transmit(i32 255)
%3 = call i32 @USART_transmit(i32 239)
ret void
}

LLVM IR (-O2):
define void @sendBufferOverflow() {
%1 = tail call i32 @USART_transmit(i32 238)
%2 = tail call i32 @USART_transmit(i32 255)
%3 = tail call i32 @USART_transmit(i32 239)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
int32_t UP3D_GetHF(int heater) {
  if ((heater < 1) || (heater > 4))
    return -1;
  return UP3D_GetParameter(0x18 + heater - 1);
}


x86 assembly (clang, -O0):
<UP3D_GetHF>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     112f <UP3D_GetHF+0x1f>
cmpl   $0x4,-0x8(%rbp)
jle    113b <UP3D_GetHF+0x2b>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <UP3D_GetHF+0x3c>
mov    -0x8(%rbp),%edi
add    $0x18,%edi
sub    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetHF>:
lea    -0x5(%rdi),%eax
cmp    $0xfffffffc,%eax
jae    111e <UP3D_GetHF+0xe>
mov    $0xffffffff,%eax
ret
add    $0x17,%edi
jmp    1030 <UP3D_GetParameter@plt>

LLVM IR (-O0):
define i32 @UP3D_GetHF(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 4
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 -1, i32* %2
br label %15
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 24, %11
%13 = sub nsw i32 %12, 1
%14 = call i32 @UP3D_GetParameter(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @UP3D_GetHF(i32 %0) {
%2 = add i32 %0, -5
%3 = icmp ult i32 %2, -4
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = add nuw nsw i32 %0, 23
%6 = tail call i32 @UP3D_GetParameter(i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ -1, %1 ]
ret i32 %8
}
signed long zabs(signed long argx) {
  if (argx < 0)
    return argx;
  else
    return -argx;
}


x86 assembly (clang, -O0):
<zabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1120 <zabs+0x20>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <zabs+0x2a>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zabs>:
mov    %rdi,%rax
neg    %rax
cmovns %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @zabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 false)
%3 = sub i64 0, %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ _Time(int /*<<< orphan*/ *);
time_t time(time_t *tod) {
  time_t t = _Time(NULL);
  if (tod)
    *tod = t;
  return (t);
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <_Time@plt>
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113c <time+0x2c>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
call   1030 <_Time@plt>
test   %rbx,%rbx
je     1122 <time+0x12>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @time(i32* writeonly %0) {
%2 = tail call i32 @_Time(i32* null)
%3 = icmp eq i32* %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* %0
br label %5
5: ; preds = %4, %1
ret i32 %2
}
void cpuid(unsigned info, unsigned *eax, unsigned *ebx, unsigned *ecx,
           unsigned *edx) {
  *eax = info;
  __asm volatile("mov %%ebx, %%edi;"
                 "cpuid;"
                 "mov %%ebx, %%esi;"
                 "mov %%edi, %%ebx;"
                 : "+a"(*eax), "=S"(*ebx), "=c"(*ecx), "=d"(*edx)
                 :
                 : "edi");
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%r9
mov    (%r9),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x40(%rbp)
mov    -0x20(%rbp),%rcx
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x38(%rbp)
mov    %ebx,%edi
cpuid
mov    %ebx,%esi
mov    %edi,%ebx
mov    -0x40(%rbp),%rdi
mov    %eax,%r10d
mov    -0x38(%rbp),%rax
mov    %esi,%r8d
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r10d,(%r9)
mov    %r8d,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %rcx,%r9
mov    %rdx,%r10
mov    %rsi,%r11
mov    %edi,%eax
mov    %edi,(%rsi)
mov    %ebx,%edi
cpuid
mov    %ebx,%esi
mov    %edi,%ebx
mov    %eax,(%r11)
mov    %esi,(%r10)
mov    %ecx,(%r9)
mov    %edx,(%r8)
ret

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = call { i32, i32, i32, i32 } asm sideeffect "mov %ebx, %edi;cpuid;mov %ebx, %esi;mov %edi, %ebx;", "={ax},={si},={cx},={dx},0,~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %14)
%19 = extractvalue { i32, i32, i32, i32 } %18, 0
%20 = extractvalue { i32, i32, i32, i32 } %18, 1
%21 = extractvalue { i32, i32, i32, i32 } %18, 2
%22 = extractvalue { i32, i32, i32, i32 } %18, 3
store i32 %19, i32* %13
store i32 %20, i32* %15
store i32 %21, i32* %16
store i32 %22, i32* %17
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
store i32 %0, i32* %1
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "mov %ebx, %edi;cpuid;mov %ebx, %esi;mov %edi, %ebx;", "={ax},={si},={cx},={dx},0,~{edi},~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %3
store i32 %10, i32* %4
ret void
}
int MOD_ASSIGN(int x, int y) { return x %= y; }


x86 assembly (clang, -O0):
<MOD_ASSIGN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOD_ASSIGN>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @MOD_ASSIGN(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void PrintVersion(void) {
  printf("bdf2c Version %s, (c) 2009, 2010 by Lutz Sammer\n"
         "\tLicense AGPLv3: GNU Affero General Public License version 3\n",
         "3");
}


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

x86 assembly (clang, -O2):
<PrintVersion>:
lea    0xee9(%rip),%rdi
lea    0xf50(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [110 x i8] c"bdf2c Version %s, (c) 2009, 2010 by Lutz Sammer\0A\09License AGPLv3: GNU Affero General Public License version 3\0A\00"
@.str.1 = [2 x i8] c"3\00"
define void @PrintVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [110 x i8] c"bdf2c Version %s, (c) 2009, 2010 by Lutz Sammer\0A\09License AGPLv3: GNU Affero General Public License version 3\0A\00"
@.str.1 = [2 x i8] c"3\00"
define void @PrintVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void putword(w) int w;
{
  putbyte(w);
  putbyte(w >> 8);
}


x86 assembly (clang, -O0):
<putword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <putbyte@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
mov    $0x0,%al
call   1030 <putbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putword>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <putbyte@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1030 <putbyte@plt>

LLVM IR (-O0):
define void @putword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putbyte to i32 (i32, ...)*)(i32 %3)
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = call i32 (i32, ...) bitcast (i32 (...)* @putbyte to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @putword(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putbyte to i32 (i32, ...)*)(i32 %0)
%3 = ashr i32 %0, 8
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @putbyte to i32 (i32, ...)*)(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t
sdp_event_query_attribute_byte_get_attribute_length(const uint8_t *event) {
  return little_endian_read_16(event, 6);
}


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

x86 assembly (clang, -O2):
<sdp_event_query_attribute_byte_get_attribute_length>:
mov    $0x6,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @sdp_event_query_attribute_byte_get_attribute_length(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 6)
ret i32 %2
}
int fun314() { return 314; }


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

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

LLVM IR (-O0):
define i32 @fun314() {
ret i32 314
}

LLVM IR (-O2):
define i32 @fun314() {
ret i32 314
}
/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char *gets(char *buf) { return fgets(buf, 1024, stdin); }


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1030 <fgets@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
jmp    1030 <fgets@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i8* @gets(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stdin
%5 = call i8* @fgets(i8* %3, i32 1024, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@stdin = global i32 0
define i8* @gets(i8* %0) {
%2 = load i32, i32* @stdin
%3 = tail call i8* @fgets(i8* %0, i32 1024, i32 %2)
ret i8* %3
}
/* Variables and functions */
scalar_t__ access(char const *, int /*<<< orphan*/);
int exists_file(const char *filename) { return (access(filename, 0) == 0); }


x86 assembly (clang, -O0):
<exists_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <access@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists_file>:
push   %rax
xor    %esi,%esi
call   1030 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @exists_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @access(i8* %3, i32 0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @exists_file(i8* nocapture %0) {
%2 = tail call i64 @access(i8* %0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ expression();
int /*<<< orphan*/ match(char);
void equals() {
  match('=');
  expression();
  emitln("pop\t%%ebx");
  emitln("cmp\t%%eax,%%ebx");
  emitln("sete\t%%al");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


x86 assembly (clang, -O0):
<equals>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3d,%edi
call   1050 <match@plt>
mov    $0x0,%al
call   1040 <expression@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb2(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<equals>:
push   %rax
mov    $0x3d,%edi
call   1050 <match@plt>
xor    %eax,%eax
call   1040 <expression@plt>
lea    0xeb7(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb5(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb9(%rip),%rdi
call   1030 <emitln@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"cmp\09%%eax,%%ebx\00"
@.str.2 = [10 x i8] c"sete\09%%al\00"
@.str.3 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @equals() {
%1 = call i32 @match(i8 signext 61)
%2 = call i32 (...) @expression()
%3 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"pop\09%%ebx\00"
@.str.1 = [16 x i8] c"cmp\09%%eax,%%ebx\00"
@.str.2 = [10 x i8] c"sete\09%%al\00"
@.str.3 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @equals() {
%1 = tail call i32 @match(i8 signext 61)
%2 = tail call i32 (...) @expression()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @emitln(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inb(int, int);
int is_transmit_empty() {
  return inb((0xa0000000 + 0x14000000 + 0x03f8), 5) & 0x20;
}


x86 assembly (clang, -O0):
<is_transmit_empty>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb40003f8,%edi
mov    $0x5,%esi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_transmit_empty>:
push   %rax
mov    $0xb40003f8,%edi
mov    $0x5,%esi
call   1030 <inb@plt>
and    $0x20,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_transmit_empty() {
%1 = call i32 @inb(i32 -1275067400, i32 5)
%2 = and i32 %1, 32
ret i32 %2
}

LLVM IR (-O2):
define i32 @is_transmit_empty() {
%1 = tail call i32 @inb(i32 -1275067400, i32 5)
%2 = and i32 %1, 32
ret i32 %2
}
int hex(int ch) {
  if ((ch >= '0') && (ch <= '9'))
    return (ch - '0');
  if ((ch >= 'a') && (ch <= 'f'))
    return (ch - 'a' + 10);
  if ((ch >= 'A') && (ch <= 'F'))
    return (ch - 'A' + 10);
  return (-1);
}


x86 assembly (clang, -O0):
<hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <hex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <hex+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex+0x7a>
cmpl   $0x61,-0x8(%rbp)
jl     114e <hex+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex+0x7a>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <hex+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <hex+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex+0x7a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1127 <hex+0x27>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <hex+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
add    $0xffffffc9,%edi
cmp    $0x6,%eax
mov    $0xffffffff,%eax
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %33
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %33
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %25, %22
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %28, %18, %9
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 -1
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
/* Variables and functions */
int break_here();
int funcC() { return break_here(); }


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

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

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

LLVM IR (-O2):
define i32 @funcC() {
%1 = tail call i32 (...) @break_here()
ret i32 %1
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a = 0;
  scanf("%d", &a);
  printf("The factorial of %d is %d\n", a, factorial(a));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
lea    0xea3(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"The factorial of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @factorial(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [27 x i8] c"The factorial of %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @factorial(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_ttymodes(int);
int /*<<< orphan*/ setup_terminal(char *);
void initterminal(int pn) {
  init_ttymodes(pn);
  setup_terminal("");
}


x86 assembly (clang, -O0):
<initterminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <init_ttymodes@plt>
lea    0xec6(%rip),%rdi
call   1030 <setup_terminal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initterminal>:
push   %rax
call   1040 <init_ttymodes@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <setup_terminal@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @initterminal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @init_ttymodes(i32 %3)
%5 = call i32 @setup_terminal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @initterminal(i32 %0) {
%2 = tail call i32 @init_ttymodes(i32 %0)
%3 = tail call i32 @setup_terminal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void interfacefree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<interfacefree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @interfacefree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned int *, int, int, int /*<<< orphan*/ *);
int ephcom_outint(FILE *outfp, unsigned u) {
  unsigned u2;
  unsigned gnulliver32(unsigned);
  u2 = gnulliver32(u);
  fwrite(&u2, 4, 1, outfp);
  return (0);
}


x86 assembly (clang, -O0):
<ephcom_outint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <gnulliver32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <fwrite@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ephcom_outint>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <gnulliver32@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ephcom_outint(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @gnulliver32(i32 %6)
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = call i32 @fwrite(i32* %5, i32 4, i32 1, i32* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @ephcom_outint(i32* nocapture %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @gnulliver32(i32 %1)
store i32 %5, i32* %3
%6 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32* %0)
ret i32 0
}