xunge/DecIR huggingface dataset:
int hammingWeight(unsigned n) {
  int onebits = 0;
  while (n) {
    ++onebits;
    n &= n - 1;
  }
  return onebits;
}


x86 assembly (clang, -O0):
<hammingWeight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <hammingWeight+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <hammingWeight+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hammingWeight>:
xor    %eax,%eax
test   %edi,%edi
je     111c <hammingWeight+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <hammingWeight+0x10>
ret

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

LLVM IR (-O2):
define i32 @hammingWeight(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
void *calloc(int, size_t);
scalar_t__ can_alloc();
void *memory_create(size_t size) {
  void *ptr = NULL;
  if (can_alloc()) {
    ptr = calloc(1, size);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<memory_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <can_alloc@plt>
cmp    $0x0,%rax
je     1157 <memory_create+0x37>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_create>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <can_alloc@plt>
test   %rax,%rax
je     113e <memory_create+0x1e>
mov    $0x1,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <calloc@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memory_create(i64 %0) {
%2 = tail call i64 (...) @can_alloc()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @calloc(i32 1, i64 %0)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
char fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
char getch() {
  char c = fgetc(stdin);
  return c;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
@stdin = global i32 0
define signext i8 @getch() {
%1 = alloca i8
%2 = load i32, i32* @stdin
%3 = call signext i8 @fgetc(i32 %2)
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
@stdin = global i32 0
define signext i8 @getch() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @fgetc(i32 %1)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f9(long j) {
  if ((j & ((1UL << (9)) - 1)) >= ((1UL << ((9) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1ff,%rax
cmp    $0x102,%rax
jb     1139 <f9+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f9>:
and    $0x1fe,%edi
cmp    $0x102,%edi
jae    111f <f9+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f9(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 511
%5 = icmp uge i64 %4, 258
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f9(i64 %0) {
%2 = and i64 %0, 510
%3 = icmp ugt i64 %2, 257
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
int foo1b();
int foo3(void) { return foo1b(); }


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

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

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

LLVM IR (-O2):
define i32 @foo3() {
%1 = tail call i32 (...) @foo1b()
ret i32 %1
}
/* Variables and functions */
int ssds_get_gen_num(int, char *, char *, char *);
int ssds_get_class_id(int pcfd, char *class_def) {
  return ssds_get_gen_num(pcfd, class_def, "gc", "c_id");
}


x86 assembly (clang, -O0):
<ssds_get_class_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <ssds_get_gen_num@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_get_class_id>:
lea    0xee9(%rip),%rdx
lea    0xee5(%rip),%rcx
jmp    1030 <ssds_get_gen_num@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"gc\00"
@.str.1 = [5 x i8] c"c_id\00"
define i32 @ssds_get_class_id(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 @ssds_get_gen_num(i32 %5, i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [3 x i8] c"gc\00"
@.str.1 = [5 x i8] c"c_id\00"
define i32 @ssds_get_class_id(i32 %0, i8* %1) {
%3 = tail call i32 @ssds_get_gen_num(i32 %0, i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("vfp-pctest [fp] [uniqueId] [cycles]\n");
  printf("  fp        : --vfpv2 | --neon\n");
  printf("  uniqueId  : positive integer used for threadId and random seed for "
         "data generation\n");
  printf("  cycles    : positive integer number of test cycles to run (~1 "
         "second per cycle)\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xef0(%rip),%rdi
call   1040 <puts@plt>
lea    0xf03(%rip),%rdi
call   1040 <puts@plt>
lea    0xf4c(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"vfp-pctest [fp] [uniqueId] [cycles]\0A\00"
@.str.1 = [32 x i8] c" fp : --vfpv2 | --neon\0A\00"
@.str.2 = [86 x i8] c" uniqueId : positive integer used for threadId and random seed for data generation\0A\00"
@.str.3 = [83 x i8] c" cycles : positive integer number of test cycles to run (~1 second per cycle)\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"vfp-pctest [fp] [uniqueId] [cycles]\00"
@str.5 = [31 x i8] c" fp : --vfpv2 | --neon\00"
@str.6 = [85 x i8] c" uniqueId : positive integer used for threadId and random seed for data generation\00"
@str.7 = [82 x i8] c" cycles : positive integer number of test cycles to run (~1 second per cycle)\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
char IDGetBit(unsigned long long *llvalue, char bit) {
  unsigned long long Mask = 1ULL << bit;
  return ((*llvalue & Mask) ? 1 : 0);
}


x86 assembly (clang, -O0):
<IDGetBit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IDGetBit>:
mov    (%rdi),%rax
bt     %rsi,%rax
setb   %al
ret

LLVM IR (-O0):
define signext i8 @IDGetBit(i64* %0, i8 signext %1) {
%3 = alloca i64*
%4 = alloca i8
%5 = alloca i64
store i64* %0, i64** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
store i64 %9, i64* %5
%10 = load i64*, i64** %3
%11 = load i64, i64* %10
%12 = load i64, i64* %5
%13 = and i64 %11, %12
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @IDGetBit(i64* nocapture %0, i8 signext %1) {
%3 = sext i8 %1 to i64
%4 = and i64 %3, 4294967295
%5 = shl nuw i64 1, %4
%6 = load i64, i64* %0
%7 = and i64 %6, %5
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i8
ret i8 %9
}
/* Variables and functions */
scalar_t__ TOP_LEVEL_ccodegentests_numSum(int);
int /*<<< orphan*/ TOP_LEVEL_programs_small_tests(int /*<<< orphan*/);
int /*<<< orphan*/ TOP_LEVEL_usecases_ba_test_ba(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  TOP_LEVEL_usecases_ba_test_ba(0);
  printf("---small tests---\n");
  TOP_LEVEL_programs_small_tests(0);
  printf("1+...+10=%d\n", (int)TOP_LEVEL_ccodegentests_numSum(10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1050 <TOP_LEVEL_usecases_ba_test_ba@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   1040 <TOP_LEVEL_programs_small_tests@plt>
mov    $0xa,%edi
call   1030 <TOP_LEVEL_ccodegentests_numSum@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <TOP_LEVEL_usecases_ba_test_ba@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <TOP_LEVEL_programs_small_tests@plt>
mov    $0xa,%edi
call   1040 <TOP_LEVEL_ccodegentests_numSum@plt>
lea    0xe84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"---small tests---\0A\00"
@.str.1 = [13 x i8] c"1+...+10=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @TOP_LEVEL_usecases_ba_test_ba(i32 0)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @TOP_LEVEL_programs_small_tests(i32 0)
%9 = call i64 @TOP_LEVEL_ccodegentests_numSum(i32 10)
%10 = trunc i64 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"1+...+10=%d\0A\00"
@str = [18 x i8] c"---small tests---\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @TOP_LEVEL_usecases_ba_test_ba(i32 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @TOP_LEVEL_programs_small_tests(i32 0)
%6 = tail call i64 @TOP_LEVEL_ccodegentests_numSum(i32 10)
%7 = trunc i64 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int cpoke(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int canReach = cpoke(argv[1]);
  if (canReach == 0) {
    printf("Looks like we can reach %s\n", argv[1]);
  } else {
    printf("something went wrong...\n");
  }
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <cpoke@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    116b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1179 <main+0x59>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <cpoke@plt>
test   %eax,%eax
je     114f <main+0x1f>
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
jmp    1161 <main+0x31>
mov    0x8(%rbx),%rsi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Looks like we can reach %s\0A\00"
@.str.1 = [25 x i8] c"something went wrong...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @cpoke(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %20
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %13
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Looks like we can reach %s\0A\00"
@str = [24 x i8] c"something went wrong...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @cpoke(i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %12
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; ++i) {
    printf("Arg %d is %s\n", i, argv[i]);
  }
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Arg %d is %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
int tmrm_hash_memory_get_fd(void *context) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tmrm_hash_memory_get_fd(i8* nocapture readnone %0) {
ret i32 -1
}
int foo(unsigned int x) {
  if (!(x == 4 || x == 6) || (x == 2 || x == 6))
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
je     111b <foo+0x1b>
cmpl   $0x6,-0x8(%rbp)
jne    112f <foo+0x2f>
cmpl   $0x2,-0x8(%rbp)
je     112f <foo+0x2f>
cmpl   $0x6,-0x8(%rbp)
jne    113b <foo+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <foo+0x42>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
and    $0xfffffffd,%eax
xor    %ecx,%ecx
cmp    $0x4,%eax
setne  %cl
and    $0xfffffffb,%edi
cmp    $0x2,%edi
lea    -0x1(%rcx,%rcx,1),%ecx
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = and i32 %0, -3
%3 = icmp ne i32 %2, 4
%4 = and i32 %0, -5
%5 = icmp eq i32 %4, 2
%6 = or i1 %5, %3
%7 = select i1 %6, i32 1, i32 -1
ret i32 %7
}
void set_int(void *_p, int _v) { *((int *)_p) = _v; }


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

x86 assembly (clang, -O2):
<set_int>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_int(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int aa_pro_ctr_a19(int chan, unsigned char *buf, int len) {
  hu_log(6, "hu_aap", __func__, "!!!!!!!!");
  return (-1);
}


x86 assembly (clang, -O0):
<aa_pro_ctr_a19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x6,%edi
lea    0xed2(%rip),%rsi
lea    0xed2(%rip),%rdx
lea    0xeda(%rip),%rcx
mov    $0x0,%al
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_pro_ctr_a19>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xef0(%rip),%rcx
mov    $0x6,%edi
xor    %eax,%eax
call   1030 <hu_log@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a19 = [15 x i8] c"aa_pro_ctr_a19\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a19(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [7 x i8] c"hu_aap\00"
@__func__.aa_pro_ctr_a19 = [15 x i8] c"aa_pro_ctr_a19\00"
@.str.1 = [9 x i8] c"!!!!!!!!\00"
define i32 @aa_pro_ctr_a19(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @hu_log to i32 (i32, i8*, i8*, i8*, ...)*)(i32 6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.aa_pro_ctr_a19, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int strlen(const char *s) {
  int i;
  for (i = 0; s[i] != '\0'; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1137 <strlen+0x37>
jmp    1129 <strlen+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void secondStatic(void) {}


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

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

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

LLVM IR (-O2):
define void @secondStatic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call7e(float, unsigned char, double, unsigned short,
                          unsigned long, unsigned int, char, int, short, long);
void call7d(long l, float f, unsigned char uc, double d, unsigned short us,
            unsigned long ul, unsigned int ui, char c, int i, short s) {
  call7e(f, uc, d, us, ul, ui, c, i, s, l);
}


x86 assembly (clang, -O0):
<call7d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r9b,%al
mov    0x18(%rbp),%r9w
mov    0x10(%rbp),%r9d
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %sil,-0xd(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %dx,-0x1a(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %al,-0x2d(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0xd(%rbp),%dil
movsd  -0x18(%rbp),%xmm1
mov    -0x1a(%rbp),%si
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    -0x2d(%rbp),%r8b
mov    0x10(%rbp),%r9d
mov    0x18(%rbp),%r10w
mov    -0x8(%rbp),%rax
movzbl %dil,%edi
movzwl %si,%esi
movsbl %r8b,%r8d
movswl %r10w,%r10d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <call7e@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call7d>:
push   %rax
mov    %r9d,%r10d
mov    %rdi,%rax
mov    0x10(%rsp),%r9d
movswl 0x18(%rsp),%r11d
mov    %esi,%edi
mov    %edx,%esi
mov    %rcx,%rdx
mov    %r8d,%ecx
mov    %r10d,%r8d
push   %rax
push   %r11
call   1030 <call7e@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @call7d(i64 %0, float %1, i8 zeroext %2, double %3, i16 zeroext %4, i64 %5, i32 %6, i8 signext %7, i32 %8, i16 signext %9) {
%11 = alloca i64
%12 = alloca float
%13 = alloca i8
%14 = alloca double
%15 = alloca i16
%16 = alloca i64
%17 = alloca i32
%18 = alloca i8
%19 = alloca i32
%20 = alloca i16
store i64 %0, i64* %11
store float %1, float* %12
store i8 %2, i8* %13
store double %3, double* %14
store i16 %4, i16* %15
store i64 %5, i64* %16
store i32 %6, i32* %17
store i8 %7, i8* %18
store i32 %8, i32* %19
store i16 %9, i16* %20
%21 = load float, float* %12
%22 = load i8, i8* %13
%23 = load double, double* %14
%24 = load i16, i16* %15
%25 = load i64, i64* %16
%26 = load i32, i32* %17
%27 = load i8, i8* %18
%28 = load i32, i32* %19
%29 = load i16, i16* %20
%30 = load i64, i64* %11
%31 = call i32 @call7e(float %21, i8 zeroext %22, double %23, i16 zeroext %24, i64 %25, i32 %26, i8 signext %27, i32 %28, i16 signext %29, i64 %30)
ret void
}

LLVM IR (-O2):
define void @call7d(i64 %0, float %1, i8 zeroext %2, double %3, i16 zeroext %4, i64 %5, i32 %6, i8 signext %7, i32 %8, i16 signext %9) {
%11 = tail call i32 @call7e(float %1, i8 zeroext %2, double %3, i16 zeroext %4, i64 %5, i32 %6, i8 signext %7, i32 %8, i16 signext %9, i64 %0)
ret void
}
/* Variables and functions */
int fdc37b787_gpio50_raise(int);
int fdc37b787_gpio50_raise_3f0(void) { return fdc37b787_gpio50_raise(0x3f0); }


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

x86 assembly (clang, -O2):
<fdc37b787_gpio50_raise_3f0>:
mov    $0x3f0,%edi
jmp    1030 <fdc37b787_gpio50_raise@plt>

LLVM IR (-O0):
define i32 @fdc37b787_gpio50_raise_3f0() {
%1 = call i32 @fdc37b787_gpio50_raise(i32 1008)
ret i32 %1
}

LLVM IR (-O2):
define i32 @fdc37b787_gpio50_raise_3f0() {
%1 = tail call i32 @fdc37b787_gpio50_raise(i32 1008)
ret i32 %1
}
/* Variables and functions */
double MTwister_Int32();
double MTwister_Real1(void) { return MTwister_Int32() * (1.0 / 4294967295.0); }


x86 assembly (clang, -O0):
<MTwister_Real1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <MTwister_Int32@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MTwister_Real1>:
push   %rax
xor    %eax,%eax
call   1030 <MTwister_Int32@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @MTwister_Real1() {
%1 = call double (...) @MTwister_Int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}

LLVM IR (-O2):
define double @MTwister_Real1() {
%1 = tail call double (...) @MTwister_Int32()
%2 = fmul double %1, 0x3DF0000000100000
ret double %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
unsigned int strlen(char const *);
int compressed_filename_p(const char *name) {
  unsigned len = strlen(name);
  return (sizeof("") > 1) && (len > sizeof("") - 1) &&
         (strcmp(name + len - (sizeof("") - 1), "") == 0);
}


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

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

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

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

/* Variables and functions */
int EINVAL;
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr,
                                  int *protocol) {
  (void)attr;
  (void)protocol;
  return EINVAL;
}


x86 assembly (clang, -O0):
<pthread_mutexattr_getprotocol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutexattr_getprotocol>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pthread_mutexattr_getprotocol(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 = load i32*, i32** %4
%7 = load i32, i32* @EINVAL
ret i32 %7
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pthread_mutexattr_getprotocol(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ptrdiff_t;

/* Variables and functions */
int /*<<< orphan*/ print_symbol(char *, int /*<<< orphan*/);
void do_initcalls(void **call) { print_symbol(": %s()", (ptrdiff_t)*call); }


x86 assembly (clang, -O0):
<do_initcalls>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%esi
lea    0xed4(%rip),%rdi
call   1030 <print_symbol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_initcalls>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <print_symbol@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c": %s()\00"
define void @do_initcalls(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = ptrtoint i8* %2 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @print_symbol(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LED_CTRL_RestoreConfig();
void LED_CTRL_Wakeup(void) { LED_CTRL_RestoreConfig(); }


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

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

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

LLVM IR (-O2):
define void @LED_CTRL_Wakeup() {
%1 = tail call i32 (...) @LED_CTRL_RestoreConfig()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int ROTR(int, int, int);
uint32_t BIGS0(uint32_t x) {
  return ROTR(x, 2, 32) ^ ROTR(x, 13, 32) ^ ROTR(x, 22, 32);
}


x86 assembly (clang, -O0):
<BIGS0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xd,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x16,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
xor    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIGS0>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0xd,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
mov    %eax,%ebp
xor    %r14d,%ebp
mov    %ebx,%edi
mov    $0x16,%esi
mov    $0x20,%edx
call   1030 <ROTR@plt>
xor    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @BIGS0(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ROTR(i32 %3, i32 2, i32 32)
%5 = load i32, i32* %2
%6 = call i32 @ROTR(i32 %5, i32 13, i32 32)
%7 = xor i32 %4, %6
%8 = load i32, i32* %2
%9 = call i32 @ROTR(i32 %8, i32 22, i32 32)
%10 = xor i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @BIGS0(i32 %0) {
%2 = tail call i32 @ROTR(i32 %0, i32 2, i32 32)
%3 = tail call i32 @ROTR(i32 %0, i32 13, i32 32)
%4 = xor i32 %3, %2
%5 = tail call i32 @ROTR(i32 %0, i32 22, i32 32)
%6 = xor i32 %4, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_and_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_and_ps(__m128 A, __m128 B) { return _mm_and_ps(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_and_ps>:
jmp    1030 <_mm_and_ps@plt>

LLVM IR (-O0):
define i32 @test_mm_and_ps(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 = load i32, i32* %4
%7 = call i32 @_mm_and_ps(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_and_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_and_ps(i32 %0, i32 %1)
ret i32 %3
}
int invert(unsigned int x, unsigned int p, unsigned int n) {
  unsigned int a = ~(~0 << n) << p;
  return x ^ a;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
mov    %esi,%ecx
shl    %cl,%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = shl i32 -1, %8
%10 = xor i32 %9, -1
%11 = load i32, i32* %5
%12 = shl i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %4
%14 = load i32, i32* %7
%15 = xor i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = xor i32 %4, -1
%6 = shl i32 %5, %1
%7 = xor i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int myid, nthreads;
  myid = 0;
  nthreads = 1;
  printf("%d of %d - hello world!\n", myid, nthreads);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [25 x i8] c"%d of %d - hello world!\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}
unsigned char cabs_diff(unsigned char a, unsigned char b) {
  return a >= b ? a - b : b - a;
}


x86 assembly (clang, -O0):
<cabs_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jl     1132 <cabs_diff+0x32>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <cabs_diff+0x3f>
movzbl -0x2(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cabs_diff>:
mov    %edi,%eax
sub    %sil,%al
neg    %al
sub    %sil,%dil
movzbl %dil,%ecx
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @cabs_diff(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sge i32 %6, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = sub nsw i32 %12, %14
br label %22
16: ; preds = %2
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = sub nsw i32 %18, %20
br label %22
22: ; preds = %16, %10
%23 = phi i32 [ %15, %10 ], [ %21, %16 ]
%24 = trunc i32 %23 to i8
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @cabs_diff(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ult i8 %0, %1
%4 = sub i8 %0, %1
%5 = sub i8 %1, %0
%6 = select i1 %3, i8 %5, i8 %4
ret i8 %6
}
/* Variables and functions */
char getchar();
char readChar() {
  char c;
  do {
    c = getchar();
  } while (c == '\n');
  return c;
}


x86 assembly (clang, -O0):
<readChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1118 <readChar+0x8>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readChar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     1120 <readChar+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @readChar() {
%1 = alloca i8
br label %2
2: ; preds = %4, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 10
br i1 %7, label %2, label %8
8: ; preds = %4
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @readChar() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %1, label %4
4: ; preds = %1
ret i8 %2
}
/* Variables and functions */
unsigned int arch_cpuid_1(int);
unsigned arch_get_counter_mask(void) {
  unsigned v = arch_cpuid_1(0xa);
  return ((1U << ((v >> 8) & 0xff)) - 1);
}


x86 assembly (clang, -O0):
<arch_get_counter_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <arch_cpuid_1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_get_counter_mask>:
push   %rax
mov    $0xa,%edi
call   1030 <arch_cpuid_1@plt>
shr    $0x8,%eax
mov    $0xffffffff,%edx
mov    %eax,%ecx
shl    %cl,%edx
not    %edx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @arch_get_counter_mask() {
%1 = alloca i32
%2 = call i32 @arch_cpuid_1(i32 10)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = lshr i32 %3, 8
%5 = and i32 %4, 255
%6 = shl i32 1, %5
%7 = sub i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @arch_get_counter_mask() {
%1 = tail call i32 @arch_cpuid_1(i32 10)
%2 = lshr i32 %1, 8
%3 = and i32 %2, 255
%4 = shl nsw i32 -1, %3
%5 = xor i32 %4, -1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ midi_clock_request_continue();
int /*<<< orphan*/ midi_clock_request_stop();
void seq_ctrl_set_run_state(int run) {
  if (run) {
    midi_clock_request_continue();
  } else {
    midi_clock_request_stop();
  }
}


x86 assembly (clang, -O0):
<seq_ctrl_set_run_state>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1141 <seq_ctrl_set_run_state+0x21>
mov    $0x0,%al
call   1030 <midi_clock_request_continue@plt>
jmp    1148 <seq_ctrl_set_run_state+0x28>
mov    $0x0,%al
call   1040 <midi_clock_request_stop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_ctrl_set_run_state>:
xor    %eax,%eax
test   %edi,%edi
je     112b <seq_ctrl_set_run_state+0xb>
jmp    1030 <midi_clock_request_continue@plt>
jmp    1040 <midi_clock_request_stop@plt>

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

LLVM IR (-O2):
define void @seq_ctrl_set_run_state(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @midi_clock_request_continue()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @midi_clock_request_stop()
br label %7
7: ; preds = %5, %3
ret void
}
unsigned long insert_bba(unsigned long insn, long value __attribute__((unused)),
                         int dialect __attribute__((unused)),
                         const char **errmsg __attribute__((unused))) {
  return insn | (((insn >> 16) & 0x1f) << 11);
}


x86 assembly (clang, -O0):
<insert_bba>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x10,%rcx
and    $0x1f,%rcx
shl    $0xb,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_bba>:
mov    %rdi,%rax
shr    $0x5,%rax
and    $0xf800,%eax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @insert_bba(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %5
%10 = load i64, i64* %5
%11 = lshr i64 %10, 16
%12 = and i64 %11, 31
%13 = shl i64 %12, 11
%14 = or i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @insert_bba(i64 %0, i64 %1, i32 %2, i8** nocapture readnone %3) {
%5 = lshr i64 %0, 5
%6 = and i64 %5, 63488
%7 = or i64 %6, %0
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *);
void myexit(void) { pr_info("warn_on cleanup\n"); }


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

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

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

LLVM IR (-O2):
@.str = [17 x i8] c"warn_on cleanup\0A\00"
define void @myexit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ioctl(int, long, unsigned long *);
int net_ioctl(int s, long cmd, unsigned long *argp) {
  return ioctl(s, cmd, argp);
}


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

x86 assembly (clang, -O2):
<net_ioctl>:
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @net_ioctl(i32 %0, i64 %1, i64* %2) {
%4 = tail call i32 @ioctl(i32 %0, i64 %1, i64* %2)
ret i32 %4
}