xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t number_of_data_bytes(uint8_t token) {
  switch (token & 0xf0) {
  case 0x80:
  case 0x90:
  case 0xa0:
  case 0xb0:
  case 0xe0:
    return 2;
  }
  return 1;
}


x86 assembly (clang, -O0):
<number_of_data_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf0,%eax
mov    %eax,-0xc(%rbp)
sub    $0x80,%eax
je     116e <number_of_data_bytes+0x6e>
jmp    1122 <number_of_data_bytes+0x22>
mov    -0xc(%rbp),%eax
sub    $0x90,%eax
je     116e <number_of_data_bytes+0x6e>
jmp    1135 <number_of_data_bytes+0x35>
mov    -0xc(%rbp),%eax
sub    $0xa0,%eax
je     116e <number_of_data_bytes+0x6e>
jmp    1148 <number_of_data_bytes+0x48>
mov    -0xc(%rbp),%eax
sub    $0xb0,%eax
je     116e <number_of_data_bytes+0x6e>
jmp    115b <number_of_data_bytes+0x5b>
mov    -0xc(%rbp),%eax
sub    $0xe0,%eax
jne    117a <number_of_data_bytes+0x7a>
jmp    116e <number_of_data_bytes+0x6e>
movl   $0x2,-0x4(%rbp)
jmp    1181 <number_of_data_bytes+0x81>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_of_data_bytes>:
and    $0xf0,%edi
add    $0xffffff80,%edi
mov    $0x1,%eax
cmp    $0x6f,%edi
ja     1120 <number_of_data_bytes+0x20>
shr    $0x4,%edi
lea    0xee3(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
define i32 @number_of_data_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, 240
switch i32 %5, label %7 [
i32 128, label %6
i32 144, label %6
i32 160, label %6
i32 176, label %6
i32 224, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 2, i32* %2
br label %8
7: ; preds = %1
store i32 1, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.number_of_data_bytes = [7 x i32] [i32 2, i32 2, i32 2, i32 2, i32 1, i32 1, i32 2]
define i32 @number_of_data_bytes(i32 %0) {
%2 = and i32 %0, 240
%3 = add nsw i32 %2, -128
%4 = icmp ult i32 %3, 112
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = lshr exact i32 %3, 4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.number_of_data_bytes, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *__strncpy_null(char *dest, const char *src, size_t n) {
  strncpy(dest, src, n);
  if (n > 0)
    dest[n - 1] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<__strncpy_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
cmpq   $0x0,-0x18(%rbp)
jbe    1150 <__strncpy_null+0x40>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strncpy_null>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strncpy@plt>
test   %r14,%r14
je     112a <__strncpy_null+0x1a>
movb   $0x0,-0x1(%r14,%rbx,1)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @__strncpy_null(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %2, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = add i64 %2, -1
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %9
9: ; preds = %6, %3
ret i8* %0
}
/* Variables and functions */
int get_int_from_srv();
int /*<<< orphan*/ wait_for_data();
int get_data_int() {
  wait_for_data();
  return get_int_from_srv();
}


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

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

LLVM IR (-O0):
define i32 @get_data_int() {
%1 = call i32 (...) @wait_for_data()
%2 = call i32 (...) @get_int_from_srv()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_data_int() {
%1 = tail call i32 (...) @wait_for_data()
%2 = tail call i32 (...) @get_int_from_srv()
ret i32 %2
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int result = factorial(3);
  printf("%d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1030 <factorial@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorial(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int kfs_bz_get_chunks_no(long long orig_file_size) {
  return (orig_file_size + ((1 << 24) - 1)) >> 24;
}


x86 assembly (clang, -O0):
<kfs_bz_get_chunks_no>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffff,%rax
sar    $0x18,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kfs_bz_get_chunks_no>:
lea    0xffffff(%rdi),%rax
shr    $0x18,%rax
ret

LLVM IR (-O0):
define i32 @kfs_bz_get_chunks_no(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 16777215
%5 = ashr i64 %4, 24
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @kfs_bz_get_chunks_no(i64 %0) {
%2 = add nsw i64 %0, 16777215
%3 = lshr i64 %2, 24
%4 = trunc i64 %3 to i32
ret i32 %4
}
void f0(char *a, char *b) { __clear_cache(a, b); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1130 <__clear_cache>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

x86 assembly (clang, -O2):
<f0>:
xor    %eax,%eax
jmp    1110 <__clear_cache>
nopw   0x0(%rax,%rax,1)

LLVM IR (-O0):
define void @f0(i8* %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 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
define void @f0(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @__clear_cache to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ beep();
int /*<<< orphan*/ bodymsg(char *);
void func2(void) {
  beep();
  bodymsg("Two beeps! ");
  beep();
}


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <beep@plt>
lea    0xece(%rip),%rdi
call   1030 <bodymsg@plt>
mov    $0x0,%al
call   1040 <beep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func2>:
push   %rax
xor    %eax,%eax
call   1040 <beep@plt>
lea    0xed1(%rip),%rdi
call   1030 <bodymsg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <beep@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Two beeps! \00"
define void @func2() {
%1 = call i32 (...) @beep()
%2 = call i32 @bodymsg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @beep()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Two beeps! \00"
define void @func2() {
%1 = tail call i32 (...) @beep()
%2 = tail call i32 @bodymsg(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @beep()
ret void
}
int execute_syslog() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_syslog() {
ret i32 0
}
/* Type definitions */
struct sysinfo {
  int freeram;
};
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ sysinfo(struct sysinfo *);
int64_t get_freemem(void) {
  struct sysinfo memInfo;
  sysinfo(&memInfo);
  int64_t freeVirtualMem = memInfo.freeram;
  freeVirtualMem = freeVirtualMem / 1024 / 1024;
  return freeVirtualMem;
}


x86 assembly (clang, -O0):
<get_freemem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <sysinfo@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_freemem>:
push   %rax
mov    %rsp,%rdi
call   1030 <sysinfo@plt>
mov    (%rsp),%ecx
lea    0xfffff(%rcx),%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x14,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sysinfo = type { i32 }
define i32 @get_freemem() {
%1 = alloca %struct.sysinfo
%2 = alloca i32
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i32 0, i32 0
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 1024
%8 = sdiv i32 %7, 1024
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
%struct.sysinfo = type { i32 }
define i32 @get_freemem() {
%1 = alloca %struct.sysinfo
%2 = bitcast %struct.sysinfo* %1 to i8*
%3 = call i32 @sysinfo(%struct.sysinfo* %1)
%4 = getelementptr inbounds %struct.sysinfo, %struct.sysinfo* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1048576
ret i32 %6
}
/* Variables and functions */
int WTERMSIG(int);
int goose_WTERMSIG(int status) { return WTERMSIG(status); }


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

x86 assembly (clang, -O2):
<goose_WTERMSIG>:
jmp    1030 <WTERMSIG@plt>

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

LLVM IR (-O2):
define i32 @goose_WTERMSIG(i32 %0) {
%2 = tail call i32 @WTERMSIG(i32 %0)
ret i32 %2
}
void av_stream_get_codec_timebase() {}


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

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

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

LLVM IR (-O2):
define void @av_stream_get_codec_timebase() {
ret void
}
/* Variables and functions */
int atoi(char *);
int integrity_match_bay(char *bay_name, int bay_num) {
  return !(atoi(bay_name) == bay_num);
}


x86 assembly (clang, -O0):
<integrity_match_bay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atoi@plt>
cmp    -0xc(%rbp),%eax
sete   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrity_match_bay>:
push   %rbx
mov    %esi,%ebx
call   1030 <atoi@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @integrity_match_bay(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @atoi(i8* %5)
%7 = load i32, i32* %4
%8 = icmp eq i32 %6, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @integrity_match_bay(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = icmp ne i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int read(int, void *, int);
int rd_read_file(int fd, void *ptr, int len) { return read(fd, ptr, len); }


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

x86 assembly (clang, -O2):
<rd_read_file>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @rd_read_file(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
void _native_LED_GREEN_TOGGLE(void) {}


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

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

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

LLVM IR (-O2):
define void @_native_LED_GREEN_TOGGLE() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ log_status(char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
int /*<<< orphan*/ wall_wizards(char *);
void wall_status(const char *s) {
  char buf[((2048) * 4)];
  log_status(s);
  snprintf(buf, sizeof(buf), "## %s", s);
  wall_wizards(buf);
}


x86 assembly (clang, -O0):
<wall_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2010,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <log_status@plt>
lea    -0x2010(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x2000,%esi
lea    0xea1(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x2010(%rbp),%rdi
call   1040 <wall_wizards@plt>
add    $0x2010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wall_status>:
push   %r14
push   %rbx
sub    $0x2008,%rsp
mov    %rdi,%rbx
call   1050 <log_status@plt>
lea    0xeb7(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x2000,%esi
mov    %rbx,%rcx
call   1030 <snprintf@plt>
mov    %r14,%rdi
call   1040 <wall_wizards@plt>
add    $0x2008,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"## %s\00"
define void @wall_status(i8* %0) {
%2 = alloca i8*
%3 = alloca [8192 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @log_status(i8* %4)
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%7 = load i8*, i8** %2
%8 = call i32 @snprintf(i8* %6, i32 8192, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%10 = call i32 @wall_wizards(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"## %s\00"
define void @wall_status(i8* %0) {
%2 = alloca [8192 x i8]
%3 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @log_status(i8* %0)
%5 = call i32 @snprintf(i8* %3, i32 8192, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = call i32 @wall_wizards(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GETVAL;
int /*<<< orphan*/ perror(char *);
int semctl(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int getPitValue(int semid, int pit) {
  int meat = -1;
  if ((meat = semctl(semid, 2 * pit + 1, GETVAL, 0)) == -1)
    perror("Semctl(GETVAL) : ");
  return meat;
}


x86 assembly (clang, -O0):
<getPitValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1040 <semctl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xffffffff,%eax
jne    1169 <getPitValue+0x49>
lea    0xe9c(%rip),%rdi
call   1030 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPitValue>:
push   %rbx
add    %esi,%esi
add    $0x1,%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
call   1040 <semctl@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1141 <getPitValue+0x21>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
call   1030 <perror@plt>
jmp    113d <getPitValue+0x1d>

LLVM IR (-O0):
@GETVAL = global i32 0
@.str = [18 x i8] c"Semctl(GETVAL) : \00"
define i32 @getPitValue(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -1, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 2, %7
%9 = add nsw i32 %8, 1
%10 = load i32, i32* @GETVAL
%11 = call i32 @semctl(i32 %6, i32 %9, i32 %10, i32 0)
store i32 %11, i32* %5
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
@GETVAL = global i32 0
@.str = [18 x i8] c"Semctl(GETVAL) : \00"
define i32 @getPitValue(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = or i32 %3, 1
%5 = load i32, i32* @GETVAL
%6 = tail call i32 @semctl(i32 %0, i32 %4, i32 %5, i32 0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 %6
}
int convert_dec_to_another_base(int number, int base) {
  if (number == 0 || base == 10)
    return number;
  return (number % base) +
         10 * convert_dec_to_another_base(number / base, base);
}


x86 assembly (clang, -O0):
<convert_dec_to_another_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1132 <convert_dec_to_another_base+0x22>
cmpl   $0xa,-0xc(%rbp)
jne    113d <convert_dec_to_another_base+0x2d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <convert_dec_to_another_base+0x53>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,%edi
mov    -0xc(%rbp),%esi
call   1030 <convert_dec_to_another_base@plt>
mov    -0x10(%rbp),%edx
imul   $0xa,%eax,%eax
add    %eax,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_dec_to_another_base>:
mov    %edi,%eax
test   %edi,%edi
je     112f <convert_dec_to_another_base+0x1f>
cmp    $0xa,%esi
je     112f <convert_dec_to_another_base+0x1f>
push   %rbx
cltd
idiv   %esi
mov    %edx,%ebx
mov    %eax,%edi
call   1030 <convert_dec_to_another_base@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @convert_dec_to_another_base(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 10
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2, %8
%7 = phi i32 [ %13, %8 ], [ %0, %2 ]
ret i32 %7
8: ; preds = %2
%9 = srem i32 %0, %1
%10 = sdiv i32 %0, %1
%11 = tail call i32 @convert_dec_to_another_base(i32 %10, i32 %1)
%12 = mul nsw i32 %11, 10
%13 = add nsw i32 %12, %9
br label %6
}
/* Variables and functions */
int /*<<< orphan*/
_test_consulta_debe_permitir_consultar_un_elemento_sin_sacarlo();
int /*<<< orphan*/
_test_pone_y_saca_deben_permitir_poner_y_sacar_elementos_de_la_pila();
int /*<<< orphan*/ _test_vacia_debe_indicar_si_la_pila_esta_vacia();
void pila_tests() {
  _test_vacia_debe_indicar_si_la_pila_esta_vacia();
  _test_pone_y_saca_deben_permitir_poner_y_sacar_elementos_de_la_pila();
  _test_consulta_debe_permitir_consultar_un_elemento_sin_sacarlo();
}


x86 assembly (clang, -O0):
<pila_tests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <_test_vacia_debe_indicar_si_la_pila_esta_vacia@plt>
mov    $0x0,%al
call   1040 <_test_pone_y_saca_deben_permitir_poner_y_sacar_elementos_de_la_pila@plt>
mov    $0x0,%al
call   1050 <_test_consulta_debe_permitir_consultar_un_elemento_sin_sacarlo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pila_tests>:
push   %rax
xor    %eax,%eax
call   1030 <_test_vacia_debe_indicar_si_la_pila_esta_vacia@plt>
xor    %eax,%eax
call   1040 <_test_pone_y_saca_deben_permitir_poner_y_sacar_elementos_de_la_pila@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <_test_consulta_debe_permitir_consultar_un_elemento_sin_sacarlo@plt>

LLVM IR (-O0):
define void @pila_tests() {
%1 = call i32 (...) @_test_vacia_debe_indicar_si_la_pila_esta_vacia()
%2 = call i32 (...) @_test_pone_y_saca_deben_permitir_poner_y_sacar_elementos_de_la_pila()
%3 = call i32 (...) @_test_consulta_debe_permitir_consultar_un_elemento_sin_sacarlo()
ret void
}

LLVM IR (-O2):
define void @pila_tests() {
%1 = tail call i32 (...) @_test_vacia_debe_indicar_si_la_pila_esta_vacia()
%2 = tail call i32 (...) @_test_pone_y_saca_deben_permitir_poner_y_sacar_elementos_de_la_pila()
%3 = tail call i32 (...) @_test_consulta_debe_permitir_consultar_un_elemento_sin_sacarlo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ metersToFeetAndInches(double, unsigned int *, double *);
int /*<<< orphan*/ printf(char *, double, unsigned int, double);
int main(int argc, const char *argv[]) {
  double meters = 3.0;
  unsigned int feet;
  double inches;
  metersToFeetAndInches(meters, &feet, &inches);
  printf("%.1f is equal to %d and %.1f inches\n", meters, feet, inches);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xec2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <metersToFeetAndInches@plt>
movsd  -0x18(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
movsd  -0x28(%rbp),%xmm1
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm0
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <metersToFeetAndInches@plt>
mov    0xc(%rsp),%esi
movsd  0x10(%rsp),%xmm1
lea    0xebc(%rip),%rdi
movsd  0xeac(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"%.1f is equal to %d and %.1f inches\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 3.000000e+00, double* %6
%9 = load double, double* %6
%10 = call i32 @metersToFeetAndInches(double %9, i32* %7, double* %8)
%11 = load double, double* %6
%12 = load i32, i32* %7
%13 = load double, double* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %11, i32 %12, double %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"%.1f is equal to %d and %.1f inches\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca double
%5 = bitcast i32* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @metersToFeetAndInches(double 3.000000e+00, i32* %3, double* %4)
%8 = load i32, i32* %3
%9 = load double, double* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double 3.000000e+00, i32 %8, double %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int read_bmp(const char *filename, int *width, int *height,
             unsigned char **rgb) {
  fprintf(stderr, "Sorry, reading of .bmp files isn't supported yet.\n");
  return (0);
}


x86 assembly (clang, -O0):
<read_bmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bmp>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Sorry, reading of .bmp files isn't supported yet.\0A\00"
define i32 @read_bmp(i8* %0, i32* %1, i32* %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i8**
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i8** %3, i8*** %8
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Sorry, reading of .bmp files isn't supported yet.\0A\00"
define i32 @read_bmp(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_version() { puts("xor-table, version 1.0"); }


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"xor-table, version 1.0\00"
define void @print_version() {
%1 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"xor-table, version 1.0\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
void GDFB(void) {}


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

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

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

LLVM IR (-O2):
define void @GDFB() {
ret void
}
int movswl_1(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movw $0x2222, %%ax\n\t"
                       "movswl %%ax,%%eax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movswl_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x2222,%ax
movswl %ax,%eax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movswl_1>:
mov    $0x12345678,%eax
mov    $0x2222,%ax
movswl %ax,%eax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movswl_1() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movw $$0x2222, %ax\0A\09movswl %ax,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movswl_1() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movw $$0x2222, %ax\0A\09movswl %ax,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_alternative_routes_init();
int /*<<< orphan*/ roadmap_start_realtime();
void roadmap_start_after_terms_of_use(void) {
  roadmap_start_realtime();
  roadmap_alternative_routes_init();
}


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

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

LLVM IR (-O0):
define void @roadmap_start_after_terms_of_use() {
%1 = call i32 (...) @roadmap_start_realtime()
%2 = call i32 (...) @roadmap_alternative_routes_init()
ret void
}

LLVM IR (-O2):
define void @roadmap_start_after_terms_of_use() {
%1 = tail call i32 (...) @roadmap_start_realtime()
%2 = tail call i32 (...) @roadmap_alternative_routes_init()
ret void
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tl880_calc_dpc_pll_const(unsigned long, unsigned char,
                                            unsigned char);
int /*<<< orphan*/ tl880_write_register(struct tl880_dev *, int,
                                        int /*<<< orphan*/);
void tl880_set_dpc_pll_const(struct tl880_dev *tl880dev, unsigned long a,
                             unsigned char b, unsigned char c) {
  tl880_write_register(tl880dev, 0x5800, tl880_calc_dpc_pll_const(a, b, c));
}


x86 assembly (clang, -O0):
<tl880_set_dpc_pll_const>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x11(%rbp),%al
movzbl %al,%esi
movzbl -0x12(%rbp),%edx
call   1040 <tl880_calc_dpc_pll_const@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%edx
mov    $0x5800,%esi
call   1030 <tl880_write_register@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_set_dpc_pll_const>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <tl880_calc_dpc_pll_const@plt>
mov    %rbx,%rdi
mov    $0x5800,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <tl880_write_register@plt>

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define void @tl880_set_dpc_pll_const(%struct.tl880_dev* %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca %struct.tl880_dev*
%6 = alloca i64
%7 = alloca i8
%8 = alloca i8
store %struct.tl880_dev* %0, %struct.tl880_dev** %5
store i64 %1, i64* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load %struct.tl880_dev*, %struct.tl880_dev** %5
%10 = load i64, i64* %6
%11 = load i8, i8* %7
%12 = load i8, i8* %8
%13 = call i32 @tl880_calc_dpc_pll_const(i64 %10, i8 zeroext %11, i8 zeroext %12)
%14 = call i32 @tl880_write_register(%struct.tl880_dev* %9, i32 22528, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define void @tl880_set_dpc_pll_const(%struct.tl880_dev* %0, i64 %1, i8 zeroext %2, i8 zeroext %3) {
%5 = tail call i32 @tl880_calc_dpc_pll_const(i64 %1, i8 zeroext %2, i8 zeroext %3)
%6 = tail call i32 @tl880_write_register(%struct.tl880_dev* %0, i32 22528, i32 %5)
ret void
}
/* Variables and functions */
int setenv(char const *, char *, int);
int unsetenv(const char *name) { return setenv(name, "", 1); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @unsetenv(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @setenv(i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @unsetenv(i8* %0) {
%2 = tail call i32 @setenv(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __assert_fail(char *, char *, unsigned int, char *);
int /*<<< orphan*/ check_global();
void main(void) {
  int x;
  {
    x = 3;
    if (x == 3) {
    } else {
      { __assert_fail("x == 3", "shadowing_BUG.c", 12U, "main"); }
    }
    { check_global(); }
    return;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x3,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    113e <main+0x1e>
jmp    115d <main+0x3d>
lea    0xebb(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    $0xc,%edx
lea    0xebf(%rip),%rcx
call   1030 <__assert_fail@plt>
mov    $0x0,%al
call   1040 <check_global@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @check_global()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ audio_stop();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ paddle_close();
void quit() {
  audio_stop();
  paddle_close();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <audio_stop@plt>
mov    $0x0,%al
call   1040 <paddle_close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1030 <audio_stop@plt>
xor    %eax,%eax
call   1040 <paddle_close@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @quit() {
%1 = call i32 (...) @audio_stop()
%2 = call i32 (...) @paddle_close()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 (...) @audio_stop()
%2 = tail call i32 (...) @paddle_close()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EX_SOFTWARE;
int /*<<< orphan*/ pfpanic(char *, unsigned short, unsigned short, char const *,
                           char const *, int, int, int /*<<< orphan*/);
void __pfpanic_zmq_context_create(unsigned short _syslog,
                                  unsigned short _verbose,
                                  const char *_function_name,
                                  const char *_file_name, int _line_number,
                                  int _errno) {
  pfpanic("Unable to create ZeroMQ context", _syslog, _verbose, _function_name,
          _file_name, _line_number, _errno, EX_SOFTWARE);
}


x86 assembly (clang, -O0):
<__pfpanic_zmq_context_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x2(%rbp),%si
mov    -0x4(%rbp),%dx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%r10d
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
lea    0xea2(%rip),%rdi
movzwl %si,%esi
movzwl %dx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <pfpanic@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pfpanic_zmq_context_create>:
push   %rax
mov    %r9d,%r10d
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
mov    %edi,%esi
mov    0x2eb8(%rip),%rdi
mov    (%rdi),%eax
lea    0xecf(%rip),%rdi
push   %rax
push   %r10
call   1030 <pfpanic@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Unable to create ZeroMQ context\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zmq_context_create(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i16
%8 = alloca i16
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i16 %0, i16* %7
store i16 %1, i16* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i16, i16* %7
%14 = load i16, i16* %8
%15 = load i8*, i8** %9
%16 = load i8*, i8** %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = load i32, i32* @EX_SOFTWARE
%20 = call i32 @pfpanic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i8* %15, i8* %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Unable to create ZeroMQ context\00"
@EX_SOFTWARE = global i32 0
define void @__pfpanic_zmq_context_create(i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = load i32, i32* @EX_SOFTWARE
%8 = tail call i32 @pfpanic(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i16 zeroext %0, i16 zeroext %1, i8* %2, i8* %3, i32 %4, i32 %5, i32 %7)
ret void
}
void mul2(void *i) { *(int *)i *= 2; }


x86 assembly (clang, -O0):
<mul2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul2>:
shll   (%rdi)
ret

LLVM IR (-O0):
define void @mul2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 2
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mul2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
void *memmove(void *, void const *, size_t);
void *memcpy(void *a, const void *b, size_t c) { return memmove(a, b, c); }


x86 assembly (clang, -O0):
<memcpy>:
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    %rdi,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memmove@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <memmove@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* returned writeonly %0, i8* nocapture %1, i64 %2) {
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 %2, i1 false)
ret i8* %0
}
/* Variables and functions */
unsigned long long XXH64(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ memset(unsigned long long *, int /*<<< orphan*/, int);
void xxhash_checksum_block(char *buf, int len, unsigned char *digest) {
  unsigned long long *hash = (unsigned long long *)digest;
  memset(&hash[1], 0, 32 - sizeof(*hash));
  *hash = XXH64(buf, len, 0);
}


x86 assembly (clang, -O0):
<xxhash_checksum_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <XXH64@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxhash_checksum_block>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
lea    0x8(%rdx),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1030 <memset@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %edx,%edx
call   1040 <XXH64@plt>
mov    %rax,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @xxhash_checksum_block(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i64*
store i64* %9, i64** %7
%10 = load i64*, i64** %7
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = call i32 @memset(i64* %11, i32 0, i32 24)
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i64 @XXH64(i8* %13, i32 %14, i32 0)
%16 = load i64*, i64** %7
store i64 %15, i64* %16
ret void
}

LLVM IR (-O2):
define void @xxhash_checksum_block(i8* %0, i32 %1, i8* %2) {
%4 = bitcast i8* %2 to i64*
%5 = getelementptr inbounds i8, i8* %2, i64 8
%6 = bitcast i8* %5 to i64*
%7 = tail call i32 @memset(i64* %6, i32 0, i32 24)
%8 = tail call i64 @XXH64(i8* %0, i32 %1, i32 0)
store i64 %8, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rwhocli_pingalive();
void Act_RwhoDeclareAlive(void) { rwhocli_pingalive(); }


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

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

LLVM IR (-O0):
define void @Act_RwhoDeclareAlive() {
%1 = call i32 (...) @rwhocli_pingalive()
ret void
}

LLVM IR (-O2):
define void @Act_RwhoDeclareAlive() {
%1 = tail call i32 (...) @rwhocli_pingalive()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf("\tfsec-optimize file - optimize seccomp filter\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [47 x i8] c"\09fsec-optimize file - optimize seccomp filter\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [46 x i8] c"\09fsec-optimize file - optimize seccomp filter\00"
define void @usage() {
%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 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.2, i64 0, i64 0))
ret void
}
int thermal_notify_tz_trip_add(int tz_id, int id, int type, int temp,
                               int hyst) {
  return 0;
}


x86 assembly (clang, -O0):
<thermal_notify_tz_trip_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @thermal_notify_tz_trip_add(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @thermal_notify_tz_trip_add(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
void gtk_container_set_reallocate_redraws() {}


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

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

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

LLVM IR (-O2):
define void @gtk_container_set_reallocate_redraws() {
ret void
}
int hash_node(char *key) {
  int sum = 0;
  char *str = key;
  while (*str) {
    sum += *str++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<hash_node>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash_node+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hash_node+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_node>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <hash_node+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_node+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_node(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i32
%10 = add nsw i32 %7, %9
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
double sqrt(double x) {
  double res;
  asm volatile("sqrtsd %[x], %[res]" : [res] "=x"(res) : [x] "xm"(x) :);
  return res;
}


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
sqrtsd -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movsd  %xmm0,-0x8(%rsp)
sqrtsd -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @sqrt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double asm sideeffect "sqrtsd $1, $0", "=x,xm,~{dirflag},~{fpsr},~{flags}"(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @sqrt(double %0) {
%2 = tail call double asm sideeffect "sqrtsd $1, $0", "=x,xm,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}