xunge/DecIR huggingface dataset:
unsigned char hash(char *src) {
  unsigned char h;
  for (h = 0; *src && *src != ' '; src++) {
    h += 31 * h + *src;
  }
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1131 <hash+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    1141 <hash+0x41>
jmp    116b <hash+0x6b>
movzbl -0x9(%rbp),%eax
imul   $0x1f,%eax,%ecx
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    %eax,%ecx
movzbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <hash+0xc>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi),%ecx
test   $0xdf,%cl
je     112f <hash+0x2f>
movzbl %al,%edx
mov    %edx,%esi
shl    $0x5,%esi
sub    %edx,%esi
add    %al,%cl
add    %sil,%cl
add    $0x1,%rdi
mov    %ecx,%eax
jmp    1110 <hash+0x10>
ret

LLVM IR (-O0):
define zeroext i8 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
br label %4
4: ; preds = %28, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 32
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %31
16: ; preds = %14
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = mul nsw i32 31, %18
%20 = load i8*, i8** %2
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %19, %22
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = add nsw i32 %25, %23
%27 = trunc i32 %26 to i8
store i8 %27, i8* %3
br label %28
28: ; preds = %16
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %2
br label %4
31: ; preds = %14
%32 = load i8, i8* %3
ret i8 %32
}

LLVM IR (-O2):
define zeroext i8 @hash(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %10, %6 ]
%4 = phi i8 [ 0, %1 ], [ %9, %6 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %11
i8 32, label %11
]
6: ; preds = %2
%7 = mul i8 %4, 31
%8 = add i8 %5, %4
%9 = add i8 %8, %7
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2, %2
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_rwlockattr_t;

/* Variables and functions */
int ENOSYS;
int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr) { return -ENOSYS; }


x86 assembly (clang, -O0):
<pthread_rwlockattr_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_rwlockattr_destroy>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pthread_rwlockattr_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_rwlockattr_destroy(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
%3 = sub nsw i32 0, %2
ret i32 %3
}
int hour_minute_to_minute(int hour, int minute) { return (hour * 60 + minute); }


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

