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


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__toggle() {
%1 = tail call i32 (...) @Msp430GpioC__9__GeneralIO__toggle()
ret void
}
int foo_int(void) {
  _Complex int a = 123 + 45I;
  return __real__ a;
}


x86 assembly (clang, -O0):
<foo_int>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7b,-0x8(%rbp)
movl   $0x2d,-0x4(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo_int() {
%1 = alloca { i32, i32 }
%2 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0
%3 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 1
store i32 123, i32* %2
store i32 45, i32* %3
%4 = getelementptr inbounds { i32, i32 }, { i32, i32 }* %1, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @foo_int() {
ret i32 123
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
scalar_t__ is_pangram(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char string[1000];
  fgets(string, 1000, stdin);
  if (is_pangram(string)) {
    printf("pangram");
  } else {
    printf("not pangram");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x3e8,%esi
call   1040 <fgets@plt>
lea    -0x3f0(%rbp),%rdi
call   1050 <is_pangram@plt>
cmp    $0x0,%rax
je     1183 <main+0x53>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
jmp    118f <main+0x5f>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <fgets@plt>
mov    %rbx,%rdi
call   1050 <is_pangram@plt>
test   %rax,%rax
lea    0xe9d(%rip),%rax
lea    0xe9a(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [8 x i8] c"pangram\00"
@.str.1 = [12 x i8] c"not pangram\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 1000, i32 %4)
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i64 @is_pangram(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [8 x i8] c"pangram\00"
@.str.1 = [12 x i8] c"not pangram\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 1000, i32 %3)
%5 = call i64 @is_pangram(i8* %2)
%6 = icmp eq i64 %5, 0
%7 = select i1 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
int close_i2c(int fileid) {
  printf("\n%s(+):", __FUNCTION__);
  if (fileid) {
    close(fileid);
  }
  printf("\n%s(-):", __FUNCTION__);
}


x86 assembly (clang, -O0):
<close_i2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1154 <close_i2c+0x34>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
lea    0xeb7(%rip),%rdi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_i2c>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xed7(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
test   %ebx,%ebx
je     1145 <close_i2c+0x25>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <close@plt>
lea    0xec6(%rip),%rdi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0A%s(+):\00"
@__FUNCTION__.close_i2c = [10 x i8] c"close_i2c\00"
@.str.1 = [8 x i8] c"\0A%s(-):\00"
define i32 @close_i2c(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.close_i2c, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %8)
br label %10
10: ; preds = %7, %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.close_i2c, i64 0, i64 0))
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0A%s(+):\00"
@__FUNCTION__.close_i2c = [10 x i8] c"close_i2c\00"
@.str.1 = [8 x i8] c"\0A%s(-):\00"
define i32 @close_i2c(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 ([10 x i8], [10 x i8]* @__FUNCTION__.close_i2c, i64 0, i64 0))
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__FUNCTION__.close_i2c, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void copyopenfiles(FILE *f1, FILE *f2) {
  int c;
  while ((c = fgetc(f1)) != EOF)
    fputc(c, f2);
}


x86 assembly (clang, -O0):
<copyopenfiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <copyopenfiles+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <fputc@plt>
jmp    1130 <copyopenfiles+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyopenfiles>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <copyopenfiles+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    (%r15),%eax
jne    1140 <copyopenfiles+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define void @copyopenfiles(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @fputc(i32 %7, i32* %1)
%9 = tail call i32 @fgetc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
void fn0000000140001918() { return; }


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @fn0000000140001918() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
int askUserYesNoQuestion(char *whatToAsk) {
  char input[80];
  printf("%s\n", whatToAsk);
  scanf("%s", input);
  if (input[0] == 'Y' || input[0] == 'y') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<askUserYesNoQuestion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1040 <scanf@plt>
movsbl -0x60(%rbp),%eax
cmp    $0x59,%eax
je     1166 <askUserYesNoQuestion+0x46>
movsbl -0x60(%rbp),%eax
cmp    $0x79,%eax
jne    1172 <askUserYesNoQuestion+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1179 <askUserYesNoQuestion+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<askUserYesNoQuestion>:
sub    $0x58,%rsp
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x59,%cl
sete   %al
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @askUserYesNoQuestion(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [80 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 89
br i1 %12, label %18, label %13
13: ; preds = %1
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 121
br i1 %17, label %18, label %19
18: ; preds = %13, %1
store i32 1, i32* %2
br label %20
19: ; preds = %13
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @askUserYesNoQuestion(i8* %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%6 = load i8, i8* %3
%7 = and i8 %6, -33
%8 = icmp eq i8 %7, 89
%9 = zext i1 %8 to i32
ret i32 %9
}
int test_imm_2Aint32_mem(int *val) {
  return ((*val) & (0x2A << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Aint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 42
%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_2Aint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 42
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ FlushInput();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
char toupper(char);
char GetCharInput(char *c) {
  scanf(" %c", c);
  FlushInput();
  printf("\n");
  *c = toupper(*c);
  return *c;
}


x86 assembly (clang, -O0):
<GetCharInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1050 <FlushInput@plt>
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCharInput>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <FlushInput@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %c\00"
define signext i8 @GetCharInput(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @FlushInput()
%4 = tail call i32 @putchar(i32 10)
%5 = load i8, i8* %0
%6 = tail call signext i8 @toupper(i8 signext %5)
store i8 %6, i8* %0
ret i8 %6
}
/* Variables and functions */
int AT_REMOVEDIR;
int /*<<< orphan*/ dir_mutex_lock(int);
int /*<<< orphan*/ dir_mutex_unlock();
int rmdir(char const *);
int unlink(char const *);
int unlinkat(int dirfd, const char *pathname, int flags) {
  int rc;
  dir_mutex_lock(dirfd);
  if (flags == AT_REMOVEDIR)
    rc = rmdir(pathname);
  else
    rc = unlink(pathname);
  dir_mutex_unlock();
  return rc;
}


x86 assembly (clang, -O0):
<unlinkat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dir_mutex_lock@plt>
mov    -0x14(%rbp),%eax
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%eax
jne    117d <unlinkat+0x3d>
mov    -0x10(%rbp),%rdi
call   1050 <rmdir@plt>
mov    %eax,-0x18(%rbp)
jmp    1189 <unlinkat+0x49>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <dir_mutex_unlock@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlinkat>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1040 <dir_mutex_lock@plt>
mov    0x2e8c(%rip),%rax
cmp    %ebp,(%rax)
jne    1162 <unlinkat+0x22>
mov    %rbx,%rdi
call   1050 <rmdir@plt>
jmp    116a <unlinkat+0x2a>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <dir_mutex_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@AT_REMOVEDIR = global i32 0
define i32 @unlinkat(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = call i32 @dir_mutex_lock(i32 %8)
%10 = load i32, i32* %6
%11 = load i32, i32* @AT_REMOVEDIR
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @rmdir(i8* %14)
store i32 %15, i32* %7
br label %19
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = call i32 @unlink(i8* %17)
store i32 %18, i32* %7
br label %19
19: ; preds = %16, %13
%20 = call i32 (...) @dir_mutex_unlock()
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@AT_REMOVEDIR = global i32 0
define i32 @unlinkat(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @dir_mutex_lock(i32 %0)
%5 = load i32, i32* @AT_REMOVEDIR
%6 = icmp eq i32 %5, %2
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @rmdir(i8* %1)
br label %11
9: ; preds = %3
%10 = tail call i32 @unlink(i8* %1)
br label %11
11: ; preds = %9, %7
%12 = phi i32 [ %8, %7 ], [ %10, %9 ]
%13 = tail call i32 (...) @dir_mutex_unlock()
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ find_length_without_trailing(char *, char *, char *);
int parse_read(char **, char **, int /*<<< orphan*/);
int parse_read_to_without_trailing(char **buf, char **readbuf, char *reject,
                                   char *trailing_reject) {
  return parse_read(
      buf, readbuf,
      find_length_without_trailing(*buf, trailing_reject, reject));
}


x86 assembly (clang, -O0):
<parse_read_to_without_trailing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <find_length_without_trailing@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1030 <parse_read@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_read_to_without_trailing>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    %rcx,%rsi
call   1040 <find_length_without_trailing@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <parse_read@plt>

LLVM IR (-O0):
define i32 @parse_read_to_without_trailing(i8** %0, i8** %1, i8* %2, i8* %3) {
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i8*
store i8** %0, i8*** %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8**, i8*** %5
%10 = load i8**, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8*, i8** %8
%14 = load i8*, i8** %7
%15 = call i32 @find_length_without_trailing(i8* %12, i8* %13, i8* %14)
%16 = call i32 @parse_read(i8** %9, i8** %10, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @parse_read_to_without_trailing(i8** %0, i8** %1, i8* %2, i8* %3) {
%5 = load i8*, i8** %0
%6 = tail call i32 @find_length_without_trailing(i8* %5, i8* %3, i8* %2)
%7 = tail call i32 @parse_read(i8** %0, i8** %1, i32 %6)
ret i32 %7
}
void unit_test_noop(void) {}


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

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

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

LLVM IR (-O2):
define void @unit_test_noop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
void test_continue_do_while() {
  printf("\n===== test_continue_do_while\n");
  int result = 1;
  int alt_result = 1;
  do {
    ++result;
    if (result < 10)
      continue;
    ++alt_result;
  } while (result < 10);
  assert(result == 10);
  assert(alt_result == 2);
}


x86 assembly (clang, -O0):
<test_continue_do_while>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    115a <test_continue_do_while+0x3a>
jmp    1163 <test_continue_do_while+0x43>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1142 <test_continue_do_while+0x22>
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_continue_do_while>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <assert@plt>

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

LLVM IR (-O2):
@str = [30 x i8] c"\0A===== test_continue_do_while\00"
define void @test_continue_do_while() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret void
}
int main(int argc, char const *argv[]) {
  int x, y, *ip;
  x = 1;
  y = 2;
  ip = &x;
  x = 3;
  y = *ip;
  *ip = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x3,-0x14(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
store i32 2, i32* %7
store i32* %6, i32** %8
store i32 3, i32* %6
%9 = load i32*, i32** %8
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32*, i32** %8
store i32 0, i32* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int test_imm_ABint64_midword_reg(long long val) {
  return ((val >> 16) & (0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xab,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ABint64_midword_reg>:
test   $0xab0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ABint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 171
%6 = icmp ne i64 %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_ABint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11206656
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int tgetflag(int /*<<< orphan*/);
int vl_tgetflag(const char *name) {
  char temp[10];
  return tgetflag(strcpy(temp, name));
}


x86 assembly (clang, -O0):
<vl_tgetflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %eax,%edi
call   1040 <tgetflag@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vl_tgetflag>:
sub    $0x18,%rsp
mov    %rdi,%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
mov    %eax,%edi
call   1040 <tgetflag@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @vl_tgetflag(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = call i32 @tgetflag(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @vl_tgetflag(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @tgetflag(i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *command) {
  fprintf(stderr,
          "Usage: %s -f <filename> [-b <block size (in KB)>] [-s <file size "
          "(in KB)]\n",
          command);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: %s -f <filename> [-b <block size (in KB)>] [-s <file size (in KB)]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [75 x i8] c"Usage: %s -f <filename> [-b <block size (in KB)>] [-s <file size (in KB)]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void INT_P7(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_P7() {
ret void
}
int gl_fx_dummy_function_api(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gl_fx_dummy_function_api() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ process_line(char *);
char *strtok(char *, char *);
void process_buffer(char *buf, size_t count) {
  buf[count] = '\0';
  char *pch = strtok(buf, "\n");
  while (pch != NULL) {
    process_line(pch);
    pch = strtok(NULL, "\n");
  }
}


x86 assembly (clang, -O0):
<process_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117d <process_buffer+0x5d>
mov    -0x18(%rbp),%rdi
call   1040 <process_line@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xe91(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x18(%rbp)
jmp    1150 <process_buffer+0x30>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_buffer>:
push   %rbx
movb   $0x0,(%rdi,%rsi,1)
lea    0xed4(%rip),%rsi
call   1030 <strtok@plt>
test   %rax,%rax
je     1157 <process_buffer+0x37>
lea    0xec3(%rip),%rbx
nopl   (%rax)
mov    %rax,%rdi
call   1040 <process_line@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1140 <process_buffer+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @process_buffer(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 0, i8* %3
%4 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %4, %2 ]
%8 = tail call i32 @process_line(i8* %7)
%9 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
void func2(void) {
  do {
    unsigned int i;
    for (i = 0; i < (100000); ++i)
      ;
  } while (0);
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x186a0,-0x4(%rbp)
jae    112b <func2+0x2b>
jmp    111d <func2+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <func2+0xb>
jmp    1130 <func2+0x30>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @func2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ usage();
void help() {
  usage();
  fprintf(stderr, "-u\t--usage\tshow usage message\n"
                  "-h\t--help\tshow this help message\n"
                  "-D\t--daemon\t\n"
                  "-N\t--no-daemon\t\n"
                  "-s\t--syslog\t\n"
                  "-L\t--log log file\t\n"
                  "-l\t--listen host:port\ta host port to listen\n"
                  "-f\t--fifo<control_fifo\t\n");
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <usage@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %eax,%eax
call   1040 <usage@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [193 x i8] c"-u\09--usage\09show usage message\0A-h\09--help\09show this help message\0A-D\09--daemon\09\0A-N\09--no-daemon\09\0A-s\09--syslog\09\0A-L\09--log log file\09\0A-l\09--listen host:port\09a host port to listen\0A-f\09--fifo<control_fifo\09\0A\00"
define void @help() {
%1 = call i32 (...) @usage()
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [193 x i8] c"-u\09--usage\09show usage message\0A-h\09--help\09show this help message\0A-D\09--daemon\09\0A-N\09--no-daemon\09\0A-s\09--syslog\09\0A-L\09--log log file\09\0A-l\09--listen host:port\09a host port to listen\0A-f\09--fifo<control_fifo\09\0A\00"
define void @help() {
%1 = tail call i32 (...) @usage()
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail();
int main() {
  int N;
  int x = 0;
  int a = 1;
  int b = 2;
  int c = 3;
  int i = 0;
  int temp;
  while (i < N) {
    if (a == b) {
      __assert_fail();
      return 1;
    }
    temp = a;
    a = b;
    b = c;
    c = temp;
    i = i + 1;
  }
  if (!(x == 0)) {
    __assert_fail();
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1193 <main+0x83>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    116d <main+0x5d>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
movl   $0x1,-0x4(%rbp)
jmp    11ab <main+0x9b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <main+0x32>
cmpl   $0x0,-0xc(%rbp)
je     11ab <main+0x9b>
mov    $0x0,%al
call   1030 <__assert_fail@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *fp, int argc, char **argv) {
  fprintf(fp,
          "Usage: %s [options]\n\n"
          "Options:\n"
          "-d | --device name Video device name [/dev/video]\n"
          "-h | --help Print this message\n"
          "-m | --mmap Use memory mapped buffers\n"
          "-r | --read Use read() calls\n"
          "-u | --userp Use application allocated buffers\n"
          "",
          argv[0]);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdx),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [226 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video]\0A-h | --help Print this message\0A-m | --mmap Use memory mapped buffers\0A-r | --read Use read() calls\0A-u | --userp Use application allocated buffers\0A\00"
define void @usage(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [226 x i8] c"Usage: %s [options]\0A\0AOptions:\0A-d | --device name Video device name [/dev/video]\0A-h | --help Print this message\0A-m | --mmap Use memory mapped buffers\0A-r | --read Use read() calls\0A-u | --userp Use application allocated buffers\0A\00"
define void @usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([226 x i8], [226 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Type definitions */
struct Cyc_Lexing_lexbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Lex_strng_next_rec(struct Cyc_Lexing_lexbuf *, int);
int Cyc_Lex_strng_next(struct Cyc_Lexing_lexbuf *lexbuf) {
  return ({ Cyc_Lex_strng_next_rec(lexbuf, 2); });
}


x86 assembly (clang, -O0):
<Cyc_Lex_strng_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <Cyc_Lex_strng_next_rec@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Lex_strng_next>:
mov    $0x2,%esi
jmp    1030 <Cyc_Lex_strng_next_rec@plt>

LLVM IR (-O0):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_strng_next(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = alloca %struct.Cyc_Lexing_lexbuf*
%3 = alloca i32
store %struct.Cyc_Lexing_lexbuf* %0, %struct.Cyc_Lexing_lexbuf** %2
%4 = load %struct.Cyc_Lexing_lexbuf*, %struct.Cyc_Lexing_lexbuf** %2
%5 = call i32 @Cyc_Lex_strng_next_rec(%struct.Cyc_Lexing_lexbuf* %4, i32 2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.Cyc_Lexing_lexbuf = type { i32 }
define i32 @Cyc_Lex_strng_next(%struct.Cyc_Lexing_lexbuf* %0) {
%2 = tail call i32 @Cyc_Lex_strng_next_rec(%struct.Cyc_Lexing_lexbuf* %0, i32 2)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int wmemstream_close(void *cookie) {
  free(cookie);
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @wmemstream_close(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
void PDF_LinkCheck() {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @PDF_LinkCheck() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__4__IO__makeInput();
void Msp430GpioC__3__HplGeneralIO__makeInput(void) {
  HplMsp430GeneralIOP__4__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__3__HplGeneralIO__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__4__IO__makeInput()
ret void
}
void rop3_56_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_56_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xa(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_56_0_0>:
mov    (%rdi),%al
or     %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_56_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %6
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = xor i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = load i8*, i8** %4
store i8 %29, i8* %30
ret void
}

LLVM IR (-O2):
define void @rop3_56_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, %2
%6 = and i8 %5, %1
%7 = xor i8 %6, %2
store i8 %7, i8* %0
ret void
}
char MemCharArrIO(char *pMemBlk, unsigned int Wr_TotalShift, char data) {
  char *pWork;
  if (Wr_TotalShift >> 31) {
    pWork = pMemBlk + (Wr_TotalShift - 0x80000000);
    *pWork = data;
  } else {
    pWork = pMemBlk + Wr_TotalShift;
    return *pWork;
  }
}


x86 assembly (clang, -O0):
<MemCharArrIO>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    -0x14(%rbp),%eax
shr    $0x1f,%eax
cmp    $0x0,%eax
je     1143 <MemCharArrIO+0x43>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x80000000,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x15(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
jmp    115a <MemCharArrIO+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MemCharArrIO>:
mov    %esi,%eax
test   %esi,%esi
js     110a <MemCharArrIO+0xa>
mov    (%rdi,%rax,1),%al
ret
mov    $0x80000000,%ecx
xor    %rax,%rcx
mov    %dl,(%rdi,%rcx,1)
ret

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

LLVM IR (-O2):
define signext i8 @MemCharArrIO(i8* nocapture %0, i32 %1, i8 signext %2) {
%4 = icmp sgt i32 %1, -1
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = xor i32 %1, -2147483648
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %2, i8* %8
br label %13
9: ; preds = %3
%10 = zext i32 %1 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
br label %13
13: ; preds = %5, %9
%14 = phi i8 [ undef, %5 ], [ %12, %9 ]
ret i8 %14
}
void delay_10us(long mydelay) {
  int index1;
  long index2;
  for (index2 = 0; index2 < mydelay; index2++) {
    for (index1 = 0; index1 < 96; index1++) {
    }
  }
}


x86 assembly (clang, -O0):
<delay_10us>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1158 <delay_10us+0x58>
movl   $0x0,-0xc(%rbp)
cmpl   $0x60,-0xc(%rbp)
jge    1142 <delay_10us+0x42>
jmp    1134 <delay_10us+0x34>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <delay_10us+0x25>
jmp    1147 <delay_10us+0x47>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <delay_10us+0x10>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay_10us(i64 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned short llz_read_u16(FILE *fp) {
  unsigned short cx;
  unsigned char temp[2];
  fread(temp, sizeof(*temp), 2, fp);
  cx = temp[0] | (temp[1] * 256);
  return cx;
}


x86 assembly (clang, -O0):
<llz_read_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzbl -0xc(%rbp),%eax
movzbl -0xb(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<llz_read_u16>:
push   %rax
mov    %rdi,%rcx
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @llz_read_u16(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
%4 = alloca [2 x i8]
store i32* %0, i32** %2
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = load i32*, i32** %2
%7 = call i32 @fread(i8* %5, i32 1, i32 2, i32* %6)
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = mul nsw i32 %13, 256
%15 = or i32 %10, %14
%16 = trunc i32 %15 to i16
store i16 %16, i16* %3
%17 = load i16, i16* %3
ret i16 %17
}

LLVM IR (-O2):
define zeroext i16 @llz_read_u16(i32* nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 1, i32 2, i32* %0)
%5 = load i8, i8* %3
%6 = zext i8 %5 to i16
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
%10 = shl nuw i16 %9, 8
%11 = or i16 %10, %6
ret i16 %11
}