xunge/DecIR huggingface dataset:
unsigned xrop3_166_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_166_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_166_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
and    %eax,%ecx
xor    %ecx,%edi
xor    %esi,%ecx
xor    $0xff,%ecx
not    %eax
and    %esi,%eax
or     %edi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_166_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = and i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %5
%29 = load i32, i32* %9
%30 = xor i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = load i32, i32* %8
%35 = load i32, i32* %7
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = or i32 %33, %37
%39 = load i32, i32* %7
%40 = load i32, i32* %6
%41 = xor i32 %40, -1
%42 = and i32 %39, %41
%43 = load i32, i32* %5
%44 = and i32 %42, %43
%45 = or i32 %38, %44
ret i32 %45
}

LLVM IR (-O2):
define i32 @xrop3_166_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -1
%8 = and i32 %4, %7
%9 = xor i32 %8, %3
%10 = xor i32 %8, %5
%11 = xor i32 %10, 255
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
%15 = or i32 %14, %9
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
bool file_readable(const char *file) {
  (void)(0);
  FILE *in = fopen(file, "r");
  if (in == NULL)
    return false;
  fclose(in);
  return true;
}


x86 assembly (clang, -O0):
<file_readable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <file_readable+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <file_readable+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_readable>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_readable+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @file_readable(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %13
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i32 @fclose(i32* %11)
store i32 1, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @file_readable(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
int isVowel(char c) {
  char vowels[5] = {'a', 'e', 'i', 'o', 'u'};
  for (int i = 0; i < 5; i++) {
    if (c == vowels[i]) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isVowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xeeb(%rip),%al
mov    %al,-0x6(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    1161 <isVowel+0x61>
movsbl -0x5(%rbp),%eax
movslq -0x10(%rbp),%rcx
movsbl -0xa(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    114e <isVowel+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <isVowel+0x68>
jmp    1153 <isVowel+0x53>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <isVowel+0x23>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVowel>:
add    $0x9f,%dil
ror    %dil
xor    %eax,%eax
cmp    $0xa,%dil
ja     111d <isVowel+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.isVowel = [11 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1]
define i32 @isVowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 11
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i8 %3 to i64
%7 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.isVowel, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
unsigned int __min_unsigned_int(unsigned int x, unsigned int y) {
  return ((x) > (y) ? (y) : (x));
}


x86 assembly (clang, -O0):
<__min_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <__min_unsigned_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <__min_unsigned_int+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__min_unsigned_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmova  %esi,%eax
ret

LLVM IR (-O0):
define i32 @__min_unsigned_int(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 = icmp ugt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @__min_unsigned_int(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void EntrarDato(int dato, int ind_p) {
  extern double buffer[100];
  buffer[ind_p] = dato;
}


x86 assembly (clang, -O0):
<EntrarDato>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movslq -0x8(%rbp),%rcx
mov    0x2ec6(%rip),%rax
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EntrarDato>:
cvtsi2sd %edi,%xmm0
movslq %esi,%rax
mov    0x2ed2(%rip),%rcx
movsd  %xmm0,(%rcx,%rax,8)
ret

LLVM IR (-O0):
@buffer = external global [100 x double]
define void @EntrarDato(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 = sitofp i32 %5 to double
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x double], [100 x double]* @buffer, i64 0, i64 %8
store double %6, double* %9
ret void
}

LLVM IR (-O2):
@buffer = external global [100 x double]
define void @EntrarDato(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds [100 x double], [100 x double]* @buffer, i64 0, i64 %4
store double %3, double* %5
ret void
}
int test_imm_9Eint8_mem(signed char *val) {
  return ((*val) & (-0x9E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Eint8_mem>:
movsbl (%rdi),%eax
test   $0xffffff62,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -158
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int mu_badv_mesh_n_nodes(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main(void) { printf("%d", mu_badv_mesh_n_nodes(NULL, NULL)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1040 <mu_badv_mesh_n_nodes@plt>
mov    %eax,%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1040 <mu_badv_mesh_n_nodes@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @mu_badv_mesh_n_nodes(i32* null, i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void perhapsPerformBackup(char *deviceId) {}


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

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

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

LLVM IR (-O2):
define void @perhapsPerformBackup(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void _new_line(void) { fprintf(stdout, "\n"); }


x86 assembly (clang, -O0):
<_new_line>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_new_line>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [2 x i8] c"\0A\00"
define void @_new_line() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL) {
    fprintf(stderr, "malloc() failed: %ld\n", (long)size);
    exit(EXIT_FAILURE);
    ;
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <xmalloc+0x4b>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"malloc() failed: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"malloc() failed: %ld\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
int _test_cls_func(const void *ptr) {
  (void)ptr;
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @_test_cls_func(i8* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ factorial(int);
int printf(char *, int, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int input = argv[1] ? atoi(argv[1]) : 10;
  return printf("%d! = %llu\n", input, factorial(input));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     116a <main+0x3a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x18(%rbp)
jmp    1177 <main+0x47>
mov    $0xa,%eax
mov    %eax,-0x18(%rbp)
jmp    1177 <main+0x47>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rdi
test   %rdi,%rdi
je     1143 <main+0x13>
call   1050 <atoi@plt>
mov    %eax,%ebx
jmp    1148 <main+0x18>
mov    $0xa,%ebx
mov    %ebx,%edi
call   1030 <factorial@plt>
lea    0xeaa(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%d! = %llu\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ %7, %6 ], [ 10, %2 ]
%10 = tail call i32 @factorial(i32 %9)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 %11
}
/* Variables and functions */
scalar_t__ isnewline(int);
int is_internal_newline(int c) { return isnewline(c) || (c == 0xff); }


x86 assembly (clang, -O0):
<is_internal_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isnewline@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1142 <is_internal_newline+0x32>
cmpl   $0xff,-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_internal_newline>:
push   %rbx
mov    %edi,%ebx
call   1030 <isnewline@plt>
test   %rax,%rax
setne  %al
cmp    $0xff,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_internal_newline(i32 %0) {
%2 = tail call i64 @isnewline(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 255
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ nokia_click(char, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char character;
  int count = 0;
  while (character = getchar()) {
    if (character != '\n') {
      nokia_click(character, &count);
    } else {
      break;
    }
  }
  printf("%d", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
cmp    $0x0,%al
je     1181 <main+0x51>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     1177 <main+0x47>
lea    -0xc(%rbp),%rsi
movsbl -0x5(%rbp),%edi
call   1030 <nokia_click@plt>
jmp    117c <main+0x4c>
jmp    1181 <main+0x51>
jmp    1146 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
test   %al,%al
je     116c <main+0x3c>
cmp    $0xa,%al
je     116c <main+0x3c>
movsbl %al,%edi
mov    %rbx,%rsi
call   1030 <nokia_click@plt>
jmp    1150 <main+0x20>
mov    0xc(%rsp),%esi
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
br label %3
3: ; preds = %5, %0
%4 = call signext i8 (...) @getchar()
switch i8 %4, label %5 [
i8 10, label %7
i8 0, label %7
]
5: ; preds = %3
%6 = call i32 @nokia_click(i8 signext %4, i32* %1)
br label %3
7: ; preds = %3, %3
%8 = load i32, i32* %1
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _MM_SHUFFLE(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ _mm_set1_ps(double);
int /*<<< orphan*/ _mm_shuffle_ps(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
__m128 test_shuf(void) {
  __m128 a = _mm_set1_ps(1.0);
  __m128 b = _mm_set1_ps(2.0);
  return _mm_shuffle_ps(a, b, _MM_SHUFFLE(0, 1, 2, 3));
}


x86 assembly (clang, -O0):
<test_shuf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xec8(%rip),%xmm0
call   1050 <_mm_set1_ps@plt>
mov    %eax,-0x4(%rbp)
movsd  0xeb0(%rip),%xmm0
call   1050 <_mm_set1_ps@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <_MM_SHUFFLE@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    %eax,%edx
call   1040 <_mm_shuffle_ps@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shuf>:
push   %rbp
push   %rbx
push   %rax
movsd  0xec5(%rip),%xmm0
call   1050 <_mm_set1_ps@plt>
mov    %eax,%ebx
movsd  0xebe(%rip),%xmm0
call   1050 <_mm_set1_ps@plt>
mov    %eax,%ebp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1030 <_MM_SHUFFLE@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm_shuffle_ps@plt>

LLVM IR (-O0):
define i32 @test_shuf() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @_mm_set1_ps(double 1.000000e+00)
store i32 %3, i32* %1
%4 = call i32 @_mm_set1_ps(double 2.000000e+00)
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @_MM_SHUFFLE(i32 0, i32 1, i32 2, i32 3)
%8 = call i32 @_mm_shuffle_ps(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_shuf() {
%1 = tail call i32 @_mm_set1_ps(double 1.000000e+00)
%2 = tail call i32 @_mm_set1_ps(double 2.000000e+00)
%3 = tail call i32 @_MM_SHUFFLE(i32 0, i32 1, i32 2, i32 3)
%4 = tail call i32 @_mm_shuffle_ps(i32 %1, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ empty();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fill();
int /*<<< orphan*/ init();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
main() {
  char *cp;
  srand(0);
  init();
  fill();
  empty();
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1060 <init@plt>
mov    $0x0,%al
call   1040 <fill@plt>
mov    $0x0,%al
call   1050 <empty@plt>
mov    $0x0,%al
call   1070 <cleanup@plt>
xor    %edi,%edi
call   1080 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1060 <init@plt>
xor    %eax,%eax
call   1040 <fill@plt>
xor    %eax,%eax
call   1050 <empty@plt>
xor    %eax,%eax
call   1070 <cleanup@plt>
xor    %edi,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 @srand(i32 0)
%4 = call i32 (...) @init()
%5 = call i32 (...) @fill()
%6 = call i32 (...) @empty()
%7 = call i32 (...) @cleanup()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @srand(i32 0)
%2 = tail call i32 (...) @init()
%3 = tail call i32 (...) @fill()
%4 = tail call i32 (...) @empty()
%5 = tail call i32 (...) @cleanup()
%6 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_79int16_mem(short *val) {
  return ((*val) & (-0x79 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_79int16_mem>:
movzwl (%rdi),%eax
test   $0xff87,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_79int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -121
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *PerfxPath_ResolveLinkReal(char const *, int /*<<< orphan*/);
char *PerfxPath_ResolveLink(const char *filename) {
  return PerfxPath_ResolveLinkReal(filename, 0);
}


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

x86 assembly (clang, -O2):
<PerfxPath_ResolveLink>:
xor    %esi,%esi
jmp    1030 <PerfxPath_ResolveLinkReal@plt>

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

LLVM IR (-O2):
define i8* @PerfxPath_ResolveLink(i8* %0) {
%2 = tail call i8* @PerfxPath_ResolveLinkReal(i8* %0, i32 0)
ret i8* %2
}
/* Type definitions */
struct aFILE {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _get_actual_fp(struct aFILE *);
int fflush(int /*<<< orphan*/);
int my_fflush(struct aFILE *fp) { return fflush(_get_actual_fp(fp)); }


x86 assembly (clang, -O0):
<my_fflush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fflush>:
push   %rax
call   1030 <_get_actual_fp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
%struct.aFILE = type { i32 }
define i32 @my_fflush(%struct.aFILE* %0) {
%2 = alloca %struct.aFILE*
store %struct.aFILE* %0, %struct.aFILE** %2
%3 = load %struct.aFILE*, %struct.aFILE** %2
%4 = call i32 @_get_actual_fp(%struct.aFILE* %3)
%5 = call i32 @fflush(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.aFILE = type { i32 }
define i32 @my_fflush(%struct.aFILE* %0) {
%2 = tail call i32 @_get_actual_fp(%struct.aFILE* %0)
%3 = tail call i32 @fflush(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ UP3D_GetParameter(int);
int32_t UP3D_GetPercent() { return UP3D_GetParameter(0x4C); }


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

x86 assembly (clang, -O2):
<UP3D_GetPercent>:
mov    $0x4c,%edi
jmp    1030 <UP3D_GetParameter@plt>

LLVM IR (-O0):
define i32 @UP3D_GetPercent() {
%1 = call i32 @UP3D_GetParameter(i32 76)
ret i32 %1
}

LLVM IR (-O2):
define i32 @UP3D_GetPercent() {
%1 = tail call i32 @UP3D_GetParameter(i32 76)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ hdd_open_files_handle(int);
void hdd_info(void) { hdd_open_files_handle(3); }


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

x86 assembly (clang, -O2):
<hdd_info>:
mov    $0x3,%edi
jmp    1030 <hdd_open_files_handle@plt>

LLVM IR (-O0):
define void @hdd_info() {
%1 = call i32 @hdd_open_files_handle(i32 3)
ret void
}

LLVM IR (-O2):
define void @hdd_info() {
%1 = tail call i32 @hdd_open_files_handle(i32 3)
ret void
}
void write_byte(char in) {}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @write_byte(i8 signext %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ generic_cpu_swap64p(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
void cpu_swap64p(uint64_t *outp, uint64_t in) { generic_cpu_swap64p(outp, in); }


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

x86 assembly (clang, -O2):
<cpu_swap64p>:
jmp    1030 <generic_cpu_swap64p@plt>

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

LLVM IR (-O2):
define void @cpu_swap64p(i32* %0, i32 %1) {
%3 = tail call i32 @generic_cpu_swap64p(i32* %0, i32 %1)
ret void
}
/* Type definitions */
struct prefix {
  int dummy;
};
struct inter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ prefix_destruct(struct prefix *, struct inter *);
void prefix_free(struct prefix *self, struct inter *inter) {
  if (!(--*(int *)((void *)(((int *)self) - 1)))) {
    prefix_destruct(self, inter);
    free(((void *)(((int *)self) - 1)));
  }
}


x86 assembly (clang, -O0):
<prefix_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x4(%rcx),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rcx)
cmp    $0x0,%eax
jne    1160 <prefix_free+0x40>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <prefix_destruct@plt>
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix_free>:
push   %rbx
addl   $0xffffffff,-0x4(%rdi)
je     1129 <prefix_free+0x9>
pop    %rbx
ret
lea    -0x4(%rdi),%rbx
call   1040 <prefix_destruct@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.prefix = type { i32 }
%struct.inter = type { i32 }
define void @prefix_free(%struct.prefix* %0, %struct.inter* %1) {
%3 = alloca %struct.prefix*
%4 = alloca %struct.inter*
store %struct.prefix* %0, %struct.prefix** %3
store %struct.inter* %1, %struct.inter** %4
%5 = load %struct.prefix*, %struct.prefix** %3
%6 = bitcast %struct.prefix* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 -1
%8 = bitcast i32* %7 to i8*
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = add nsw i32 %10, -1
store i32 %11, i32* %9
%12 = icmp ne i32 %11, 0
br i1 %12, label %22, label %13
13: ; preds = %2
%14 = load %struct.prefix*, %struct.prefix** %3
%15 = load %struct.inter*, %struct.inter** %4
%16 = call i32 @prefix_destruct(%struct.prefix* %14, %struct.inter* %15)
%17 = load %struct.prefix*, %struct.prefix** %3
%18 = bitcast %struct.prefix* %17 to i32*
%19 = getelementptr inbounds i32, i32* %18, i64 -1
%20 = bitcast i32* %19 to i8*
%21 = call i32 @free(i8* %20)
br label %22
22: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
%struct.prefix = type { i32 }
%struct.inter = type { i32 }
define void @prefix_free(%struct.prefix* %0, %struct.inter* %1) {
%3 = getelementptr inbounds %struct.prefix, %struct.prefix* %0, i64 -1, i32 0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, -1
store i32 %5, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = bitcast i32* %3 to i8*
%9 = tail call i32 @prefix_destruct(%struct.prefix* %0, %struct.inter* %1)
%10 = tail call i32 @free(i8* %8)
br label %11
11: ; preds = %7, %2
ret void
}
__attribute__((section(".after_vectors"))) void HardFault_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<HardFault_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <HardFault_Handler+0x9>
jmp    1109 <HardFault_Handler+0x9>

x86 assembly (clang, -O2):
<HardFault_Handler>:
jmp    1100 <HardFault_Handler>

LLVM IR (-O0):
define void @HardFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @HardFault_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void rfc4175_set_line_number(uint8_t *buf, uint16_t number) {
  buf[2] |= (number >> 8) & 0x7f;
  buf[3] = number & 0xff;
}


x86 assembly (clang, -O0):
<rfc4175_set_line_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0x7f,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_set_line_number>:
movzbl %sil,%eax
shr    $0x8,%esi
and    $0x7f,%esi
or     %esi,0x8(%rdi)
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @rfc4175_set_line_number(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 = ashr i32 %5, 8
%7 = and i32 %6, 127
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 2
%10 = load i32, i32* %9
%11 = or i32 %10, %7
store i32 %11, i32* %9
%12 = load i32, i32* %4
%13 = and i32 %12, 255
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 3
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
define void @rfc4175_set_line_number(i32* nocapture %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 127
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
%8 = and i32 %1, 255
%9 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dbgRecordExecLocation(int, int);
void dbgSetExecLocation(int iStackPtr, int line) {
  dbgRecordExecLocation(iStackPtr, line);
}


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

x86 assembly (clang, -O2):
<dbgSetExecLocation>:
jmp    1030 <dbgRecordExecLocation@plt>

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

LLVM IR (-O2):
define void @dbgSetExecLocation(i32 %0, i32 %1) {
%3 = tail call i32 @dbgRecordExecLocation(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int __builtin_arc_lr(int);
int bar(void) { return __builtin_arc_lr(0x21); }


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

x86 assembly (clang, -O2):
<bar>:
mov    $0x21,%edi
jmp    1030 <__builtin_arc_lr@plt>

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 @__builtin_arc_lr(i32 33)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @__builtin_arc_lr(i32 33)
ret i32 %1
}
void bitclr(unsigned char *x, int b) { *x ^= (1 << b); }


x86 assembly (clang, -O0):
<bitclr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
xor    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitclr>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %al,(%rdi)
ret

LLVM IR (-O0):
define void @bitclr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 1, %5
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = xor i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @bitclr(i8* nocapture %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = load i8, i8* %0
%5 = trunc i32 %3 to i8
%6 = xor i8 %4, %5
store i8 %6, i8* %0
ret void
}
void f1(unsigned char *x, int y, int z) {
  x[z / 8] |= (unsigned char)(0x80 >> y);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x80,%eax
sar    %cl,%eax
movzbl %al,%esi
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
or     %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %esi,%ecx
mov    $0x80,%eax
shr    %cl,%eax
lea    0x7(%rdx),%ecx
test   %edx,%edx
cmovns %edx,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
or     %al,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @f1(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = ashr i32 128, %7
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = sdiv i32 %12, 8
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %17, %10
%19 = trunc i32 %18 to i8
store i8 %19, i8* %15
ret void
}

LLVM IR (-O2):
define void @f1(i8* nocapture %0, i32 %1, i32 %2) {
%4 = lshr i32 128, %1
%5 = sdiv i32 %2, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = or i8 %8, %9
store i8 %10, i8* %7
ret void
}
/* Variables and functions */
scalar_t__ malloc(long);
char *NewPtr(long size) { return (char *)malloc(size); }


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

x86 assembly (clang, -O2):
<NewPtr>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @NewPtr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}

LLVM IR (-O2):
define i8* @NewPtr(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = inttoptr i64 %2 to i8*
ret i8* %3
}
int my_hash2(const void *key) { return 1 + (*(const int *)key % (11 - 2)); }


x86 assembly (clang, -O0):
<my_hash2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_hash2>:
movslq (%rdi),%rax
imul   $0x38e38e39,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,8),%ecx
sub    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @my_hash2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = srem i32 %5, 9
%7 = add nsw i32 1, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @my_hash2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = srem i32 %3, 9
%5 = add nsw i32 %4, 1
ret i32 %5
}
/* Variables and functions */
double atof(char *);
char *ext_arg(char *, char *);
double sqrt(double);
double cal_sqrt(char *S) {
  char *tmp = S;
  char arg[50];
  double arg1 = 0;
  tmp = ext_arg(tmp, arg);
  arg1 = (atof(arg));
  return sqrt(arg1);
}


x86 assembly (clang, -O0):
<cal_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1040 <ext_arg@plt>
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
call   1050 <sqrt@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cal_sqrt>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <ext_arg@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1158 <cal_sqrt+0x28>
sqrtsd %xmm0,%xmm0
jmp    115d <cal_sqrt+0x2d>
call   1050 <sqrt@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @cal_sqrt(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [50 x i8]
%5 = alloca double
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
store double 0.000000e+00, double* %5
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%9 = call i8* @ext_arg(i8* %7, i8* %8)
store i8* %9, i8** %3
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%11 = call double @atof(i8* %10)
store double %11, double* %5
%12 = load double, double* %5
%13 = call double @sqrt(double %12)
ret double %13
}

LLVM IR (-O2):
define double @cal_sqrt(i8* %0) {
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%4 = call i8* @ext_arg(i8* %0, i8* %3)
%5 = call double @atof(i8* %3)
%6 = call double @sqrt(double %5)
ret double %6
}
void ARGBAdd() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAdd() {
ret void
}
bzero(cp, nc) register char *cp;
register int nc;
{
  if (nc > 0)
    do {
      *cp++ = 0;
    } while (--nc);
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1143 <bzero+0x43>
jmp    111a <bzero+0x1a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x0,(%rax)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jne    111a <bzero+0x1a>
jmp    1143 <bzero+0x43>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %esi,%esi
jle    1122 <bzero+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @bzero(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
void close_window(WINDOW *win) {
  if (win) {
    delwin(win);
    win = NULL;
  }
}


x86 assembly (clang, -O0):
<close_window>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <close_window+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <delwin@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_window>:
test   %rdi,%rdi
je     111a <close_window+0xa>
jmp    1030 <delwin@plt>
ret

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

LLVM IR (-O2):
define void @close_window(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @delwin(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_9Fuint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x9F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Fuint64_highword_reg>:
movabs $0x9f00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Fuint64_highword_reg(i64 %0) {
%2 = and i64 %0, 682899800064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}