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

/* Variables and functions */
struct dhcp6_timer *syncfile_timo(void *arg) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.dhcp6_timer = type { i32 }
define %struct.dhcp6_timer* @syncfile_timo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.dhcp6_timer* null
}

LLVM IR (-O2):
%struct.dhcp6_timer = type { i32 }
define noalias %struct.dhcp6_timer* @syncfile_timo(i8* nocapture readnone %0) {
ret %struct.dhcp6_timer* null
}
/* Variables and functions */
bool audio_valid_sample_format(unsigned bits) {
  return bits == 16 || bits == 24 || bits == 32 || bits == 8;
}


x86 assembly (clang, -O0):
<audio_valid_sample_format>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x10,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <audio_valid_sample_format+0x3e>
mov    $0x1,%al
cmpl   $0x18,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <audio_valid_sample_format+0x3e>
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <audio_valid_sample_format+0x3e>
cmpl   $0x8,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_valid_sample_format>:
cmp    $0x20,%edi
ja     111d <audio_valid_sample_format+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x101010000,%rdx
bt     %rcx,%rdx
jae    111d <audio_valid_sample_format+0x1d>
ret
xor    %eax,%eax
cmp    $0x8,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @audio_valid_sample_format(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 24, label %5
i32 16, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 8
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void mostra_long(void *data) {
  long *dado = (long *)data;
  if (dado == NULL)
    printf("NULL");
  else
    printf(" %ld ", *dado);
}


x86 assembly (clang, -O0):
<mostra_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <mostra_long+0x32>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1157 <mostra_long+0x47>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mostra_long>:
test   %rdi,%rdi
je     1126 <mostra_long+0x16>
mov    (%rdi),%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
@.str.1 = [6 x i8] c" %ld \00"
define void @mostra_long(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = bitcast i8* %0 to i64*
%7 = load i64, i64* %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %7)
br label %9
9: ; preds = %5, %3
ret void
}
void RealMainP$Scheduler$init(void) { SchedulerBasicP$Scheduler$init(); }


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

x86 assembly (clang, -O2):
<RealMainP$Scheduler$init>:
xor    %eax,%eax
jmp    1030 <SchedulerBasicP$Scheduler$init@plt>

LLVM IR (-O0):
define void @"RealMainP$Scheduler$init"() {
%1 = call i32 (...) @"SchedulerBasicP$Scheduler$init"()
ret void
}

