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

/* Variables and functions */
int ovl_do_whiteout_v1(struct inode *, struct dentry *);
int ovl_do_whiteout_v2(struct inode *, struct dentry *);
int ovl_do_whiteout(struct inode *dir, struct dentry *dentry,
                    struct dentry *ovlentry) {
  if ((0))
    return ovl_do_whiteout_v1(dir, dentry);
  return ovl_do_whiteout_v2(dir, dentry);
}


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

x86 assembly (clang, -O2):
<ovl_do_whiteout>:
jmp    1030 <ovl_do_whiteout_v2@plt>

LLVM IR (-O0):
%struct.inode = type { i32 }
%struct.dentry = type { i32 }
define i32 @ovl_do_whiteout(%struct.inode* %0, %struct.dentry* %1, %struct.dentry* %2) {
%4 = alloca %struct.inode*
%5 = alloca %struct.dentry*
%6 = alloca %struct.dentry*
store %struct.inode* %0, %struct.inode** %4
store %struct.dentry* %1, %struct.dentry** %5
store %struct.dentry* %2, %struct.dentry** %6
%7 = load %struct.inode*, %struct.inode** %4
%8 = load %struct.dentry*, %struct.dentry** %5
%9 = call i32 @ovl_do_whiteout_v2(%struct.inode* %7, %struct.dentry* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.inode = type { i32 }
%struct.dentry = type { i32 }
define i32 @ovl_do_whiteout(%struct.inode* %0, %struct.dentry* %1, %struct.dentry* nocapture readnone %2) {
%4 = tail call i32 @ovl_do_whiteout_v2(%struct.inode* %0, %struct.dentry* %1)
ret i32 %4
}
int do_035() { return 35; }


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

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

LLVM IR (-O0):
define i32 @do_035() {
ret i32 35
}

LLVM IR (-O2):
define i32 @do_035() {
ret i32 35
}
/* Variables and functions */
int /*<<< orphan*/ __exit();
int /*<<< orphan*/ __pause();
int /*<<< orphan*/ printf(char *);
main() {
  printf("Bruno!\n");
  __pause();
  __exit();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <__pause@plt>
mov    $0x0,%al
call   1030 <__exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <__pause@plt>
xor    %eax,%eax
call   1030 <__exit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [7 x i8] c"Bruno!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @__pause()
%3 = tail call i32 (...) @__exit()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, char *);
char *LePalavra(FILE *f) {
  static char palavra[100];
  if (fscanf(f, "%s", palavra) == 1)
    return (palavra);
  else
    return ((char *)NULL);
}


x86 assembly (clang, -O0):
<LePalavra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0x2f12(%rip),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    114c <LePalavra+0x3c>
lea    0x2efd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <LePalavra+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LePalavra>:
push   %rbx
lea    0xee8(%rip),%rsi
lea    0x2f21(%rip),%rbx
mov    %rbx,%rdx
call   1030 <fscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@LePalavra.palavra = internal global [100 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i8* @LePalavra(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([100 x i8], [100 x i8]* @LePalavra.palavra, i64 0, i64 0))
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* getelementptr inbounds ([100 x i8], [100 x i8]* @LePalavra.palavra, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* null, i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@LePalavra.palavra = internal global [100 x i8] zeroinitializer
@.str = [3 x i8] c"%s\00"
define i8* @LePalavra(i32* nocapture %0) {
%2 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([100 x i8], [100 x i8]* @LePalavra.palavra, i64 0, i64 0))
%3 = icmp eq i32 %2, 1
%4 = select i1 %3, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @LePalavra.palavra, i64 0, i64 0), i8* null
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ mvaddstr(int, int, char *);
int fromwho(void) {
  mvaddstr(21, 13, "Mark Hessling - (M.Hessling@gu.edu.au)");
  return (0);
}


x86 assembly (clang, -O0):
<fromwho>:
push   %rbp
mov    %rsp,%rbp
mov    $0x15,%edi
mov    $0xd,%esi
lea    0xedb(%rip),%rdx
call   1030 <mvaddstr@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromwho>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x15,%edi
mov    $0xd,%esi
call   1030 <mvaddstr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Mark Hessling - (M.Hessling@gu.edu.au)\00"
define i32 @fromwho() {
%1 = call i32 @mvaddstr(i32 21, i32 13, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"Mark Hessling - (M.Hessling@gu.edu.au)\00"
define i32 @fromwho() {
%1 = tail call i32 @mvaddstr(i32 21, i32 13, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
unsigned char *PopCharPixel(const unsigned char pixel, unsigned char *pixels) {
  *pixels++ = pixel;
  return (pixels);
}


x86 assembly (clang, -O0):
<PopCharPixel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PopCharPixel>:
mov    %dil,(%rsi)
lea    0x1(%rsi),%rax
ret

LLVM IR (-O0):
define i8* @PopCharPixel(i8 zeroext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
%5 = load i8, i8* %3
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %4
store i8 %5, i8* %6
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define i8* @PopCharPixel(i8 zeroext %0, i8* writeonly %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %0, i8* %1
ret i8* %3
}
void get_std_freq(float **sobj) {
  for (int i = 0; i < 26; i++)
    (*sobj)[i] = (float)1 / 26;
  return;
}


x86 assembly (clang, -O0):
<get_std_freq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1a,-0xc(%rbp)
jge    113f <get_std_freq+0x3f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
movss  0xed4(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_std_freq+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_std_freq>:
mov    (%rdi),%rax
movaps 0xef6(%rip),%xmm0
movups %xmm0,(%rax)
movups %xmm0,0x10(%rax)
movups %xmm0,0x20(%rax)
movups %xmm0,0x30(%rax)
movups %xmm0,0x40(%rax)
movups %xmm0,0x50(%rax)
movabs $0x3d1d89d93d1d89d9,%rcx
89 1d 3d
mov    %rcx,0x60(%rax)
ret

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

LLVM IR (-O2):
define void @get_std_freq(float** nocapture %0) {
%2 = load float*, float** %0
%3 = bitcast float* %2 to <4 x float>*
store <4 x float> <float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000>, <4 x float>* %3
%4 = getelementptr inbounds float, float* %2, i64 4
%5 = bitcast float* %4 to <4 x float>*
store <4 x float> <float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000>, <4 x float>* %5
%6 = getelementptr inbounds float, float* %2, i64 8
%7 = bitcast float* %6 to <4 x float>*
store <4 x float> <float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000>, <4 x float>* %7
%8 = getelementptr inbounds float, float* %2, i64 12
%9 = bitcast float* %8 to <4 x float>*
store <4 x float> <float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000>, <4 x float>* %9
%10 = getelementptr inbounds float, float* %2, i64 16
%11 = bitcast float* %10 to <4 x float>*
store <4 x float> <float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000>, <4 x float>* %11
%12 = getelementptr inbounds float, float* %2, i64 20
%13 = bitcast float* %12 to <4 x float>*
store <4 x float> <float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000, float 0x3FA3B13B20000000>, <4 x float>* %13
%14 = getelementptr inbounds float, float* %2, i64 24
store float 0x3FA3B13B20000000, float* %14
%15 = getelementptr inbounds float, float* %2, i64 25
store float 0x3FA3B13B20000000, float* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_alpha2(char const *);
int /*<<< orphan*/ is_len_2(char const *);
int /*<<< orphan*/ is_world_regdom(char const *);
int is_valid_regdom(const char *alpha2) {
  if (!is_len_2(alpha2))
    return 0;
  if (!is_alpha2(alpha2) && !is_world_regdom(alpha2))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_valid_regdom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <is_len_2@plt>
cmp    $0x0,%eax
jne    115a <is_valid_regdom+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <is_valid_regdom+0x61>
mov    -0x10(%rbp),%rdi
call   1040 <is_alpha2@plt>
cmp    $0x0,%eax
jne    118a <is_valid_regdom+0x5a>
mov    -0x10(%rbp),%rdi
call   1030 <is_world_regdom@plt>
cmp    $0x0,%eax
jne    118a <is_valid_regdom+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1191 <is_valid_regdom+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_regdom>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <is_len_2@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     115e <is_valid_regdom+0x2e>
mov    %rbx,%rdi
call   1040 <is_alpha2@plt>
test   %eax,%eax
jne    1159 <is_valid_regdom+0x29>
mov    %rbx,%rdi
call   1030 <is_world_regdom@plt>
test   %eax,%eax
je     115e <is_valid_regdom+0x2e>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_valid_regdom(i8* %0) {
%2 = tail call i32 @is_len_2(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = tail call i32 @is_alpha2(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @is_world_regdom(i8* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %4
br label %11
11: ; preds = %7, %1, %10
%12 = phi i32 [ 1, %10 ], [ 0, %1 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ close(int);
scalar_t__ errno;
void _fsop_close_safe(int fd) {
  while (close(fd) < 0) {
    if (errno != EINTR)
      break;
  }
}


x86 assembly (clang, -O0):
<_fsop_close_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1151 <_fsop_close_safe+0x41>
mov    0x2eac(%rip),%rax
mov    (%rax),%rax
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     114c <_fsop_close_safe+0x3c>
jmp    1151 <_fsop_close_safe+0x41>
jmp    111b <_fsop_close_safe+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fsop_close_safe>:
push   %r15
push   %r14
push   %rbx
mov    %edi,%ebx
mov    0x2ec2(%rip),%r14
mov    0x2eb3(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <close@plt>
test   %rax,%rax
jns    1144 <_fsop_close_safe+0x34>
mov    (%r14),%rax
cmp    (%r15),%rax
je     1130 <_fsop_close_safe+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define void @_fsop_close_safe(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %12, %1
%4 = load i32, i32* %2
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i64, i64* @errno
%9 = load i64, i64* @EINTR
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %3
13: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define void @_fsop_close_safe(i32 %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i64 @close(i32 %0)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i64, i64* @errno
%7 = load i64, i64* @EINTR
%8 = icmp eq i64 %6, %7
br i1 %8, label %2, label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int _processStream(char *, int, int /*<<< orphan*/);
int processStream(char *byteStream, int length) {
  return _processStream(byteStream, length, 0);
}


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

x86 assembly (clang, -O2):
<processStream>:
xor    %edx,%edx
jmp    1030 <_processStream@plt>

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

LLVM IR (-O2):
define i32 @processStream(i8* %0, i32 %1) {
%3 = tail call i32 @_processStream(i8* %0, i32 %1, i32 0)
ret i32 %3
}
int post_init_specific_init(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @post_init_specific_init() {
ret i32 0
}
int access(char *f, int n) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @access(i8* nocapture readnone %0, i32 %1) {
ret i32 1
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ scanf(char *, char *);
void getopt(char *option) {
  scanf("%1c", option);
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1154 <getopt+0x34>
jmp    113c <getopt+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getopt>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <scanf@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1130 <getopt+0x10>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%1c\00"
define void @getopt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %9, %1
%6 = call signext i8 (...) @getchar()
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%1c\00"
define void @getopt(i8* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %3, %1
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %3
6: ; preds = %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t __attribute__((const)) min(uint32_t a, uint32_t b) {
  return a > b ? b : a;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ add_opcode(int /*<<< orphan*/, int);
int /*<<< orphan*/ gen_move_from_sr(char *, int);
void move_fsr(int opcode) {
  if ((opcode & 0xFFC0) != 0x40C0)
    return;
  add_opcode(gen_move_from_sr("move", opcode), opcode);
}


x86 assembly (clang, -O0):
<move_fsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffc0,%eax
cmp    $0x40c0,%eax
je     1143 <move_fsr+0x23>
jmp    115c <move_fsr+0x3c>
mov    -0x4(%rbp),%esi
lea    0xeb3(%rip),%rdi
call   1030 <gen_move_from_sr@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1040 <add_opcode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_fsr>:
mov    %edi,%eax
and    $0xffc0,%eax
cmp    $0x40c0,%eax
jne    1149 <move_fsr+0x29>
push   %rbx
mov    %edi,%ebx
lea    0xec8(%rip),%rdi
mov    %ebx,%esi
call   1030 <gen_move_from_sr@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <add_opcode@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"move\00"
define void @move_fsr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65472
%5 = icmp ne i32 %4, 16576
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @gen_move_from_sr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* %2
%11 = call i32 @add_opcode(i32 %9, i32 %10)
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"move\00"
define void @move_fsr(i32 %0) {
%2 = and i32 %0, 65472
%3 = icmp eq i32 %2, 16576
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @gen_move_from_sr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @add_opcode(i32 %5, i32 %0)
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, void const *);
int strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, void const *);
int cmp(const void *a, const void *b) {
  char x[200];
  char y[200];
  strcpy(x, a);
  strcpy(y, b);
  strcat(x, b);
  strcat(y, a);
  return strcmp(y, x);
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <strcmp@plt>
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xd0(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <strcat@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <strcat@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [200 x i8]
%6 = alloca [200 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%14 = load i8*, i8** %4
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%17 = load i8*, i8** %3
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%21 = call i32 @strcmp(i8* %19, i8* %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %0)
%8 = call i32 @strcpy(i8* %6, i8* %1)
%9 = call i32 @strcat(i8* %5, i8* %1)
%10 = call i32 @strcat(i8* %6, i8* %0)
%11 = call i32 @strcmp(i8* %6, i8* %5)
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ clear();
int /*<<< orphan*/ *initscr();
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ refresh();
int main() {
  WINDOW *wnd;
  wnd = initscr();
  cbreak();
  noecho();
  clear();
  refresh();
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1060 <noecho@plt>
mov    $0x0,%al
call   1070 <clear@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
jmp    1186 <main+0x36>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1060 <noecho@plt>
xor    %eax,%eax
call   1070 <clear@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1180 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* (...) @initscr()
store i32* %3, i32** %2
%4 = call i32 (...) @cbreak()
%5 = call i32 (...) @noecho()
%6 = call i32 (...) @clear()
%7 = call i32 (...) @refresh()
br label %8
8: ; preds = %0, %8
br label %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = tail call i32 (...) @clear()
%5 = tail call i32 (...) @refresh()
br label %6
6: ; preds = %6, %0
br label %6
}
void InsertB20(int x, unsigned char *buf) {
  buf[2] = x & 0xf;
  x >>= 4;
  buf[1] = x & 0xff;
  x >>= 8;
  buf[0] = x & 0xff;
}


x86 assembly (clang, -O0):
<InsertB20>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<InsertB20>:
mov    %edi,%eax
and    $0xf,%al
mov    %al,0x2(%rsi)
mov    %edi,%eax
shr    $0x4,%eax
mov    %al,0x1(%rsi)
shr    $0xc,%edi
mov    %dil,(%rsi)
ret

LLVM IR (-O0):
define void @InsertB20(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 = and i32 %5, 15
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 4
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %3
%18 = ashr i32 %17, 8
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @InsertB20(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = and i8 %3, 15
%5 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %4, i8* %5
%6 = lshr i32 %0, 4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %0, 12
%10 = trunc i32 %9 to i8
store i8 %10, i8* %1
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int /*<<< orphan*/ xa_debug(int, char *);
int ice_strcmp(const char *s1, const char *s2) {
  if (!s1 || !s2) {
    xa_debug(1, "ERROR: ice_strcmp() called with NULL pointers!");
    return 0;
  }
  return strcmp(s1, s2);
}


x86 assembly (clang, -O0):
<ice_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <ice_strcmp+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1163 <ice_strcmp+0x43>
mov    $0x1,%edi
lea    0xeae(%rip),%rsi
call   1030 <xa_debug@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <ice_strcmp+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ice_strcmp>:
test   %rdi,%rdi
je     112f <ice_strcmp+0xf>
test   %rsi,%rsi
je     112f <ice_strcmp+0xf>
jmp    1040 <strcmp@plt>
push   %rax
lea    0xec9(%rip),%rsi
mov    $0x1,%edi
call   1030 <xa_debug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"ERROR: ice_strcmp() called with NULL pointers!\00"
define i32 @ice_strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8, %2
%12 = call i32 @xa_debug(i32 1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %17
13: ; preds = %8
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @strcmp(i8* %14, i8* %15)
store i32 %16, i32* %3
br label %17
17: ; preds = %13, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [47 x i8] c"ERROR: ice_strcmp() called with NULL pointers!\00"
define i32 @ice_strcmp(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @xa_debug(i32 1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %9, %8 ], [ 0, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ seq_utils_clamp(scalar_t__, int, int);
scalar_t__ song_get_key_velocity_scale();
int /*<<< orphan*/ song_set_key_velocity_scale(int /*<<< orphan*/);
void seq_ctrl_adjust_key_velocity_scale(int change) {
  song_set_key_velocity_scale(
      seq_utils_clamp(song_get_key_velocity_scale() + change, -100, 100));
}


x86 assembly (clang, -O0):
<seq_ctrl_adjust_key_velocity_scale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <song_get_key_velocity_scale@plt>
mov    %rax,%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
mov    $0xffffff9c,%esi
mov    $0x64,%edx
call   1050 <seq_utils_clamp@plt>
mov    %eax,%edi
call   1030 <song_set_key_velocity_scale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_ctrl_adjust_key_velocity_scale>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <song_get_key_velocity_scale@plt>
movslq %ebx,%rdi
add    %rax,%rdi
mov    $0xffffff9c,%esi
mov    $0x64,%edx
call   1050 <seq_utils_clamp@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <song_set_key_velocity_scale@plt>

LLVM IR (-O0):
define void @seq_ctrl_adjust_key_velocity_scale(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @song_get_key_velocity_scale()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = call i32 @seq_utils_clamp(i64 %6, i32 -100, i32 100)
%8 = call i32 @song_set_key_velocity_scale(i32 %7)
ret void
}

LLVM IR (-O2):
define void @seq_ctrl_adjust_key_velocity_scale(i32 %0) {
%2 = tail call i64 (...) @song_get_key_velocity_scale()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
%5 = tail call i32 @seq_utils_clamp(i64 %4, i32 -100, i32 100)
%6 = tail call i32 @song_set_key_velocity_scale(i32 %5)
ret void
}
void perf_start_clock(void) {
  *(volatile unsigned int *)0xF8F00208 = ((1 << 0) | (1 << 3) | (0 << 8));
}


x86 assembly (clang, -O0):
<perf_start_clock>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf8f00208,%eax
movl   $0x9,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<perf_start_clock>:
mov    $0xf8f00208,%eax
movl   $0x9,(%rax)
ret

LLVM IR (-O0):
define void @perf_start_clock() {
store volatile i32 9, i32* inttoptr (i64 4176478728 to i32*)
ret void
}

LLVM IR (-O2):
define void @perf_start_clock() {
store volatile i32 9, i32* inttoptr (i64 4176478728 to i32*)
ret void
}
/* Variables and functions */
scalar_t__ memcmp(char const *, char *, int);
int fourcc_is_ivf(const char detect[4]) {
  if (memcmp(detect, "DKIF", 4) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fourcc_is_ivf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1147 <fourcc_is_ivf+0x37>
movl   $0x1,-0x4(%rbp)
jmp    114e <fourcc_is_ivf+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourcc_is_ivf>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"DKIF\00"
define i32 @fourcc_is_ivf(i8* %0) {
%2 = tail call i64 @memcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int in_def_menu_translate(void *drv_data, int keycode) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @in_def_menu_translate(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ __u32;

/* Variables and functions */
__u32 min(__u32 a, __u32 b) { return (a > b) ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <min+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovg  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @min(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @min(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  fprintf(stderr, "error %s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"error %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"error %s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t read_be64_3(unsigned char *data) {
  return (uint64_t) * (data + 7) | ((uint64_t) * (data + 6) << 8) |
         ((uint64_t) * (data + 5) << 16) | ((uint64_t) * (data + 4) << 24) |
         ((uint64_t) * (data + 3) << 32) | ((uint64_t) * (data + 2) << 40) |
         ((uint64_t) * (data + 1) << 48) | ((uint64_t)*data << 56);
}


x86 assembly (clang, -O0):
<read_be64_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x4(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_be64_3(i8* nocapture readnone %0) {
ret i32 poison
}
void __udelay(unsigned long usecs) { (__xdelay((usecs)*4295)); }


x86 assembly (clang, -O0):
<__udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
imul   $0x10c7,-0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <__xdelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__udelay>:
imul   $0x10c7,%rdi,%rdi
xor    %eax,%eax
jmp    1030 <__xdelay@plt>

LLVM IR (-O0):
define void @__udelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 4295
%5 = call i32 (i64, ...) bitcast (i32 (...)* @__xdelay to i32 (i64, ...)*)(i64 %4)
ret void
}

LLVM IR (-O2):
define void @__udelay(i64 %0) {
%2 = mul i64 %0, 4295
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @__xdelay to i32 (i64, ...)*)(i64 %2)
ret void
}
/* Variables and functions */
int litteral(char *, int);
int read_litteral(char *s) { return litteral(s, 1); }


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

x86 assembly (clang, -O2):
<read_litteral>:
mov    $0x1,%esi
jmp    1030 <litteral@plt>

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

LLVM IR (-O2):
define i32 @read_litteral(i8* %0) {
%2 = tail call i32 @litteral(i8* %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("Usage: %s [-c < config_file>] [-d] [-v [level]] [-t]\n", name);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Usage: %s [-c < config_file>] [-d] [-v [level]] [-t]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"Usage: %s [-c < config_file>] [-d] [-v [level]] [-t]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct mutex {
  int dummy;
};
struct i40e_spinlock {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mutex_destroy(struct mutex *);
void i40e_destroy_spinlock_d(struct i40e_spinlock *sp) {
  mutex_destroy((struct mutex *)sp);
}


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

x86 assembly (clang, -O2):
<i40e_destroy_spinlock_d>:
jmp    1030 <mutex_destroy@plt>

LLVM IR (-O0):
%struct.i40e_spinlock = type { i32 }
%struct.mutex = type { i32 }
define void @i40e_destroy_spinlock_d(%struct.i40e_spinlock* %0) {
%2 = alloca %struct.i40e_spinlock*
store %struct.i40e_spinlock* %0, %struct.i40e_spinlock** %2
%3 = load %struct.i40e_spinlock*, %struct.i40e_spinlock** %2
%4 = bitcast %struct.i40e_spinlock* %3 to %struct.mutex*
%5 = call i32 @mutex_destroy(%struct.mutex* %4)
ret void
}

LLVM IR (-O2):
%struct.i40e_spinlock = type { i32 }
%struct.mutex = type { i32 }
define void @i40e_destroy_spinlock_d(%struct.i40e_spinlock* %0) {
%2 = bitcast %struct.i40e_spinlock* %0 to %struct.mutex*
%3 = tail call i32 @mutex_destroy(%struct.mutex* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ xchange(float *);
int main() {
  float *x;
  *x = 31.2;
  printf("x = [%2.1f]\n", *x);
  xchange(x);
  printf("x = [%4.1f]\n", *x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
movss  0xec5(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <xchange@plt>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [13 x i8] c"x = [%2.1f]\0A\00"
@.str.1 = [13 x i8] c"x = [%4.1f]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float*
store i32 0, i32* %1
%3 = load float*, float** %2
store float 0x403F333340000000, float* %3
%4 = load float*, float** %2
%5 = load float, float* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %5)
%7 = load float*, float** %2
%8 = call i32 @xchange(float* %7)
%9 = load float*, float** %2
%10 = load float, float* %9
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
float Section3Perim(float *radius) { return (*radius) * 2 * 3.141592; }


x86 assembly (clang, -O0):
<Section3Perim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  0xef4(%rip),%xmm0
mulss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xedc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3Perim>:
movss  (%rdi),%xmm0
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeec(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @Section3Perim(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fmul float %4, 2.000000e+00
%6 = fpext float %5 to double
%7 = fmul double %6, 0x400921FAFC8B007A
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @Section3Perim(float* nocapture %0) {
%2 = load float, float* %0
%3 = fmul float %2, 2.000000e+00
%4 = fpext float %3 to double
%5 = fmul double %4, 0x400921FAFC8B007A
%6 = fptrunc double %5 to float
ret float %6
}
unsigned byte_x(const unsigned cfgbit) { return (cfgbit >> 8); }


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

x86 assembly (clang, -O2):
<byte_x>:
mov    %edi,%eax
shr    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @byte_x(i32 %0) {
%2 = lshr i32 %0, 8
ret i32 %2
}
int test_imm_CFint8_mem(signed char *val) {
  return ((*val) & (-0xCF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CFint8_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, -207
%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_CFint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -207
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
struct ps_prochandle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ detach_all_pids(struct ps_prochandle *);
void process_cleanup(struct ps_prochandle *ph) { detach_all_pids(ph); }


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

x86 assembly (clang, -O2):
<process_cleanup>:
jmp    1030 <detach_all_pids@plt>

LLVM IR (-O0):
%struct.ps_prochandle = type { i32 }
define void @process_cleanup(%struct.ps_prochandle* %0) {
%2 = alloca %struct.ps_prochandle*
store %struct.ps_prochandle* %0, %struct.ps_prochandle** %2
%3 = load %struct.ps_prochandle*, %struct.ps_prochandle** %2
%4 = call i32 @detach_all_pids(%struct.ps_prochandle* %3)
ret void
}

LLVM IR (-O2):
%struct.ps_prochandle = type { i32 }
define void @process_cleanup(%struct.ps_prochandle* %0) {
%2 = tail call i32 @detach_all_pids(%struct.ps_prochandle* %0)
ret void
}