x86 assembly (clang, -O2):
<hour_minute_to_minute>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @hour_minute_to_minute(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 = mul nsw i32 %5, 60
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @hour_minute_to_minute(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 60
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Type definitions */
struct integer {
  int dummy;
};

/* Variables and functions */
scalar_t__ generic_ptr(int, int);
struct integer *integer_ptr(int number) {
  return ((struct integer *)generic_ptr(43, number));
}


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

x86 assembly (clang, -O2):
<integer_ptr>:
mov    %edi,%esi
mov    $0x2b,%edi
jmp    1030 <generic_ptr@plt>

LLVM IR (-O0):
%struct.integer = type { i32 }
define %struct.integer* @integer_ptr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @generic_ptr(i32 43, i32 %3)
%5 = inttoptr i64 %4 to %struct.integer*
ret %struct.integer* %5
}

LLVM IR (-O2):
%struct.integer = type { i32 }
define %struct.integer* @integer_ptr(i32 %0) {
%2 = tail call i64 @generic_ptr(i32 43, i32 %0)
%3 = inttoptr i64 %2 to %struct.integer*
ret %struct.integer* %3
}
const char *zlibVersion() { return "1.2.1"; }


x86 assembly (clang, -O0):
<zlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.1\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.1\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  int intNum1 = 1, intNum2 = 2, intNum3 = 3, intProduto = 0;
  intProduto = intNum1 + intNum2 + intNum3;
  intProduto = intProduto / 2;
  printf("Numero 1  : %d\nNumero 2  : %d\nNumero 3  : %d\n\nResultado : %d\n\n",
         intNum1, intNum2, intNum3, intProduto);
  printf("Fim de Programa\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%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    0xed8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x3,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"Numero 1 : %d\0ANumero 2 : %d\0ANumero 3 : %d\0A\0AResultado : %d\0A\0A\00"
@.str.1 = [17 x i8] c"Fim de Programa\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = sdiv i32 %10, 2
store i32 %11, i32* %4
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14, i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"Numero 1 : %d\0ANumero 2 : %d\0ANumero 3 : %d\0A\0AResultado : %d\0A\0A\00"
@str = [16 x i8] c"Fim de Programa\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 3, i32 3)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int rand();
int get_random_number() { return rand(); }


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

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

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

LLVM IR (-O2):
define i32 @get_random_number() {
%1 = tail call i32 (...) @rand()
ret i32 %1
}
/* Variables and functions */
size_t b64urldecsize(size_t n) {
  size_t r;
  r = ((n + 3) / 4) * 3;
  switch (n % 4) {
  case 0:
    break;
  case 1:
    return (0);
  case 2:
    r -= 2;
    break;
  case 3:
    r -= 1;
    break;
  default:
    return (0);
  }
  return (r);
}


x86 assembly (clang, -O0):
<b64urldecsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x3,%rax
shr    $0x2,%rax
lea    (%rax,%rax,2),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
and    $0x3,%eax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     1179 <b64urldecsize+0x79>
mov    -0x20(%rbp),%rax
lea    0xec4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1186 <b64urldecsize+0x86>
movq   $0x0,-0x8(%rbp)
jmp    118e <b64urldecsize+0x8e>
mov    -0x18(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x18(%rbp)
jmp    1186 <b64urldecsize+0x86>
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1186 <b64urldecsize+0x86>
movq   $0x0,-0x8(%rbp)
jmp    118e <b64urldecsize+0x8e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64urldecsize>:
lea    0x3(%rdi),%rax
shr    $0x2,%rax
lea    (%rax,%rax,2),%rcx
and    $0x3,%edi
xor    %eax,%eax
lea    0xee8(%rip),%rdx
movslq (%rdx,%rdi,4),%rsi
add    %rdx,%rsi
jmp    *%rsi
add    $0xfffffffffffffffe,%rcx
jmp    112b <b64urldecsize+0x2b>
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b64urldecsize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = add i64 %5, 3
%7 = udiv i64 %6, 4
%8 = mul i64 %7, 3
store i64 %8, i64* %4
%9 = load i64, i64* %3
%10 = urem i64 %9, 4
switch i64 %10, label %19 [
i64 0, label %11
i64 1, label %12
i64 2, label %13
i64 3, label %16
]
11: ; preds = %1
br label %20
12: ; preds = %1
store i64 0, i64* %2
br label %22
13: ; preds = %1
%14 = load i64, i64* %4
%15 = sub i64 %14, 2
store i64 %15, i64* %4
br label %20
16: ; preds = %1
%17 = load i64, i64* %4
%18 = sub i64 %17, 1
store i64 %18, i64* %4
br label %20
19: ; preds = %1
store i64 0, i64* %2
br label %22
20: ; preds = %16, %13, %11
%21 = load i64, i64* %4
store i64 %21, i64* %2
br label %22
22: ; preds = %20, %19, %12
%23 = load i64, i64* %2
ret i64 %23
}

LLVM IR (-O2):
define i64 @b64urldecsize(i64 %0) {
%2 = add i64 %0, 3
%3 = lshr i64 %2, 2
%4 = mul nuw i64 %3, 3
%5 = and i64 %0, 3
switch i64 %5, label %10 [
i64 0, label %11
i64 1, label %13
i64 2, label %6
i64 3, label %8
]
6: ; preds = %1
%7 = add i64 %4, -2
br label %11
8: ; preds = %1
%9 = add i64 %4, -1
br label %11
10: ; preds = %1
unreachable
11: ; preds = %8, %6, %1
%12 = phi i64 [ %9, %8 ], [ %7, %6 ], [ %4, %1 ]
br label %13
13: ; preds = %1, %11
%14 = phi i64 [ %12, %11 ], [ 0, %1 ]
ret i64 %14
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, char const *);
int shim_fremovexattr(int fd, const char *name) {
  return (int)shim_enosys(0, fd, name);
}


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

x86 assembly (clang, -O2):
<shim_fremovexattr>:
mov    %rsi,%rdx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_fremovexattr(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 i64 @shim_enosys(i32 0, i32 %5, i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @shim_fremovexattr(i32 %0, i8* %1) {
%3 = tail call i64 @shim_enosys(i32 0, i32 %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int main() {
  int a[10], *p, *q;
  q = &a[1];
  p = &q[-1];
  if (p >= &a[9])
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
lea    -0x30(%rbp),%rcx
add    $0x24,%rcx
cmp    %rcx,%rax
jb     1153 <main+0x43>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = getelementptr inbounds i32, i32* %6, i64 -1
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
%10 = icmp uge i32* %8, %9
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ change_case(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char letter[] = "abcd";
  change_case(letter);
  printf("%s\n", letter);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <change_case@plt>
lea    -0x9(%rbp),%rsi
lea    0xeb0(%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
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <change_case@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.letter = [5 x i8] c"abcd\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @change_case(i8* %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.letter = [5 x i8] c"abcd\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @change_case(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int vapi_test_start(int);
int main(int argc, char *argv[]) {
  return vapi_test_start(argc == 2 ? atoi(argv[1]) : 0x03);
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x42>
mov    $0x3,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x42>
mov    -0x14(%rbp),%edi
call   1040 <vapi_test_start@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    %edi,%eax
mov    $0x3,%edi
cmp    $0x2,%eax
jne    113c <main+0x1c>
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <atoi@plt>
mov    %eax,%edi
add    $0x8,%rsp
jmp    1040 <vapi_test_start@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %8
%15 = phi i32 [ %12, %8 ], [ 3, %13 ]
%16 = call i32 @vapi_test_start(i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 3, %2 ]
%10 = tail call i32 @vapi_test_start(i32 %9)
ret i32 %10
}
int ddsGetPixelFormatFlags(unsigned const char *buffer) {
  return (buffer[80] & 0xFF) | (buffer[81] & 0xFF) << 8 |
         (buffer[82] & 0xFF) << 16 | (buffer[83] & 0xFF) << 24;
}


x86 assembly (clang, -O0):
<ddsGetPixelFormatFlags>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x50(%rax),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x51(%rcx),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x52(%rcx),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x53(%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ddsGetPixelFormatFlags>:
mov    0x50(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ddsGetPixelFormatFlags(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 80
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 81
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = shl i32 %12, 8
%14 = or i32 %7, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 82
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 16
%21 = or i32 %14, %20
%22 = load i8*, i8** %2
%23 = getelementptr inbounds i8, i8* %22, i64 83
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 255
%27 = shl i32 %26, 24
%28 = or i32 %21, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @ddsGetPixelFormatFlags(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 80
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 81
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 82
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 83
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void khrIcdOsLibraryUnload(void *library) { dlclose(library); }


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

x86 assembly (clang, -O2):
<khrIcdOsLibraryUnload>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @khrIcdOsLibraryUnload(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
unsigned int rf_bitcount(unsigned int v) {
  v = v - ((v >> 1) & 0x55555555);
  v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
  return (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}


x86 assembly (clang, -O0):
<rf_bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rf_bitcount>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
imul   $0x1010101,%eax,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @rf_bitcount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = lshr i32 %4, 1
%6 = and i32 %5, 1431655765
%7 = sub i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = and i32 %8, 858993459
%10 = load i32, i32* %2
%11 = lshr i32 %10, 2
%12 = and i32 %11, 858993459
%13 = add i32 %9, %12
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = lshr i32 %15, 4
%17 = add i32 %14, %16
%18 = and i32 %17, 252645135
%19 = mul i32 %18, 16843009
%20 = lshr i32 %19, 24
ret i32 %20
}

LLVM IR (-O2):
define i32 @rf_bitcount(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = mul i32 %11, 16843009
%13 = lshr i32 %12, 24
ret i32 %13
}
/* Variables and functions */
int greatest_common_divisor(int, int);
int least_common_multiple(int a, int b) {
  int i;
  int gcd = greatest_common_divisor(a, b);
  if (gcd == 1)
    return a * b;
  return a * b / gcd;
}


x86 assembly (clang, -O0):
<least_common_multiple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <greatest_common_divisor@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1145 <least_common_multiple+0x35>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <least_common_multiple+0x43>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<least_common_multiple>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <greatest_common_divisor@plt>
imul   %ebp,%ebx
cmp    $0x1,%eax
je     112d <least_common_multiple+0x1d>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @least_common_multiple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @greatest_common_divisor(i32 %8, i32 %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %3
br label %23
17: ; preds = %2
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = mul nsw i32 %18, %19
%21 = load i32, i32* %7
%22 = sdiv i32 %20, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %17, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @least_common_multiple(i32 %0, i32 %1) {
%3 = tail call i32 @greatest_common_divisor(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 1
%5 = mul nsw i32 %1, %0
br i1 %4, label %8, label %6
6: ; preds = %2
%7 = sdiv i32 %5, %3
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ %5, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today;
  today.month = 9;
  today.day = 25;
  today.year = 2004;
  printf("Today's date is %i/%i/%.2i.\n", today.month, today.day,
         today.year % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x10(%rbp)
movl   $0x19,-0xc(%rbp)
movl   $0x7d4,-0x8(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x14(%rbp),%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
store i32 9, i32* %3
%4 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
store i32 25, i32* %4
%5 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
store i32 2004, i32* %5
%6 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.date, %struct.date* %2, i32 0, i32 2
%11 = load i32, i32* %10
%12 = srem i32 %11, 100
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Today's date is %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 9, i32 25, i32 4)
ret i32 0
}
int HelpItem138(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem138() {
ret i32 0
}
/* Variables and functions */
scalar_t__ isalnum(int);
bool is_valid_label_char(int c) { return isalnum(c) || c == '-' || c == '_'; }


x86 assembly (clang, -O0):
<is_valid_label_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    114e <is_valid_label_char+0x3e>
mov    $0x1,%al
cmpl   $0x2d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     114e <is_valid_label_char+0x3e>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_label_char>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x2d,%ebx
sete   %cl
cmp    $0x5f,%ebx
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_valid_label_char(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 45
%5 = or i1 %4, %3
%6 = icmp eq i32 %0, 95
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ check_backtrace();
int bar(int i) {
  if (i)
    bar(i - 1);
  else
    check_backtrace();
  return 1;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <bar+0x25>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <bar@plt>
jmp    114c <bar+0x2c>
mov    $0x0,%al
call   1040 <check_backtrace@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1030 <check_backtrace@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bar(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 %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 %6, 1
%8 = call i32 @bar(i32 %7)
br label %11
9: ; preds = %1
%10 = call i32 (...) @check_backtrace()
br label %11
11: ; preds = %9, %5
ret i32 1
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = tail call i32 (...) @check_backtrace()
ret i32 1
}
void gtk_curve_reset() {}


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

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

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

LLVM IR (-O2):
define void @gtk_curve_reset() {
ret void
}
/* Type definitions */
typedef double uint16_t;

/* Variables and functions */
uint16_t sec_to_tick(float sec) { return (2.271 / 1000000) * sec; }


x86 assembly (clang, -O0):
<sec_to_tick>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sec_to_tick>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sec_to_tick(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 2.271000e-06, %4
ret double %5
}

LLVM IR (-O2):
define double @sec_to_tick(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 2.271000e-06
ret double %3
}
/* Variables and functions */
size_t fwrite(void const *, int, size_t, void *);
int mn_write(void *fp, const void *data, size_t size) {
  if (fwrite(data, 1, size, fp) == size)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<mn_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
cmp    -0x20(%rbp),%rax
jne    1150 <mn_write+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1157 <mn_write+0x47>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mn_write>:
push   %rbx
mov    %rdx,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    %rbx,%rax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @mn_write(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i64 @fwrite(i8* %1, i32 1, i64 %2, i8* %0)
%5 = icmp ne i64 %4, %2
%6 = sext i1 %5 to i32
ret i32 %6
}
int test_imm_C2uint32_reg(unsigned int val) {
  return ((val) & (0xC2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C2uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_C2uint32_reg(i32 %0) {
%2 = and i32 %0, 194
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ increase_cseq(char *);
int /*<<< orphan*/ new_branch(char *);
void new_transaction(char *message) {
  increase_cseq(message);
  new_branch(message);
}


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

x86 assembly (clang, -O2):
<new_transaction>:
push   %rbx
mov    %rdi,%rbx
call   1030 <increase_cseq@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <new_branch@plt>

LLVM IR (-O0):
define void @new_transaction(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @increase_cseq(i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @new_branch(i8* %5)
ret void
}

LLVM IR (-O2):
define void @new_transaction(i8* %0) {
%2 = tail call i32 @increase_cseq(i8* %0)
%3 = tail call i32 @new_branch(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __dbg_check_disable();
int /*<<< orphan*/ port_disable();
void chSysDisable(void) {
  port_disable();
  __dbg_check_disable();
}


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

x86 assembly (clang, -O2):
<chSysDisable>:
push   %rax
xor    %eax,%eax
call   1040 <port_disable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__dbg_check_disable@plt>

LLVM IR (-O0):
define void @chSysDisable() {
%1 = call i32 (...) @port_disable()
%2 = call i32 (...) @__dbg_check_disable()
ret void
}

LLVM IR (-O2):
define void @chSysDisable() {
%1 = tail call i32 (...) @port_disable()
%2 = tail call i32 (...) @__dbg_check_disable()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void handle_fatal_error(char *msg) {
  printf(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle_fatal_error>:
push   %rax
call   1030 <printf@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @handle_fatal_error(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void UARTModemControlClear(unsigned int baseAdd, unsigned int modeFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &=
      ~(modeFlag &
        ((0x00000008u) | (0x00000004u) | (0x00000002u) | (0x00000001u)));
}


x86 assembly (clang, -O0):
<UARTModemControlClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
and    $0xf,%edx
xor    $0xffffffff,%edx
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTModemControlClear>:
not    %esi
or     $0xfffffff0,%esi
add    $0x10,%edi
and    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTModemControlClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 15
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = add i32 %8, 16
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = and i32 %12, %7
store volatile i32 %13, i32* %11
ret void
}

LLVM IR (-O2):
define void @UARTModemControlClear(i32 %0, i32 %1) {
%3 = and i32 %1, 15
%4 = xor i32 %3, -1
%5 = add i32 %0, 16
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, %4
store volatile i32 %9, i32* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void __makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) {
  __set_errno(ENOSYS);
}


x86 assembly (clang, -O0):
<__makecontext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define void @__makecontext(i32* %0, void ()* %1, i32 %2, ...) {
%4 = alloca i32*
%5 = alloca void ()*
%6 = alloca i32
store i32* %0, i32** %4
store void ()* %1, void ()** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret void
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define void @__makecontext(i32* nocapture readnone %0, void ()* nocapture readnone %1, i32 %2, ...) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int argc, const char *argv[]) { return EXIT_SUCCESS; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
uint32_t lfs1_fromle32(uint32_t a) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @lfs1_fromle32(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int genSwaraValue(int rc, int sc) {
  int scMax = 72;
  printf("In genSwaraValue");
  printf("rc=<%d> sc= <%d>", rc, sc);
  if (rc = 1) {
  }
}


x86 assembly (clang, -O0):
<genSwaraValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x48,-0x10(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    115d <genSwaraValue+0x4d>
jmp    1162 <genSwaraValue+0x52>
jmp    1162 <genSwaraValue+0x52>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genSwaraValue>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"In genSwaraValue\00"
@.str.1 = [17 x i8] c"rc=<%d> sc= <%d>\00"
define i32 @genSwaraValue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 72, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
store i32 1, i32* %4
br i1 true, label %11, label %12
11: ; preds = %2
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [17 x i8] c"In genSwaraValue\00"
@.str.1 = [17 x i8] c"rc=<%d> sc= <%d>\00"
define i32 @genSwaraValue(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
size_t sdo_get_expediated_size(const struct can_frame *frame) {
  int n = (frame->data[0] >> 2) & 3;
  return 4 - n;
}


x86 assembly (clang, -O0):
<sdo_get_expediated_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
sar    $0x2,%eax
and    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    $0x4,%eax
sub    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdo_get_expediated_size>:
mov    (%rdi),%rax
mov    (%rax),%ecx
shr    $0x2,%ecx
and    $0x3,%ecx
mov    $0x4,%eax
sub    %rcx,%rax
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define i64 @sdo_get_expediated_size(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
%3 = alloca i32
store %struct.can_frame* %0, %struct.can_frame** %2
%4 = load %struct.can_frame*, %struct.can_frame** %2
%5 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %4, i32 0, i32 0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = ashr i32 %8, 2
%10 = and i32 %9, 3
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = sub nsw i32 4, %11
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define i64 @sdo_get_expediated_size(%struct.can_frame* nocapture %0) {
%2 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = lshr i32 %4, 2
%6 = and i32 %5, 3
%7 = sub nuw nsw i32 4, %6
%8 = zext i32 %7 to i64
ret i64 %8
}
/* Variables and functions */
scalar_t__ isalpha(int);
scalar_t__ isdigit(int);
int isfschar(int c) {
  return (isalpha(c) || isdigit(c) || c == '-' || c == '_');
}


x86 assembly (clang, -O0):
<isfschar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isalpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1178 <isfschar+0x58>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1178 <isfschar+0x58>
mov    $0x1,%al
cmpl   $0x2d,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1178 <isfschar+0x58>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfschar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <isalpha@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114d <isfschar+0x2d>
mov    %ebp,%edi
call   1030 <isdigit@plt>
cmp    $0x2d,%ebp
je     114d <isfschar+0x2d>
test   %rax,%rax
jne    114d <isfschar+0x2d>
xor    %ebx,%ebx
cmp    $0x5f,%ebp
sete   %bl
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isfschar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isdigit(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 45
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 95
br label %16
16: ; preds = %13, %10, %6, %1
%17 = phi i1 [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isfschar(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i64 @isdigit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = icmp eq i32 %0, 45
%8 = or i1 %7, %6
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = icmp eq i32 %0, 95
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %9, %4, %1
%13 = phi i32 [ 1, %4 ], [ 1, %1 ], [ %11, %9 ]
ret i32 %13
}
char *modNameMunge(char *mod) {
  unsigned int i;
  for (i = 0; mod[i]; i++) {
    if (mod[i] == '-')
      mod[i] = '_';
  }
  return mod;
}


x86 assembly (clang, -O0):
<modNameMunge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1152 <modNameMunge+0x52>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    113f <modNameMunge+0x3f>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0x5f,(%rax,%rcx,1)
jmp    1144 <modNameMunge+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <modNameMunge+0xf>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modNameMunge>:
mov    %rdi,%rax
xor    %ecx,%ecx
jmp    1117 <modNameMunge+0x17>
nopw   0x0(%rax,%rax,1)
movb   $0x5f,(%rax,%rcx,1)
add    $0x1,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%edx
cmp    $0x2d,%dl
je     1110 <modNameMunge+0x10>
test   %dl,%dl
jne    1114 <modNameMunge+0x14>
ret

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

LLVM IR (-O2):
define i8* @modNameMunge(i8* returned %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i32 [ 0, %1 ], [ %9, %8 ]
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
switch i8 %6, label %8 [
i8 0, label %10
i8 45, label %7
]
7: ; preds = %2
store i8 95, i8* %5
br label %8
8: ; preds = %2, %7
%9 = add i32 %3, 1
br label %2
10: ; preds = %2
ret i8* %0
}