LLVM IR (-O2):
define void @"RealMainP$Scheduler$init"() {
%1 = tail call i32 (...) @"SchedulerBasicP$Scheduler$init"()
ret void
}
int example(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @example() {
ret i32 1
}

LLVM IR (-O2):
define i32 @example() {
ret i32 1
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int udiv64(int, int);
uint32_t umod64(uint64_t n, uint64_t d) { return n - d * udiv64(n, d); }


x86 assembly (clang, -O0):
<umod64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <udiv64@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @umod64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @udiv64(i32 %7, i32 %8)
%10 = mul nsw i32 %6, %9
%11 = sub nsw i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @umod64(i32 %0, i32 %1) {
%3 = tail call i32 @udiv64(i32 %0, i32 %1)
%4 = mul nsw i32 %3, %1
%5 = sub nsw i32 %0, %4
ret i32 %5
}
/* Variables and functions */
char const *makeVsNetCompatName(char const *);
scalar_t__ prj_is_buildaction(char *);
int /*<<< orphan*/ prj_select_file(char const *);
const char *listEmbeddedFiles(const char *name) {
  prj_select_file(name);
  if (prj_is_buildaction("EmbeddedResource"))
    return makeVsNetCompatName(name);
  else
    return NULL;
}


x86 assembly (clang, -O0):
<listEmbeddedFiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <prj_select_file@plt>
lea    0xeb4(%rip),%rdi
call   1050 <prj_is_buildaction@plt>
cmp    $0x0,%rax
je     116d <listEmbeddedFiles+0x3d>
mov    -0x10(%rbp),%rdi
call   1040 <makeVsNetCompatName@plt>
mov    %rax,-0x8(%rbp)
jmp    1175 <listEmbeddedFiles+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<listEmbeddedFiles>:
push   %rbx
mov    %rdi,%rbx
call   1030 <prj_select_file@plt>
lea    0xec0(%rip),%rdi
call   1050 <prj_is_buildaction@plt>
test   %rax,%rax
je     1153 <listEmbeddedFiles+0x23>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <makeVsNetCompatName@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"EmbeddedResource\00"
define i8* @listEmbeddedFiles(i8* %0) {
%2 = tail call i32 @prj_select_file(i8* %0)
%3 = tail call i64 @prj_is_buildaction(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i8* @makeVsNetCompatName(i8* %0)
br label %7
7: ; preds = %1, %5
%8 = phi i8* [ %6, %5 ], [ null, %1 ]
ret i8* %8
}
char *install_str(char *str) { return str; }


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

x86 assembly (clang, -O2):
<install_str>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @install_str(i8* readnone returned %0) {
ret i8* %0
}
int wpa_key_mgmt_wpa_ieee8021x(int akm) {
  return !!(akm & ((1 << (0)) | (1 << (5)) | (1 << (14)) | (1 << (7))));
}


x86 assembly (clang, -O0):
<wpa_key_mgmt_wpa_ieee8021x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40a1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_key_mgmt_wpa_ieee8021x>:
xor    %eax,%eax
test   $0x40a1,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @wpa_key_mgmt_wpa_ieee8021x(i32 %0) {
%2 = and i32 %0, 16545
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
cfree(p, num, size) char *p;
unsigned num;
unsigned size;
{ free(p); }


x86 assembly (clang, -O0):
<cfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define i32 @cfree(i8* nocapture %0, i32 %1, i32 %2) {
tail call void @free(i8* %0)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_compression_mode_pg(struct list_head *);
uint8_t clear_dlt_compression(struct list_head *m) {
  ;
  return clear_compression_mode_pg(m);
}


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

x86 assembly (clang, -O2):
<clear_dlt_compression>:
jmp    1030 <clear_compression_mode_pg@plt>

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

LLVM IR (-O2):
%struct.list_head = type { i32 }
define i32 @clear_dlt_compression(%struct.list_head* %0) {
%2 = tail call i32 @clear_compression_mode_pg(%struct.list_head* %0)
ret i32 %2
}
char *rname(path)
char *path;
{
  register char *ind;
  ind = strrchr(path, '/');
  return (ind ? ind + 1 : path);
}


x86 assembly (clang, -O0):
<rname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <rname+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <rname+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @rname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @rname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
char *strrchr(char *, char);
char *files_basename(char *path) {
  char *base = strrchr(path, '/');
  return base ? base + 1 : path;
}


x86 assembly (clang, -O0):
<files_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <files_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <files_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @files_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @files_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
scalar_t__ _gettemp(char *, int *, int /*<<< orphan*/, int /*<<< orphan*/);
char *_mktemp(char *path) {
  return (_gettemp(path, (int *)NULL, 0, 0) ? path : (char *)NULL);
}


x86 assembly (clang, -O0):
<_mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <_gettemp@plt>
cmp    $0x0,%rax
je     1144 <_mktemp+0x34>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114f <_mktemp+0x3f>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    114f <_mktemp+0x3f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mktemp>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <_gettemp@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_mktemp(i8* %0) {
%2 = tail call i64 @_gettemp(i8* %0, i32* null, i32 0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i8* null, i8* %0
ret i8* %4
}
int atoi(const char *str) {
  int res = 0;
  while (*str && *str >= '0' && *str <= '9') {
    res = *str - '0' + res * 10;
    str++;
  }
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1149 <atoi+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1149 <atoi+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <atoi+0x59>
jmp    117d <atoi+0x7d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
imul   $0xa,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <atoi+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <atoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
int func(void) { return sizeof(int); }


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

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

LLVM IR (-O0):
define i32 @func() {
ret i32 4
}

LLVM IR (-O2):
define i32 @func() {
ret i32 4
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ warn(char *);
pid_t forkoff(void (*func)(void)) {
  pid_t pid = fork();
  switch (pid) {
  case -1:
    warn("fork");
    return -1;
  case 0:
    func();
    _exit(0);
  default:
    break;
  }
  return pid;
}


x86 assembly (clang, -O0):
<forkoff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xffffffff,%eax
je     116a <forkoff+0x3a>
jmp    115a <forkoff+0x2a>
mov    -0x18(%rbp),%eax
test   %eax,%eax
je     1182 <forkoff+0x52>
jmp    118c <forkoff+0x5c>
lea    0xe8f(%rip),%rdi
call   1040 <warn@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1197 <forkoff+0x67>
call   *-0x10(%rbp)
xor    %edi,%edi
call   1030 <_exit@plt>
jmp    1191 <forkoff+0x61>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forkoff>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1151 <forkoff+0x21>
test   %ebp,%ebp
jne    115d <forkoff+0x2d>
call   *%rbx
xor    %edi,%edi
call   1030 <_exit@plt>
lea    0xea8(%rip),%rdi
call   1040 <warn@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fork\00"
define i32 @forkoff(void ()* %0) {
%2 = alloca i32
%3 = alloca void ()*
%4 = alloca i32
store void ()* %0, void ()** %3
%5 = call i32 (...) @fork()
store i32 %5, i32* %4
%6 = load i32, i32* %4
switch i32 %6, label %12 [
i32 -1, label %7
i32 0, label %9
]
7: ; preds = %1
%8 = call i32 @warn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %15
9: ; preds = %1
%10 = load void ()*, void ()** %3
%11 = call i32 @_exit(i32 0)
unreachable
12: ; preds = %1
br label %13
13: ; preds = %12
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
define i32 @forkoff(void ()* nocapture %0) {
%2 = tail call i32 (...) @fork()
switch i32 %2, label %7 [
i32 -1, label %3
i32 0, label %5
]
3: ; preds = %1
%4 = tail call i32 @warn(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
tail call void %0()
%6 = tail call i32 @_exit(i32 0)
unreachable
7: ; preds = %1, %3
ret i32 %2
}
int addTwo(int x) { return x + 2; }


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

x86 assembly (clang, -O2):
<addTwo>:
lea    0x2(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @addTwo(i32 %0) {
%2 = add nsw i32 %0, 2
ret i32 %2
}
int destroy(f)
char *f;
{ return unlink(f); }


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

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

LLVM IR (-O0):
define i32 @destroy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @destroy(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %0)
ret i32 %2
}
void ff_hevc_put_hevc_bi_w_qpel_hv4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_qpel_hv4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ frame_get_pinword(void const *);
int mirror_2bytes(int /*<<< orphan*/);
int frame_get_cpuword(const void *bits) {
  return mirror_2bytes(frame_get_pinword(bits));
}


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

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

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

LLVM IR (-O2):
define i32 @frame_get_cpuword(i8* %0) {
%2 = tail call i32 @frame_get_pinword(i8* %0)
%3 = tail call i32 @mirror_2bytes(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int, char *);
void bad_token(void) { error(130, 95, "expressions"); }


x86 assembly (clang, -O0):
<bad_token>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
mov    $0x5f,%esi
lea    0xedb(%rip),%rdx
call   1030 <error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_token>:
lea    0xee9(%rip),%rdx
mov    $0x82,%edi
mov    $0x5f,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"expressions\00"
define void @bad_token() {
%1 = call i32 @error(i32 130, i32 95, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"expressions\00"
define void @bad_token() {
%1 = tail call i32 @error(i32 130, i32 95, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
void vector_set(uint *bitvector, uint pos) {
  int word_num = (pos >> 5);
  int bit_num = (pos & (sizeof(uint) * 8 - 1));
  bitvector[word_num] |= (1 << bit_num);
}


x86 assembly (clang, -O0):
<vector_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
movslq -0xc(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
or     (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_set>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x5,%eax
mov    $0x1,%edx
shl    %cl,%edx
cltq
or     %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @vector_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = and i64 %10, 31
%12 = trunc i64 %11 to i32
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = shl i32 1, %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = or i32 %19, %14
store i32 %20, i32* %18
ret void
}

LLVM IR (-O2):
define void @vector_set(i32* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = or i32 %8, %5
store i32 %9, i32* %7
ret void
}
void vm_destroy() {}


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

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

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

LLVM IR (-O2):
define void @vm_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int stega_show_usage() {
  printf("\n\nNot enough parameters:");
  printf("\n");
  printf("   "
         "\nstega -h cover-image-name message-image-name n"
         "\n       to hide the message image in the cover image"
         "\n                 or"
         "\nstega -u cover-image-name message-image-name n"
         "\n       to uncover the cover image from "
         "the message image\n");
  return (1);
}


x86 assembly (clang, -O0):
<stega_show_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xfd4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stega_show_usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0ANot enough parameters:\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [228 x i8] c" \0Astega -h cover-image-name message-image-name n\0A to hide the message image in the cover image\0A or\0Astega -u cover-image-name message-image-name n\0A to uncover the cover image from the message image\0A\00"
define i32 @stega_show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([228 x i8], [228 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0ANot enough parameters:\00"
@str = [227 x i8] c" \0Astega -h cover-image-name message-image-name n\0A to hide the message image in the cover image\0A or\0Astega -u cover-image-name message-image-name n\0A to uncover the cover image from the message image\00"
define i32 @stega_show_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([227 x i8], [227 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
unsigned long ___copy_from_user(void *, void const *, unsigned long);
unsigned long copy_from_user_fixup(void *, void const *, unsigned long);
unsigned long copy_from_user(void *to, const void *from, unsigned long size) {
  unsigned long ret = ___copy_from_user(to, from, size);
  if (ret)
    ret = copy_from_user_fixup(to, from, size);
  return ret;
}


x86 assembly (clang, -O0):
<copy_from_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <___copy_from_user@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1169 <copy_from_user+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <copy_from_user_fixup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_from_user>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <___copy_from_user@plt>
test   %rax,%rax
je     114b <copy_from_user+0x2b>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <copy_from_user_fixup@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @copy_from_user(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @___copy_from_user(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i64 @copy_from_user_fixup(i8* %0, i8* %1, i64 %2)
br label %8
8: ; preds = %6, %3
%9 = phi i64 [ %7, %6 ], [ 0, %3 ]
ret i64 %9
}
int byte_to_int_offs(const char *in, const int offset) {
  return ((0xFF & in[offset + 3]) << 24) + ((0xFF & in[offset + 2]) << 16) +
         ((0xFF & in[offset + 1]) << 8) + ((0xFF & in[offset + 0]));
}


x86 assembly (clang, -O0):
<byte_to_int_offs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x0,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
and    $0xff,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_to_int_offs>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @byte_to_int_offs(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 = add nsw i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = and i32 255, %11
%13 = shl i32 %12, 24
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = and i32 255, %20
%22 = shl i32 %21, 16
%23 = add nsw i32 %13, %22
%24 = load i8*, i8** %3
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = and i32 255, %30
%32 = shl i32 %31, 8
%33 = add nsw i32 %23, %32
%34 = load i8*, i8** %3
%35 = load i32, i32* %4
%36 = add nsw i32 %35, 0
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %34, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = and i32 255, %40
%42 = add nsw i32 %33, %41
ret i32 %42
}

LLVM IR (-O2):
define i32 @byte_to_int_offs(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw i32 %7, 24
%9 = add nsw i32 %1, 2
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 16
%15 = or i32 %14, %8
%16 = add nsw i32 %1, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl nuw nsw i32 %20, 8
%22 = or i32 %15, %21
%23 = sext i32 %1 to i64
%24 = getelementptr inbounds i8, i8* %0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = or i32 %22, %26
ret i32 %27
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ I2CMasterBaseValid(unsigned long);
void I2CMasterIntDisableEx(unsigned long ulBase, unsigned long ulIntFlags) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  (*((volatile unsigned long *)(ulBase + 0x00000010))) &= ~ulIntFlags;
}


x86 assembly (clang, -O0):
<I2CMasterIntDisableEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x10(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterIntDisableEx>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
not    %rbx
and    %rbx,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @I2CMasterIntDisableEx(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 = call i32 @I2CMasterBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = xor i64 %8, -1
%10 = load i64, i64* %3
%11 = add i64 %10, 16
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @I2CMasterIntDisableEx(i64 %0, i64 %1) {
%3 = tail call i32 @I2CMasterBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = xor i64 %1, -1
%6 = add i64 %0, 16
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = and i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Variables and functions */
int socket(int, int, int);
int vrf_socket(const char *vrf, int domain, int type, int protocol) {
  return socket(domain, type, protocol);
}


x86 assembly (clang, -O0):
<vrf_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <socket@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrf_socket>:
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
define i32 @vrf_socket(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @socket(i32 %9, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @vrf_socket(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 %5
}
void cpu_nop() { asm volatile("nop" ::); }


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

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

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

LLVM IR (-O2):
define void @cpu_nop() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
size_t strspn(char *, char const *);
int btp_skip_char_span(char **input, const char *chars) {
  size_t count = strspn(*input, chars);
  if (0 == count)
    return count;
  *input += count;
  return count;
}


x86 assembly (clang, -O0):
<btp_skip_char_span>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strspn@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    114c <btp_skip_char_span+0x3c>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1161 <btp_skip_char_span+0x51>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btp_skip_char_span>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
call   1030 <strspn@plt>
test   %rax,%rax
je     112f <btp_skip_char_span+0x1f>
add    %rax,%rbx
mov    %rbx,(%r14)
jmp    1131 <btp_skip_char_span+0x21>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @btp_skip_char_span(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = tail call i64 @strspn(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 %4
store i8* %7, i8** %0
%8 = trunc i64 %4 to i32
br label %9
9: ; preds = %2, %6
%10 = phi i32 [ %8, %6 ], [ 0, %2 ]
ret i32 %10
}
_Bool is_unity_running() {
  if (strcmp(getenv("XDG_CURRENT_DESKTOP"), "Unity") == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_unity_running>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <getenv@plt>
movslq %eax,%rdi
lea    0xed4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1157 <is_unity_running+0x37>
movb   $0x1,-0x1(%rbp)
jmp    115b <is_unity_running+0x3b>
movb   $0x0,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unity_running>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <getenv@plt>
movslq %eax,%rdi
lea    0xedb(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"XDG_CURRENT_DESKTOP\00"
@.str.1 = [6 x i8] c"Unity\00"
define zeroext i1 @is_unity_running() {
%1 = alloca i1
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
%5 = call i32 @strcmp(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i1 true, i1* %1
br label %9
8: ; preds = %0
store i1 false, i1* %1
br label %9
9: ; preds = %8, %7
%10 = load i1, i1* %1
ret i1 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"XDG_CURRENT_DESKTOP\00"
@.str.1 = [6 x i8] c"Unity\00"
define zeroext i1 @is_unity_running() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @getenv to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
ret i1 %5
}
void gdk_x11_get_default_xdisplay() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_get_default_xdisplay() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void imprimir(char *s, int d) { printf("%s = %d\n", s, d); }


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

x86 assembly (clang, -O2):
<imprimir>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s = %d\0A\00"
define void @imprimir(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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s = %d\0A\00"
define void @imprimir(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ serial;
};
typedef TYPE_1__ XCirculateRequestEvent;

/* Variables and functions */
unsigned long get_XCirculateRequestEvent_serial(void *_p) {
  return (unsigned long)((XCirculateRequestEvent *)_p)->serial;
}


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

x86 assembly (clang, -O2):
<get_XCirculateRequestEvent_serial>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XCirculateRequestEvent_serial(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XCirculateRequestEvent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int ispGAL22LV10_diagnose(struct chip *chip) { return 0; }


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

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

LLVM IR (-O0):
%struct.chip = type opaque
define i32 @ispGAL22LV10_diagnose(%struct.chip* %0) {
%2 = alloca %struct.chip*
store %struct.chip* %0, %struct.chip** %2
ret i32 0
}

LLVM IR (-O2):
%struct.chip = type opaque
define i32 @ispGAL22LV10_diagnose(%struct.chip* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ config_timer32(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int /*<<< orphan*/, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
void operation_sleep_notimer(void) {
  set_wakeup_timer(0, 0, 0);
  config_timer32(0, 0, 0, 0);
  operation_sleep();
}


x86 assembly (clang, -O0):
<operation_sleep_notimer>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <set_wakeup_timer@plt>
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <config_timer32@plt>
mov    $0x0,%al
call   1040 <operation_sleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<operation_sleep_notimer>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <set_wakeup_timer@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <config_timer32@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <operation_sleep@plt>

LLVM IR (-O0):
define void @operation_sleep_notimer() {
%1 = call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = call i32 @config_timer32(i32 0, i32 0, i32 0, i32 0)
%3 = call i32 (...) @operation_sleep()
ret void
}

LLVM IR (-O2):
define void @operation_sleep_notimer() {
%1 = tail call i32 @set_wakeup_timer(i32 0, i32 0, i32 0)
%2 = tail call i32 @config_timer32(i32 0, i32 0, i32 0, i32 0)
%3 = tail call i32 (...) @operation_sleep()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _c_setbyte(int);
void PUSH_CS() {
  ;
  _c_setbyte(0x0e);
  ;
}


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

x86 assembly (clang, -O2):
<PUSH_CS>:
mov    $0xe,%edi
jmp    1030 <_c_setbyte@plt>

LLVM IR (-O0):
define void @PUSH_CS() {
%1 = call i32 @_c_setbyte(i32 14)
ret void
}

LLVM IR (-O2):
define void @PUSH_CS() {
%1 = tail call i32 @_c_setbyte(i32 14)
ret void
}