xunge/DecIR huggingface dataset:
/* Type definitions */
struct Graph {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ KruskalMST(struct Graph *);
int /*<<< orphan*/ addEdge(struct Graph *, int, int, int);
struct Graph *createGraph(int, int /*<<< orphan*/);
int main(int argc, char const *argv[]) {
  struct Graph *graph = createGraph(3, 0);
  addEdge(graph, 0, 1, 3);
  addEdge(graph, 0, 2, 2);
  addEdge(graph, 1, 2, -1);
  KruskalMST(graph);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <createGraph@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <addEdge@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%ecx
mov    %ecx,%edx
call   1030 <addEdge@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0xffffffff,%ecx
call   1030 <addEdge@plt>
mov    -0x18(%rbp),%rdi
call   1050 <KruskalMST@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <createGraph@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0xffffffff,%ecx
call   1030 <addEdge@plt>
mov    %rbx,%rdi
call   1050 <KruskalMST@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Graph = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Graph*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call %struct.Graph* @createGraph(i32 3, i32 0)
store %struct.Graph* %7, %struct.Graph** %6
%8 = load %struct.Graph*, %struct.Graph** %6
%9 = call i32 @addEdge(%struct.Graph* %8, i32 0, i32 1, i32 3)
%10 = load %struct.Graph*, %struct.Graph** %6
%11 = call i32 @addEdge(%struct.Graph* %10, i32 0, i32 2, i32 2)
%12 = load %struct.Graph*, %struct.Graph** %6
%13 = call i32 @addEdge(%struct.Graph* %12, i32 1, i32 2, i32 -1)
%14 = load %struct.Graph*, %struct.Graph** %6
%15 = call i32 @KruskalMST(%struct.Graph* %14)
ret i32 0
}

LLVM IR (-O2):
%struct.Graph = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.Graph* @createGraph(i32 3, i32 0)
%4 = tail call i32 @addEdge(%struct.Graph* %3, i32 0, i32 1, i32 3)
%5 = tail call i32 @addEdge(%struct.Graph* %3, i32 0, i32 2, i32 2)
%6 = tail call i32 @addEdge(%struct.Graph* %3, i32 1, i32 2, i32 -1)
%7 = tail call i32 @KruskalMST(%struct.Graph* %3)
ret i32 0
}
/* Variables and functions */
char *gl_getline(char *);
char *cGetLine(char *prompt) { return gl_getline(prompt); }


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

x86 assembly (clang, -O2):
<cGetLine>:
jmp    1030 <gl_getline@plt>

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

LLVM IR (-O2):
define i8* @cGetLine(i8* %0) {
%2 = tail call i8* @gl_getline(i8* %0)
ret i8* %2
}
/* Variables and functions */
void *malloc(size_t);
void *rpl_malloc(size_t size) {
  if (size == 0)
    size++;
  return malloc(size);
}


