xunge/DecIR huggingface dataset:
int main() {
  enum bool { false, true };
  enum bool bool1 = false;
  enum bool bool2 = true;
  printf("bool1 = %d\n", bool1);
  printf("bool2 = %d\n", bool2);
  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
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
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
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"bool1 = %d\0A\00"
@.str.1 = [12 x i8] c"bool2 = %d\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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"bool1 = %d\0A\00"
@.str.1 = [12 x i8] c"bool2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret i32 0
}
int char_to_int(unsigned char x) {
  switch (x) {
  case '0':
    return 0;
  case '1':
    return 1;
  case '2':
    return 2;
  case '3':
    return 3;
  case '4':
    return 4;
  case '5':
    return 5;
  case '6':
    return 6;
  case '7':
    return 7;
  case '8':
    return 8;
  case '9':
    return 9;
  }
  return 100;
}


x86 assembly (clang, -O0):
<char_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x9,%eax
ja     11ac <char_to_int+0xac>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x2,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x3,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x4,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x5,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x6,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x7,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x8,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x9,-0x4(%rbp)
jmp    11b3 <char_to_int+0xb3>
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_to_int>:
add    $0xd0,%dil
cmp    $0xa,%dil
movzbl %dil,%eax
mov    $0x64,%ecx
cmovb  %eax,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @char_to_int(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
switch i32 %5, label %16 [
i32 48, label %6
i32 49, label %7
i32 50, label %8
i32 51, label %9
i32 52, label %10
i32 53, label %11
i32 54, label %12
i32 55, label %13
i32 56, label %14
i32 57, label %15
]
6: ; preds = %1
store i32 0, i32* %2
br label %17
7: ; preds = %1
store i32 1, i32* %2
br label %17
8: ; preds = %1
store i32 2, i32* %2
br label %17
9: ; preds = %1
store i32 3, i32* %2
br label %17
10: ; preds = %1
store i32 4, i32* %2
br label %17
11: ; preds = %1
store i32 5, i32* %2
br label %17
12: ; preds = %1
store i32 6, i32* %2
br label %17
13: ; preds = %1
store i32 7, i32* %2
br label %17
14: ; preds = %1
store i32 8, i32* %2
br label %17
15: ; preds = %1
store i32 9, i32* %2
br label %17
16: ; preds = %1
store i32 100, i32* %2
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @char_to_int(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = select i1 %3, i8 %2, i8 100
%5 = zext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init() {
  srand(time(NULL));
  return;
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ primes;

/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ showArray(int *, int);
int main(void) {
  int primes[] = {25, 3, 5, 7, 11, 13};
  int *p = primes;
  int size = sizeof(primes) / 4;
  showArray(p, size);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x6,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1030 <showArray@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
call   1030 <showArray@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.primes = [6 x i32] [i32 25, i32 3, i32 5, i32 7, i32 11, i32 13]
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [6 x i32]* %2 to i8*
%6 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
store i32* %6, i32** %3
store i32 6, i32* %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %4
%9 = call i32 @showArray(i32* %7, i32 %8)
%10 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.primes = [6 x i32] [i32 25, i32 3, i32 5, i32 7, i32 11, i32 13]
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @showArray(i32* %3, i32 6)
%5 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
unsigned int const mus_big_endian_unsigned_int(unsigned char *);
unsigned int const mus_little_endian_unsigned_int(unsigned char *);
int equal_big_or_little_endian(unsigned char *n1, const unsigned int n2) {
  return ((mus_big_endian_unsigned_int(n1) == n2) ||
          (mus_little_endian_unsigned_int(n1) == n2));
}


x86 assembly (clang, -O0):
<equal_big_or_little_endian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mus_big_endian_unsigned_int@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
je     115a <equal_big_or_little_endian+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <mus_little_endian_unsigned_int@plt>
cmp    -0xc(%rbp),%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_big_or_little_endian>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <mus_big_endian_unsigned_int@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ebp,%ecx
je     1149 <equal_big_or_little_endian+0x29>
mov    %rbx,%rdi
call   1040 <mus_little_endian_unsigned_int@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @equal_big_or_little_endian(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @mus_big_endian_unsigned_int(i8* %5)
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @mus_little_endian_unsigned_int(i8* %10)
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br label %14
14: ; preds = %9, %2
%15 = phi i1 [ true, %2 ], [ %13, %9 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @equal_big_or_little_endian(i8* %0, i32 %1) {
%3 = tail call i32 @mus_big_endian_unsigned_int(i8* %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @mus_little_endian_unsigned_int(i8* %0)
%7 = icmp eq i32 %6, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ worker_leave_main_lock();
int /*<<< orphan*/ worker_try_enter_main_lock();
int check_stop_callback() {
  if (!worker_try_enter_main_lock())
    return 1;
  worker_leave_main_lock();
  return 0;
}


x86 assembly (clang, -O0):
<check_stop_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <worker_try_enter_main_lock@plt>
cmp    $0x0,%eax
jne    1144 <check_stop_callback+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1152 <check_stop_callback+0x32>
mov    $0x0,%al
call   1030 <worker_leave_main_lock@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_stop_callback>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <worker_try_enter_main_lock@plt>
test   %eax,%eax
je     1137 <check_stop_callback+0x17>
xor    %eax,%eax
call   1030 <worker_leave_main_lock@plt>
jmp    113c <check_stop_callback+0x1c>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @check_stop_callback() {
%1 = tail call i32 (...) @worker_try_enter_main_lock()
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @worker_leave_main_lock()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 0, %3 ], [ 1, %0 ]
ret i32 %6
}
int test_imm_7Cint8_reg(signed char val) {
  return ((val) & (-0x7C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_7Cint8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -124
%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_7Cint8_reg(i8 signext %0) {
%2 = and i8 %0, -124
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float distancia, volume, consumo;
  scanf("%f", &distancia);
  scanf("%f", &volume);
  consumo = distancia / volume;
  printf("O CONSUMO MEDIO = %.2fKM/L\n", consumo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
divss  0x8(%rsp),%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [28 x i8] c"O CONSUMO MEDIO = %.2fKM/L\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fdiv float %6, %7
store float %8, float* %3
%9 = load float, float* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [28 x i8] c"O CONSUMO MEDIO = %.2fKM/L\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fdiv float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}
void enableHx1(void) {}


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

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

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

LLVM IR (-O2):
define void @enableHx1() {
ret void
}
int int_ops_and(int l, int r) { return l & r; }


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

x86 assembly (clang, -O2):
<int_ops_and>:
mov    %edi,%eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @int_ops_and(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 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @int_ops_and(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
int fun592() { return 592; }


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

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

LLVM IR (-O0):
define i32 @fun592() {
ret i32 592
}

LLVM IR (-O2):
define i32 @fun592() {
ret i32 592
}
/* Variables and functions */
int next();
float rnd_floating() { return (float)(next() % 1000000) / 1000000.0; }


x86 assembly (clang, -O0):
<rnd_floating>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next@plt>
mov    $0xf4240,%ecx
cltd
idiv   %ecx
cvtsi2ss %edx,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd_floating>:
push   %rax
xor    %eax,%eax
call   1030 <next@plt>
cltq
imul   $0x431bde83,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rcx
add    %edx,%ecx
imul   $0xf4240,%ecx,%ecx
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
divss  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rnd_floating() {
%1 = call i32 (...) @next()
%2 = srem i32 %1, 1000000
%3 = sitofp i32 %2 to float
%4 = fpext float %3 to double
%5 = fdiv double %4, 1.000000e+06
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @rnd_floating() {
%1 = tail call i32 (...) @next()
%2 = srem i32 %1, 1000000
%3 = sitofp i32 %2 to float
%4 = fdiv float %3, 1.000000e+06
ret float %4
}
int countFields(char *str, const char token_delimiter) {
  int token_counter = 0;
  while (*str) {
    if (token_delimiter == *str) {
      token_counter++;
    }
    str++;
  }
  token_counter += 2;
  return token_counter;
}


x86 assembly (clang, -O0):
<countFields>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <countFields+0x4f>
movsbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113e <countFields+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <countFields+0x15>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countFields>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <countFields+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <countFields+0x10>
add    $0x2,%eax
ret
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @countFields(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = add nuw i32 %11, 2
br label %17
17: ; preds = %15, %2
%18 = phi i32 [ 2, %2 ], [ %16, %15 ]
ret i32 %18
}
OP(dd, bb) { op_bb(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_bb()
ret i32 undef
}
int test_imm_3Buint8_reg(unsigned char val) {
  return ((val) & (0x3B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Buint8_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, 59
%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_3Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 59
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ grava_li(int, char *);
void rot4_sem() { grava_li(1, "}"); }


x86 assembly (clang, -O0):
<rot4_sem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <grava_li@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot4_sem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <grava_li@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"}\00"
define void @rot4_sem() {
%1 = tail call i32 @grava_li(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_rcp_ss(int /*<<< orphan*/);
__m128 test_mm_rcp_ss(__m128 x) { return _mm_rcp_ss(x); }


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

x86 assembly (clang, -O2):
<test_mm_rcp_ss>:
jmp    1030 <_mm_rcp_ss@plt>

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

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

/* Variables and functions */
bool mp2vpicx_get_progressive(const uint8_t *p_mp2vpicx) {
  return !!(p_mp2vpicx[8] & 0x80);
}


x86 assembly (clang, -O0):
<mp2vpicx_get_progressive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_get_progressive>:
mov    0x20(%rdi),%eax
shr    $0x7,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @mp2vpicx_get_progressive(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = and i32 %5, 128
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @mp2vpicx_get_progressive(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = lshr i32 %3, 7
%5 = and i32 %4, 1
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ strncat(char *, char *, size_t);
wchar_t *wcsncat(wchar_t *s1, const wchar_t *s2, size_t n) {
  return (wchar_t *)strncat((char *)s1, (char *)s2, n);
}


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

x86 assembly (clang, -O2):
<wcsncat>:
jmp    1030 <strncat@plt>

LLVM IR (-O0):
define i32* @wcsncat(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = load i32*, i32** %5
%10 = bitcast i32* %9 to i8*
%11 = load i64, i64* %6
%12 = call i64 @strncat(i8* %8, i8* %10, i64 %11)
%13 = inttoptr i64 %12 to i32*
ret i32* %13
}

LLVM IR (-O2):
define i32* @wcsncat(i32* %0, i32* %1, i64 %2) {
%4 = bitcast i32* %0 to i8*
%5 = bitcast i32* %1 to i8*
%6 = tail call i64 @strncat(i8* %4, i8* %5, i64 %2)
%7 = inttoptr i64 %6 to i32*
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void setkey_usage(char *argv[]) {
  fprintf(stderr,
          "%s [-t <table>] [-k <index>] [-v value] [-r] [-h]\n"
          "  -t <table> Select table\n"
          "  -k <index> Select key\n"
          "  -v <value> Set entry\n"
          "  -r         Read current entry\n"
          "  -h         Print help\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [180 x i8] c"%s [-t <table>] [-k <index>] [-v value] [-r] [-h]\0A -t <table> Select table\0A -k <index> Select key\0A -v <value> Set entry\0A -r Read current entry\0A -h Print help\0A\00"
define void @setkey_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [180 x i8] c"%s [-t <table>] [-k <index>] [-v value] [-r] [-h]\0A -t <table> Select table\0A -k <index> Select key\0A -v <value> Set entry\0A -r Read current entry\0A -h Print help\0A\00"
define void @setkey_usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int f(int /*<<< orphan*/, int);
main() { return f(0, 5); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0, i32 5)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int func2(int a, int b) {
  int r = 0;
  putchar(a);
  putchar(b);
  r = a + b;
  return r;
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @func2(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 0, i32* %5
%6 = load i32, i32* %3
%7 = call i32 @putchar(i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @putchar(i32 %8)
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @func2(i32 %0, i32 %1) {
%3 = tail call i32 @putchar(i32 %0)
%4 = tail call i32 @putchar(i32 %1)
%5 = add nsw i32 %1, %0
ret i32 %5
}
/* Type definitions */
typedef char *uint16_t;

/* Variables and functions */
__attribute__((always_, const)) uint16_t __bswap_variable_16(uint16_t x) {
  __asm__("xchgb %b0,%h0" : "=Q"(x) : "0"(x));
  return x;
}


x86 assembly (clang, -O0):
<__bswap_variable_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xchg   %ah,%al
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bswap_variable_16>:
mov    %rdi,%rax
xchg   %ah,%al
ret

LLVM IR (-O0):
define i8* @__bswap_variable_16(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* asm "xchgb ${0:b},${0:h}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define i8* @__bswap_variable_16(i8* readnone %0) {
%2 = tail call i8* asm "xchgb ${0:b},${0:h}", "=Q,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
char *virt_getcwd(char *, size_t, int);
char *_getcwd(char *buf, size_t size) { return virt_getcwd(buf, size, 1); }


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

x86 assembly (clang, -O2):
<_getcwd>:
mov    $0x1,%edx
jmp    1030 <virt_getcwd@plt>

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

LLVM IR (-O2):
define i8* @_getcwd(i8* %0, i64 %1) {
%3 = tail call i8* @virt_getcwd(i8* %0, i64 %1, i32 1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ clear32(int, int);
int /*<<< orphan*/ set32(int, int);
int /*<<< orphan*/ udelay(int);
int /*<<< orphan*/ write32(int, int);
void powerpc_reset(void) {
  write32((0xd800000 + 0x034), (1 << 30));
  clear32((0xd800000 + 0x194), 0x30);
  udelay(100);
  set32((0xd800000 + 0x194), 0x20);
  udelay(100);
  set32((0xd800000 + 0x194), 0x10);
  udelay(100000);
  set32((0xd800000 + 0x070), 1);
}


x86 assembly (clang, -O0):
<powerpc_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd800034,%edi
mov    $0x40000000,%esi
call   1030 <write32@plt>
mov    $0xd800194,%edi
mov    $0x30,%esi
call   1060 <clear32@plt>
mov    $0x64,%edi
call   1050 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x20,%esi
call   1040 <set32@plt>
mov    $0x64,%edi
call   1050 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x10,%esi
call   1040 <set32@plt>
mov    $0x186a0,%edi
call   1050 <udelay@plt>
mov    $0xd800070,%edi
mov    $0x1,%esi
call   1040 <set32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<powerpc_reset>:
push   %rax
mov    $0xd800034,%edi
mov    $0x40000000,%esi
call   1030 <write32@plt>
mov    $0xd800194,%edi
mov    $0x30,%esi
call   1060 <clear32@plt>
mov    $0x64,%edi
call   1050 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x20,%esi
call   1040 <set32@plt>
mov    $0x64,%edi
call   1050 <udelay@plt>
mov    $0xd800194,%edi
mov    $0x10,%esi
call   1040 <set32@plt>
mov    $0x186a0,%edi
call   1050 <udelay@plt>
mov    $0xd800070,%edi
mov    $0x1,%esi
pop    %rax
jmp    1040 <set32@plt>

LLVM IR (-O0):
define void @powerpc_reset() {
%1 = call i32 @write32(i32 226492468, i32 1073741824)
%2 = call i32 @clear32(i32 226492820, i32 48)
%3 = call i32 @udelay(i32 100)
%4 = call i32 @set32(i32 226492820, i32 32)
%5 = call i32 @udelay(i32 100)
%6 = call i32 @set32(i32 226492820, i32 16)
%7 = call i32 @udelay(i32 100000)
%8 = call i32 @set32(i32 226492528, i32 1)
ret void
}

LLVM IR (-O2):
define void @powerpc_reset() {
%1 = tail call i32 @write32(i32 226492468, i32 1073741824)
%2 = tail call i32 @clear32(i32 226492820, i32 48)
%3 = tail call i32 @udelay(i32 100)
%4 = tail call i32 @set32(i32 226492820, i32 32)
%5 = tail call i32 @udelay(i32 100)
%6 = tail call i32 @set32(i32 226492820, i32 16)
%7 = tail call i32 @udelay(i32 100000)
%8 = tail call i32 @set32(i32 226492528, i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t crc_add_byte(uint8_t x, uint8_t acc) { return acc + x; }


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

x86 assembly (clang, -O2):
<crc_add_byte>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @crc_add_byte(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @crc_add_byte(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void def_msleep(uint32_t ms) {
  volatile uint32_t dec = ms * 2667;
  while (dec--)
    ;
}


x86 assembly (clang, -O0):
<def_msleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xa6b,-0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     112a <def_msleep+0x2a>
jmp    1111 <def_msleep+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_msleep>:
imul   $0xa6b,%edi,%eax
mov    %eax,-0x4(%rsp)
nopw   0x0(%rax,%rax,1)
subl   $0x1,-0x4(%rsp)
jae    1110 <def_msleep+0x10>
ret

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

LLVM IR (-O2):
define void @def_msleep(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = mul nsw i32 %0, 2667
store volatile i32 %4, i32* %2
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %2
%7 = add nsw i32 %6, -1
store volatile i32 %7, i32* %2
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %5
9: ; preds = %5
ret void
}
/* Variables and functions */
scalar_t__ isalnum(char);
int constituent(char c) {
  return isalnum(c) || c == '.' || c == '-' || c == '+' || c == '_';
}


x86 assembly (clang, -O0):
<constituent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    117c <constituent+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     117c <constituent+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x2(%rbp)
je     117c <constituent+0x6c>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0x2(%rbp)
je     117c <constituent+0x6c>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<constituent>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1127 <constituent+0x17>
pop    %rbx
ret
cmp    $0x2e,%bl
ja     113f <constituent+0x2f>
movzbl %bl,%ecx
movabs $0x680000000000,%rdx
bt     %rcx,%rdx
jb     1125 <constituent+0x15>
xor    %eax,%eax
cmp    $0x5f,%bl
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @constituent(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isalnum(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 46
br i1 %9, label %22, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 45
br i1 %13, label %22, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 43
br i1 %17, label %22, label %18
18: ; preds = %14
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 95
br label %22
22: ; preds = %18, %14, %10, %6, %1
%23 = phi i1 [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @constituent(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = freeze i64 %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
switch i8 %0, label %6 [
i8 46, label %9
i8 45, label %9
i8 43, label %9
]
6: ; preds = %5
%7 = icmp eq i8 %0, 95
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %5, %5, %1, %6
%10 = phi i32 [ 1, %5 ], [ %8, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %10
}
void charToString(char *buffer, char c) {
  buffer[0] = c;
  buffer[1] = 0;
}


x86 assembly (clang, -O0):
<charToString>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<charToString>:
mov    %sil,(%rdi)
movb   $0x0,0x1(%rdi)
ret

LLVM IR (-O0):
define void @charToString(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 %5, i8* %7
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @charToString(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 0, i8* %3
ret void
}
/* Variables and functions */
int sock_data_push(int, char *, int);
int sock_send(int fd, char *str, int len) {
  return sock_data_push(fd, str, len);
}


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

x86 assembly (clang, -O2):
<sock_send>:
jmp    1030 <sock_data_push@plt>

LLVM IR (-O0):
define i32 @sock_send(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 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @sock_data_push(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sock_send(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @sock_data_push(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void *string_max_writer(void *ud, char c) {
  char *str = ((char **)ud)[0];
  char *max = ((char **)ud)[1];
  if (str != max) {
    *(str++) = c;
    ((char **)ud)[0] = str;
  }
  return ud;
}


x86 assembly (clang, -O0):
<string_max_writer>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
je     1152 <string_max_writer+0x52>
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_max_writer>:
mov    %rdi,%rax
mov    (%rdi),%rcx
cmp    0x8(%rdi),%rcx
je     1116 <string_max_writer+0x16>
mov    %sil,(%rcx)
add    $0x1,%rcx
mov    %rcx,(%rax)
ret

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

LLVM IR (-O2):
define i8* @string_max_writer(i8* returned %0, i8 signext %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = icmp eq i8* %4, %7
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %1, i8* %4
store i8* %10, i8** %3
br label %11
11: ; preds = %9, %2
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SYSCFG_EXTILineConfig(int /*<<< orphan*/,
                                         int /*<<< orphan*/);
void gpioExtiLineConfig(uint8_t portsrc, uint8_t pinsrc) {
  SYSCFG_EXTILineConfig(portsrc, pinsrc);
}


x86 assembly (clang, -O0):
<gpioExtiLineConfig>:
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 <SYSCFG_EXTILineConfig@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpioExtiLineConfig>:
jmp    1030 <SYSCFG_EXTILineConfig@plt>

LLVM IR (-O0):
define void @gpioExtiLineConfig(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 @SYSCFG_EXTILineConfig(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @gpioExtiLineConfig(i32 %0, i32 %1) {
%3 = tail call i32 @SYSCFG_EXTILineConfig(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int get_socketudp(void) {
  int fd;
  fd = socket(AF_INET, SOCK_DGRAM, 0);
  if (fd == -1) {
    fprintf(stderr, "Unable to open socket.\n");
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<get_socketudp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    116f <get_socketudp+0x4f>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1175 <get_socketudp+0x55>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_socketudp>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1156 <get_socketudp+0x36>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"Unable to open socket.\0A\00"
define i32 @get_socketudp() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_DGRAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %13
11: ; preds = %0
%12 = load i32, i32* %2
store i32 %12, i32* %1
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"Unable to open socket.\0A\00"
define i32 @get_socketudp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %5
ret i32 %3
}
/* Variables and functions */
size_t fibs(size_t arg) {
  if (arg < 2) {
    return 1;
  }
  return fibs(arg - 1) + fibs(arg - 2);
}


x86 assembly (clang, -O0):
<fibs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x2,-0x10(%rbp)
jae    1134 <fibs+0x24>
movq   $0x1,-0x8(%rbp)
jmp    1160 <fibs+0x50>
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <fibs@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x2,%rdi
call   1030 <fibs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibs>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x2,%rdi
jb     114a <fibs+0x3a>
mov    %rdi,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rbx),%rdi
call   1030 <fibs@plt>
add    $0xfffffffffffffffe,%rbx
add    %rax,%r14
cmp    $0x1,%rbx
ja     1130 <fibs+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fibs(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add i64 %4, -1
%7 = tail call i64 @fibs(i64 %6)
%8 = add i64 %4, -2
%9 = add i64 %7, %5
%10 = icmp ult i64 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
int testExe2libImp();
int testExe2lib(void) { return testExe2libImp(); }


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

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

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

LLVM IR (-O2):
define i32 @testExe2lib() {
%1 = tail call i32 (...) @testExe2libImp()
ret i32 %1
}