x86 assembly (clang, -O0):
<rpl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <rpl_malloc+0x23>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_malloc>:
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @rpl_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = add i64 %6, 1
store i64 %7, i64* %2
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
%10 = call i8* @malloc(i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @rpl_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap64(int /*<<< orphan*/);
uint64_t be64_to_cpu(uint64_t v) { return bswap64(v); }


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

x86 assembly (clang, -O2):
<be64_to_cpu>:
jmp    1030 <bswap64@plt>

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

LLVM IR (-O2):
define i32 @be64_to_cpu(i32 %0) {
%2 = tail call i32 @bswap64(i32 %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ StrLib_StrLen(char *, unsigned int);
int libc_write(int, char **, size_t);
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
void ErrorString(char *a_, unsigned int _a_high) {
  int n;
  char a[_a_high + 1];
  memcpy(a, a_, _a_high + 1);
  n = libc_write(2, &a, (size_t)StrLib_StrLen((char *)a, _a_high));
}


x86 assembly (clang, -O0):
<ErrorString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x30(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rdi
mov    %rdi,%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%esi
call   1050 <StrLib_StrLen@plt>
mov    -0x28(%rbp),%rsi
mov    %rax,%rdx
mov    $0x2,%edi
call   1040 <libc_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorString>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rsi
lea    0x1(%r14),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1050 <StrLib_StrLen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <libc_write@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @ErrorString(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = add i32 %8, 1
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i8, i64 %10
store i64 %10, i64* %7
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = add i32 %14, 1
%16 = call i32 @memcpy(i8* %12, i8* %13, i32 %15)
%17 = bitcast i8* %12 to i8**
%18 = load i32, i32* %4
%19 = call i64 @StrLib_StrLen(i8* %12, i32 %18)
%20 = call i32 @libc_write(i32 2, i8** %17, i64 %19)
store i32 %20, i32* %5
%21 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
define void @ErrorString(i8* %0, i32 %1) {
%3 = add i32 %1, 1
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @memcpy(i8* %5, i8* %0, i32 %3)
%7 = bitcast i8* %5 to i8**
%8 = call i64 @StrLib_StrLen(i8* %5, i32 %1)
%9 = call i32 @libc_write(i32 2, i8** %7, i64 %8)
ret void
}
int fun991() { return 991; }


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

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

LLVM IR (-O0):
define i32 @fun991() {
ret i32 991
}

LLVM IR (-O2):
define i32 @fun991() {
ret i32 991
}
void othello_ABORT(void) {}


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

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

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

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

/* Variables and functions */
int setvbuf(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int);
int file_NativeFile_NativeFile_set_buffering_type_0(FILE *f, int buf_sz,
                                                    int mode) {
  return setvbuf(f, NULL, mode, buf_sz);
}


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

x86 assembly (clang, -O2):
<file_NativeFile_NativeFile_set_buffering_type_0>:
mov    %esi,%ecx
xor    %esi,%esi
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
define i32 @file_NativeFile_NativeFile_set_buffering_type_0(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @setvbuf(i32* %7, i32* null, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @file_NativeFile_NativeFile_set_buffering_type_0(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @setvbuf(i32* %0, i32* null, i32 %2, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getprogname();
int main(void) {
  getprogname();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getprogname()
ret i32 0
}
int test_imm_40int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x40 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_40int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 274877906944
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_storage_all();
int /*<<< orphan*/ test_vector_all();
int ui_start();
int main() {
  int ui_code = ui_start();
  test_vector_all();
  test_storage_all();
  if (ui_code == 0) {
    puts("Something went wrong. Aborting");
    exit(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <ui_start@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <test_vector_all@plt>
mov    $0x0,%al
call   1040 <test_storage_all@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1197 <main+0x47>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <ui_start@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <test_vector_all@plt>
xor    %eax,%eax
call   1040 <test_storage_all@plt>
test   %ebx,%ebx
je     1170 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Something went wrong. Aborting\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @ui_start()
store i32 %3, i32* %2
%4 = call i32 (...) @test_vector_all()
%5 = call i32 (...) @test_storage_all()
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Something went wrong. Aborting\00"
define i32 @main() {
%1 = tail call i32 (...) @ui_start()
%2 = tail call i32 (...) @test_vector_all()
%3 = tail call i32 (...) @test_storage_all()
%4 = icmp eq i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int help(const int argc, char **argv) {
  printf(
      "use: %s --task=hide|recover [--input-buf=<data>|--input-file=<filepath> "
      "--pcap-file=<filepath> --pcap-out-file=<filepath>]\n",
      argv[0]);
  return 0;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [124 x i8] c"use: %s --task=hide|recover [--input-buf=<data>|--input-file=<filepath> --pcap-file=<filepath> --pcap-out-file=<filepath>]\0A\00"
define i32 @help(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [124 x i8] c"use: %s --task=hide|recover [--input-buf=<data>|--input-file=<filepath> --pcap-file=<filepath> --pcap-out-file=<filepath>]\0A\00"
define i32 @help(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int f131(int *);
int f132(int *p) { return f131(p); }


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

x86 assembly (clang, -O2):
<f132>:
jmp    1030 <f131@plt>

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

LLVM IR (-O2):
define i32 @f132(i32* %0) {
%2 = tail call i32 @f131(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ ehrpwm_reg_config(int /*<<< orphan*/, int, unsigned char,
                                     int);
int ehrpwm_et_int_en_dis(uint8_t module, unsigned char en_dis) {
  ehrpwm_reg_config(module, 0x32, en_dis << 0x3, (1 << 3));
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_et_int_en_dis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
movzbl -0x5(%rbp),%eax
shl    $0x3,%eax
mov    $0x32,%esi
mov    $0x8,%ecx
movzbl %al,%edx
call   1030 <ehrpwm_reg_config@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_et_int_en_dis>:
push   %rax
shl    $0x3,%sil
movzbl %sil,%edx
mov    $0x32,%esi
mov    $0x8,%ecx
call   1030 <ehrpwm_reg_config@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ehrpwm_et_int_en_dis(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
%5 = load i32, i32* %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 3
%9 = trunc i32 %8 to i8
%10 = call i32 @ehrpwm_reg_config(i32 %5, i32 50, i8 zeroext %9, i32 8)
ret i32 0
}

LLVM IR (-O2):
define i32 @ehrpwm_et_int_en_dis(i32 %0, i8 zeroext %1) {
%3 = shl i8 %1, 3
%4 = tail call i32 @ehrpwm_reg_config(i32 %0, i32 50, i8 zeroext %3, i32 8)
ret i32 0
}
int test_imm_67uint8_reg(unsigned char val) {
  return ((val) & (-0x67 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_67uint8_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, -103
%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_67uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -103
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ YUVUtil_Init();
void Frame2LinearInit() { YUVUtil_Init(); }


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

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

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

LLVM IR (-O2):
define void @Frame2LinearInit() {
%1 = tail call i32 (...) @YUVUtil_Init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _fail(char const *const, int const);
int /*<<< orphan*/ integer_in_range_display_error(unsigned long const,
                                                  unsigned long const,
                                                  unsigned long const);
void _assert_in_range(const unsigned long int value,
                      const unsigned long int minimum,
                      const unsigned long int maximum, const char *const file,
                      const int line) {
  if (!integer_in_range_display_error(value, minimum, maximum)) {
    _fail(file, line);
  }
}


x86 assembly (clang, -O0):
<_assert_in_range>:
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    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <integer_in_range_display_error@plt>
cmp    $0x0,%eax
jne    1162 <_assert_in_range+0x42>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <_fail@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assert_in_range>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%rbx
call   1040 <integer_in_range_display_error@plt>
test   %eax,%eax
je     1139 <_assert_in_range+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_fail@plt>

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

LLVM IR (-O2):
define void @_assert_in_range(i64 %0, i64 %1, i64 %2, i8* %3, i32 %4) {
%6 = tail call i32 @integer_in_range_display_error(i64 %0, i64 %1, i64 %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @_fail(i8* %3, i32 %4)
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_call(int, int /*<<< orphan*/, int /*<<< orphan*/);
void clearShell() { sys_call(5, 0, 0); }


x86 assembly (clang, -O0):
<clearShell>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearShell>:
mov    $0x5,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define void @clearShell() {
%1 = call i32 @sys_call(i32 5, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @clearShell() {
%1 = tail call i32 @sys_call(i32 5, i32 0, i32 0)
ret void
}
int Operand_ulabel8_encode(unsigned int *valp) {
  unsigned imm8_0, ulabel8_0;
  ulabel8_0 = *valp;
  imm8_0 = (ulabel8_0 - 0x4) & 0xff;
  *valp = imm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_ulabel8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_ulabel8_encode>:
mov    $0xfc,%eax
add    (%rdi),%eax
movzbl %al,%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_ulabel8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add i32 %2, 252
%4 = and i32 %3, 255
store i32 %4, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct lldp_port {
  int dummy;
};

/* Variables and functions */
uint8_t tlvInitializeLLDP(struct lldp_port *lldp_port) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.lldp_port = type { i32 }
define i32 @tlvInitializeLLDP(%struct.lldp_port* nocapture readnone %0) {
ret i32 0
}
void traverse() {}


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

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

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

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

/* Variables and functions */
char *__asctime_r(struct tm const *, char *);
char *asctime(const struct tm *tm) {
  static char buf[26];
  return __asctime_r(tm, buf);
}


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

x86 assembly (clang, -O2):
<asctime>:
lea    0x2f29(%rip),%rsi
jmp    1030 <__asctime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@asctime.buf = internal global [26 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i8* @__asctime_r(%struct.tm* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@asctime.buf = internal global [26 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = tail call i8* @__asctime_r(%struct.tm* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @asctime.buf, i64 0, i64 0))
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ strchr(char *, int /*<<< orphan*/);
wchar_t *wcsrchr(const wchar_t *s, wchar_t c) {
  return (wchar_t *)strchr((char *)s, c);
}


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

x86 assembly (clang, -O2):
<wcsrchr>:
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i32* @wcsrchr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = bitcast i32* %5 to i8*
%7 = load i32, i32* %4
%8 = call i64 @strchr(i8* %6, i32 %7)
%9 = inttoptr i64 %8 to i32*
ret i32* %9
}

LLVM IR (-O2):
define i32* @wcsrchr(i32* %0, i32 %1) {
%3 = bitcast i32* %0 to i8*
%4 = tail call i64 @strchr(i8* %3, i32 %1)
%5 = inttoptr i64 %4 to i32*
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f(void) { printf("f\n"); }


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

x86 assembly (clang, -O2):
<f>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"f\0A\00"
define void @f() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"f\00"
define void @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int remove_categories(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @remove_categories() {
ret i32 1
}
/* Type definitions */
struct str {
  int dummy;
};

/* Variables and functions */
scalar_t__ str_len(struct str *);
int str_is_empty(struct str *x) { return str_len(x) == 0; }


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

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

LLVM IR (-O0):
%struct.str = type { i32 }
define i32 @str_is_empty(%struct.str* %0) {
%2 = alloca %struct.str*
store %struct.str* %0, %struct.str** %2
%3 = load %struct.str*, %struct.str** %2
%4 = call i64 @str_len(%struct.str* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.str = type { i32 }
define i32 @str_is_empty(%struct.str* %0) {
%2 = tail call i64 @str_len(%struct.str* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
void onsig(int n) {
  endwin();
  exit(n);
}


x86 assembly (clang, -O0):
<onsig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<onsig>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <endwin@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @onsig(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 %0)
unreachable
}
double pair_tailcorr_switch3_ei(void *pair_data, long center_index,
                                long other_index, double rcut, double width) {
  double t1 = 0.0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_switch3_ei>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_switch3_ei>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_switch3_ei(i8* %0, i64 %1, i64 %2, double %3, double %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
%12 = load double, double* %11
ret double %12
}

LLVM IR (-O2):
define double @pair_tailcorr_switch3_ei(i8* nocapture readnone %0, i64 %1, i64 %2, double %3, double %4) {
ret double 0.000000e+00
}
trailer() {}


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

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

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

LLVM IR (-O2):
define i32 @trailer() {
ret i32 undef
}
void U_EMRSETMETARGN_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_EMRSETMETARGN_print(i8* nocapture %0) {
ret void
}
int UtilRoundPOW2(int x) {
  int tmp;
  if (x <= 2)
    return x;
  x--;
  for (tmp = x / 2; tmp; tmp /= 2)
    x |= tmp;
  return (x + 1);
}


x86 assembly (clang, -O0):
<UtilRoundPOW2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     111c <UtilRoundPOW2+0x1c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1162 <UtilRoundPOW2+0x62>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1159 <UtilRoundPOW2+0x59>
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    1133 <UtilRoundPOW2+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UtilRoundPOW2>:
mov    %edi,%eax
cmp    $0x3,%edi
jl     112c <UtilRoundPOW2+0x2c>
add    $0xffffffff,%eax
mov    %eax,%esi
mov    %eax,%edx
xchg   %ax,%ax
mov    %eax,%ecx
shr    $0x1f,%edx
add    %esi,%edx
sar    %edx
add    $0x1,%esi
mov    %edx,%eax
or     %ecx,%eax
cmp    $0x2,%esi
mov    %edx,%esi
ja     1110 <UtilRoundPOW2+0x10>
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @UtilRoundPOW2(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ %4, %3 ], [ %11, %5 ]
%7 = phi i32 [ %4, %3 ], [ %8, %5 ]
%8 = sdiv i32 %7, 2
%9 = add i32 %7, 1
%10 = icmp ult i32 %9, 3
%11 = or i32 %8, %6
br i1 %10, label %12, label %5
12: ; preds = %5
%13 = add nsw i32 %6, 1
br label %14
14: ; preds = %1, %12
%15 = phi i32 [ %13, %12 ], [ %0, %1 ]
ret i32 %15
}
/* Variables and functions */
char *sld_string_allocate(char *);
char *sld_string_trim_leading(char *);
char *sld_string_trim_trailing(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *sld_string_trim(char *string) {
  char *trimmed_string = NULL;
  trimmed_string = sld_string_allocate(string);
  strcpy(trimmed_string, string);
  trimmed_string = sld_string_trim_leading(trimmed_string);
  trimmed_string = sld_string_trim_trailing(trimmed_string);
  return trimmed_string;
}


x86 assembly (clang, -O0):
<sld_string_trim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <sld_string_allocate@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1060 <sld_string_trim_leading@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <sld_string_trim_trailing@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sld_string_trim>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <sld_string_allocate@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <sld_string_trim_leading@plt>
mov    %rax,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <sld_string_trim_trailing@plt>

LLVM IR (-O0):
define i8* @sld_string_trim(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i8* @sld_string_allocate(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i8* @sld_string_trim_leading(i8* %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = call i8* @sld_string_trim_trailing(i8* %11)
store i8* %12, i8** %3
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @sld_string_trim(i8* %0) {
%2 = tail call i8* @sld_string_allocate(i8* %0)
%3 = tail call i32 @strcpy(i8* %2, i8* %0)
%4 = tail call i8* @sld_string_trim_leading(i8* %2)
%5 = tail call i8* @sld_string_trim_trailing(i8* %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void print_buffer(unsigned char *p, size_t len) {
  while (len--) {
    printf("%02x", (unsigned int)*p++);
  }
}


x86 assembly (clang, -O0):
<print_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     115c <print_buffer+0x4c>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <print_buffer+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buffer>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1146 <print_buffer+0x36>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @print_buffer(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8* [ %8, %4 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = icmp eq i64 %7, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
int getByte(int x, int n) { return 2; }


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ togo_init(int, char **);
void main(int argc, char *argv[]) { togo_init(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <togo_init@plt>

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

LLVM IR (-O2):
define void @main(i32 %0, i8** %1) {
%3 = tail call i32 @togo_init(i32 %0, i8** %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  printf("entre com um numero de 1 a 10");
  scanf("%d", &i);
  do {
    printf("este numero esta incorreto");
  } while (i > 10 || i < 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jg     1170 <main+0x50>
cmpl   $0x1,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    114b <main+0x2b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xed8(%rip),%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
add    $0xfffffff5,%eax
cmp    $0xfffffff6,%eax
jb     1150 <main+0x30>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"entre com um numero de 1 a 10\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"este numero esta incorreto\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %13, %0
%6 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %2
%9 = icmp sgt i32 %8, 10
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 1
br label %13
13: ; preds = %10, %7
%14 = phi i1 [ true, %7 ], [ %12, %10 ]
br i1 %14, label %5, label %15
15: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"entre com um numero de 1 a 10\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"este numero esta incorreto\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
br label %5
5: ; preds = %5, %0
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = add i32 %7, -11
%9 = icmp ult i32 %8, -10
br i1 %9, label %5, label %10
10: ; preds = %5
ret i32 0
}
unsigned rotate_left(unsigned x, int n) {
  int w = sizeof(unsigned) << 3;
  return x << n | x >> (w - n - 1) >> 1;
}


x86 assembly (clang, -O0):
<rotate_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    $0x1,%ecx
shr    %cl,%edx
mov    %edx,%ecx
shr    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_left>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    $0x1f,%dl
sub    %cl,%dl
mov    %edx,%ecx
shr    %cl,%edi
shr    %edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = sub nsw i32 %10, %11
%13 = sub nsw i32 %12, 1
%14 = lshr i32 %9, %13
%15 = lshr i32 %14, 1
%16 = or i32 %8, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @rotate_left(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 31, %1
%5 = lshr i32 %0, %4
%6 = lshr i32 %5, 1
%7 = or i32 %6, %3
ret i32 %7
}
append_token_member(n) { append_member(-n); }


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

x86 assembly (clang, -O2):
<append_token_member>:
neg    %edi
xor    %eax,%eax
jmp    1030 <append_member@plt>

LLVM IR (-O0):
define i32 @append_token_member(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = sub nsw i32 0, %4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @append_member to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @append_token_member(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @append_member to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
void timer_set_prescale(int id, int factor) {}


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

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

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

LLVM IR (-O2):
define void @timer_set_prescale(i32 %0, i32 %1) {
ret void
}
cexit(rcode) {
  int i;
  for (i = 0; i < 10; i++)
    cclose(i);
  exit(rcode);
}


x86 assembly (clang, -O0):
<cexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1154 <cexit+0x34>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <cclose@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <cexit+0x12>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cexit>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x4,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x7,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x8,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    $0x9,%edi
xor    %eax,%eax
call   1030 <cclose@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @cexit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define i32 @cexit(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 2)
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 3)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 4)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 5)
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 6)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 7)
%10 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 8)
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @cclose to i32 (i32, ...)*)(i32 9)
tail call void @exit(i32 %0)
unreachable
}