xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int link(char *old, char *new) {
  printf("link() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<link>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"link() not implemented\0A\00"
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"link() not implemented\00"
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
}
int autoscan_notify_scan(struct wpa_supplicant *wpa_s,
                         struct wpa_scan_results *scan_res) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpa_scan_results = type opaque
define i32 @autoscan_notify_scan(%struct.wpa_supplicant* %0, %struct.wpa_scan_results* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wpa_scan_results*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wpa_scan_results* %1, %struct.wpa_scan_results** %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_scan_results = type opaque
define i32 @autoscan_notify_scan(%struct.wpa_supplicant* nocapture readnone %0, %struct.wpa_scan_results* nocapture readnone %1) {
ret i32 0
}
void ffi_closure_alloc(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int main() {
  FILE *fp;
  printf("This text is redirected to stdout\n");
  fp = freopen("file.txt", "w+", stdout);
  printf("This text is redirected to file.txt\n");
  fclose(fp);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <freopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edx
lea    0xef3(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <freopen@plt>
mov    %rax,%rbx
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"This text is redirected to stdout\0A\00"
@.str.1 = [9 x i8] c"file.txt\00"
@.str.2 = [3 x i8] c"w+\00"
@stdout = global i32 0
@.str.3 = [37 x i8] c"This text is redirected to file.txt\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32* @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %4)
store i32* %5, i32** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.3, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @fclose(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"file.txt\00"
@.str.2 = [3 x i8] c"w+\00"
@stdout = global i32 0
@str = [34 x i8] c"This text is redirected to stdout\00"
@str.4 = [36 x i8] c"This text is redirected to file.txt\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32* @freopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @fclose(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void print_version() {
  printf("lantronix-telnet-pw v%s\n", "0.1");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"lantronix-telnet-pw v%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@EXIT_SUCCESS = global i32 0
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"lantronix-telnet-pw v%s\0A\00"
@.str.1 = [4 x i8] c"0.1\00"
@EXIT_SUCCESS = global i32 0
define void @print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ MS_BIND;
int xmount(char const *, char const *, int /*<<< orphan*/ *, int /*<<< orphan*/,
           int /*<<< orphan*/ *);
int bind_mount(const char *from, const char *to) {
  int ret = xmount(from, to, NULL, MS_BIND, NULL);
  ;
  return ret;
}


x86 assembly (clang, -O0):
<bind_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb9(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
call   1030 <xmount@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bind_mount>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
xor    %r8d,%r8d
jmp    1030 <xmount@plt>

LLVM IR (-O0):
@MS_BIND = global i32 0
define i32 @bind_mount(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = load i32, i32* @MS_BIND
%9 = call i32 @xmount(i8* %6, i8* %7, i32* null, i32 %8, i32* null)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
@MS_BIND = global i32 0
define i32 @bind_mount(i8* %0, i8* %1) {
%3 = load i32, i32* @MS_BIND
%4 = tail call i32 @xmount(i8* %0, i8* %1, i32* null, i32 %3, i32* null)
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int file_path_is_directory(const char *path) {
  struct stat stat_buffer;
  return ((stat(path, &stat_buffer) == 0) && S_ISDIR(stat_buffer.st_mode));
}


x86 assembly (clang, -O0):
<file_path_is_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <file_path_is_directory+0x3d>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_path_is_directory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <file_path_is_directory+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_path_is_directory(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_path_is_directory(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISDIR(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
double sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vard(double const *, unsigned int);
double stdd(const double *x, unsigned n) { return sqrt(vard(x, n)); }


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

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

LLVM IR (-O0):
define double @stdd(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call i32 @vard(double* %5, i32 %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @stdd(double* %0, i32 %1) {
%3 = tail call i32 @vard(double* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
const char *getSpec(void) { return "typ_spec { name=typ_MidiType; }"; }


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"typ_spec { name=typ_MidiType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [32 x i8] c"typ_spec { name=typ_MidiType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0)
}
void elv_unregister_queue(struct request_queue *q) { return; }


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

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

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

LLVM IR (-O2):
%struct.request_queue = type opaque
define void @elv_unregister_queue(%struct.request_queue* nocapture %0) {
ret void
}
unsigned char apollo_get_temperature(void) { return (0); }


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

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

LLVM IR (-O0):
define zeroext i8 @apollo_get_temperature() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @apollo_get_temperature() {
ret i8 0
}
int string_hash(const char *str) {
  int h = 0;
  int p = 0;
  char c = 0;
  while ((c = str[p])) {
    h = 13 * h + (c & 0x7f);
    p++;
  }
  return h;
}


x86 assembly (clang, -O0):
<string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
je     114e <string_hash+0x4e>
imul   $0xd,-0xc(%rbp),%eax
movsbl -0x11(%rbp),%ecx
and    $0x7f,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <string_hash+0x1a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <string_hash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,2),%edx
lea    (%rax,%rdx,4),%edx
and    $0x7f,%cl
movzbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <string_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = mul nsw i32 %7, 13
%9 = and i8 %6, 127
%10 = zext i8 %9 to i32
%11 = add nsw i32 %8, %10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
/* Variables and functions */
long _InterlockedIncrement(long *);
long test1(long *p) { return _InterlockedIncrement(p); }


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

x86 assembly (clang, -O2):
<test1>:
jmp    1030 <_InterlockedIncrement@plt>

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

LLVM IR (-O2):
define i64 @test1(i64* %0) {
%2 = tail call i64 @_InterlockedIncrement(i64* %0)
ret i64 %2
}
/* Variables and functions */
int chsolve_worksz(const int *_pivot, int _n) {
  return _pivot != NULL ? _n : 0;
}


x86 assembly (clang, -O0):
<chsolve_worksz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1121 <chsolve_worksz+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112b <chsolve_worksz+0x2b>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <chsolve_worksz+0x2b>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chsolve_worksz>:
xor    %eax,%eax
test   %rdi,%rdi
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @chsolve_worksz(i32* readnone %0, i32 %1) {
%3 = icmp eq i32* %0, null
%4 = select i1 %3, i32 0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DeleteJaggedData(void *jaggedattr) { free(jaggedattr); }


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

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

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

LLVM IR (-O2):
define void @DeleteJaggedData(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void broker_program_state(int type, int flags, int attr,
                          struct timeval *timestamp) {}


x86 assembly (clang, -O0):
<broker_program_state>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timeval = type opaque
define void @broker_program_state(i32 %0, i32 %1, i32 %2, %struct.timeval* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.timeval*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.timeval* %3, %struct.timeval** %8
ret void
}

LLVM IR (-O2):
%struct.timeval = type opaque
define void @broker_program_state(i32 %0, i32 %1, i32 %2, %struct.timeval* nocapture %3) {
ret void
}
unsigned long bswap_32(unsigned long x) {
  return ((x & 0xff000000) >> 24) | ((x & 0x00ff0000) >> 8) |
         ((x & 0x0000ff00) << 8) | ((x & 0x000000ff) << 24);
}


x86 assembly (clang, -O0):
<bswap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xff000000,%rax
and    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    -0x8(%rbp),%rcx
and    $0xff0000,%rcx
shr    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff00,%rcx
shl    $0x8,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rcx
and    $0xff,%rcx
shl    $0x18,%rcx
or     %rcx,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @bswap_32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4278190080
%5 = lshr i64 %4, 24
%6 = load i64, i64* %2
%7 = and i64 %6, 16711680
%8 = lshr i64 %7, 8
%9 = or i64 %5, %8
%10 = load i64, i64* %2
%11 = and i64 %10, 65280
%12 = shl i64 %11, 8
%13 = or i64 %9, %12
%14 = load i64, i64* %2
%15 = and i64 %14, 255
%16 = shl i64 %15, 24
%17 = or i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @bswap_32(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = zext i32 %3 to i64
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int, int);
void set_port_direction(uint8_t address, uint8_t port, uint8_t direction) {
  set_port(address, port, direction, 0x00, 0x01);
}


x86 assembly (clang, -O0):
<set_port_direction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_port_direction>:
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <set_port@plt>

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

LLVM IR (-O2):
define void @set_port_direction(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @set_port(i32 %0, i32 %1, i32 %2, i32 0, i32 1)
ret void
}
char *plugin_info(void) { return "Icom R10 Receiver V1.1"; }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Icom R10 Receiver V1.1\00"
define i8* @plugin_info() {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [23 x i8] c"Icom R10 Receiver V1.1\00"
define i8* @plugin_info() {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}
int Bematech_FI_ReducaoZ(Retorno)
int Retorno[3];
{
  char Var;
  return Formata("\x1b|05|\x1b", Var, Retorno);
}


x86 assembly (clang, -O0):
<Bematech_FI_ReducaoZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%rdx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <Formata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bematech_FI_ReducaoZ>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <Formata@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B|05|\1B\00"
define i32 @Bematech_FI_ReducaoZ(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = load i32*, i32** %2
%7 = call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B|05|\1B\00"
define i32 @Bematech_FI_ReducaoZ(i32* %0) {
%2 = tail call i32 (i8*, i32, i32*, ...) bitcast (i32 (...)* @Formata to i32 (i8*, i32, i32*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0, i32* %0)
ret i32 %2
}
void databaseAccess() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
void _d_gnu_fd_zero(fd_set *p) { FD_ZERO(p); }


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

x86 assembly (clang, -O2):
<_d_gnu_fd_zero>:
jmp    1030 <FD_ZERO@plt>

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

LLVM IR (-O2):
define void @_d_gnu_fd_zero(i32* %0) {
%2 = tail call i32 @FD_ZERO(i32* %0)
ret void
}
OP(dd, d2) { op_d2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d2()
ret i32 undef
}
void adjustHorizontalCoordinate(int *y, int *x, int amount) { *x += amount; }


x86 assembly (clang, -O0):
<adjustHorizontalCoordinate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustHorizontalCoordinate>:
add    %edx,(%rsi)
ret

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

LLVM IR (-O2):
define void @adjustHorizontalCoordinate(i32* nocapture readnone %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %2
store i32 %5, i32* %1
ret void
}
void X509V3_EXT_add_nconf_sk(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_add_nconf_sk() {
ret void
}
/* Variables and functions */
double normalize_angle(double);
double angle_between(double from, double to) {
  return normalize_angle(normalize_angle(to) - normalize_angle(from));
}


x86 assembly (clang, -O0):
<angle_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <normalize_angle@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <normalize_angle@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
subsd  %xmm1,%xmm0
call   1030 <normalize_angle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<angle_between>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movaps %xmm1,%xmm0
call   1030 <normalize_angle@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <normalize_angle@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
jmp    1030 <normalize_angle@plt>

LLVM IR (-O0):
define double @angle_between(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = call double @normalize_angle(double %5)
%7 = load double, double* %3
%8 = call double @normalize_angle(double %7)
%9 = fsub double %6, %8
%10 = call double @normalize_angle(double %9)
ret double %10
}

LLVM IR (-O2):
define double @angle_between(double %0, double %1) {
%3 = tail call double @normalize_angle(double %1)
%4 = tail call double @normalize_angle(double %0)
%5 = fsub double %3, %4
%6 = tail call double @normalize_angle(double %5)
ret double %6
}
unsigned int hash_function(const char *str, unsigned htable_size) {
  unsigned int h = 0;
  unsigned char *p;
  for (p = (unsigned char *)str; *p != '\0'; p++)
    h = 31 * h + *p;
  return h % htable_size;
}


x86 assembly (clang, -O0):
<hash_function>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     114b <hash_function+0x4b>
imul   $0x1f,-0x10(%rbp),%eax
mov    -0x18(%rbp),%rcx
movzbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <hash_function+0x1a>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_function>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <hash_function+0x29>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
movzbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash_function+0x10>
jmp    112b <hash_function+0x2b>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_function(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = zext i8 %6 to i32
%10 = mul i32 %8, 31
%11 = add i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
/* Variables and functions */
bool alphabetic(const char c) {
  if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
    return true;
  else
    return false;
}


x86 assembly (clang, -O0):
<alphabetic>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <alphabetic+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    113e <alphabetic+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     114a <alphabetic+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     114a <alphabetic+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <alphabetic+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alphabetic>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @alphabetic(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @alphabetic(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
void rc6_advance_space(unsigned *buf, unsigned *n, unsigned length) {
  if (*n % 2)
    buf[*n] += length;
  else
    buf[++(*n)] = length;
}


x86 assembly (clang, -O0):
<rc6_advance_space>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1139 <rc6_advance_space+0x39>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
add    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
jmp    1150 <rc6_advance_space+0x50>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rsi
mov    (%rsi),%ecx
add    $0x1,%ecx
mov    %ecx,(%rsi)
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc6_advance_space>:
mov    (%rsi),%eax
test   $0x1,%al
jne    1110 <rc6_advance_space+0x10>
lea    0x1(%rax),%ecx
mov    %ecx,(%rsi)
mov    %edx,0x4(%rdi,%rax,4)
ret
add    %edx,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @rc6_advance_space(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = zext i32 %4 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = add i32 %10, %2
store i32 %11, i32* %9
br label %16
12: ; preds = %3
%13 = add nuw i32 %4, 1
store i32 %13, i32* %1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
store i32 %2, i32* %15
br label %16
16: ; preds = %12, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bob(int, double, char);
int /*<<< orphan*/ printf(char *);
int hello() {
  printf("Hello World!\n");
  bob(42, 3.14159, 'a');
  return 5;
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%edi
movsd  0xec3(%rip),%xmm0
mov    $0x61,%esi
call   1040 <bob@plt>
mov    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
movsd  0xecb(%rip),%xmm0
mov    $0x2a,%edi
mov    $0x61,%esi
call   1040 <bob@plt>
mov    $0x5,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define i32 @hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @bob(i32 42, double 3.141590e+00, i8 signext 97)
ret i32 5
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define i32 @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @bob(i32 42, double 3.141590e+00, i8 signext 97)
ret i32 5
}
/* Type definitions */
typedef int /*<<< orphan*/ id_t;

/* Variables and functions */
id_t next_id() {
  static id_t id;
  return id++;
}


x86 assembly (clang, -O0):
<next_id>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2f0f(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_id>:
mov    0x2f1e(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f15(%rip)
ret

LLVM IR (-O0):
@next_id.id = internal global i32 0
define i32 @next_id() {
%1 = load i32, i32* @next_id.id
%2 = add nsw i32 %1, 1
store i32 %2, i32* @next_id.id
ret i32 %1
}

LLVM IR (-O2):
@next_id.id = internal unnamed_addr global i32 0
define i32 @next_id() {
%1 = load i32, i32* @next_id.id
%2 = add nsw i32 %1, 1
store i32 %2, i32* @next_id.id
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
long db_retrieval(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ free(char *);
char *sql_generate(char const *, char const *, long const);
int db_archive_status(sqlite3 *db, const char *board_id, const long id) {
  static const char *sql = "SELECT COUNT(*) FROM archived_threads "
                           "WHERE board_id = \"%s\" AND post_id = %ld;";
  char *cmd = sql_generate(sql, board_id, id);
  long status = db_retrieval(db, cmd);
  free(cmd);
  return status;
}


x86 assembly (clang, -O0):
<db_archive_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eed(%rip),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <sql_generate@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <db_retrieval@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_archive_status>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
call   1040 <sql_generate@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1050 <db_retrieval@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@db_archive_status.sql = internal global i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i32 0, i32 0)
@.str = [79 x i8] c"SELECT COUNT(*) FROM archived_threads WHERE board_id = \22%s\22 AND post_id = %ld;\00"
define i32 @db_archive_status(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** @db_archive_status.sql
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i8* @sql_generate(i8* %9, i8* %10, i64 %11)
store i8* %12, i8** %7
%13 = load i32*, i32** %4
%14 = load i8*, i8** %7
%15 = call i64 @db_retrieval(i32* %13, i8* %14)
store i64 %15, i64* %8
%16 = load i8*, i8** %7
%17 = call i32 @free(i8* %16)
%18 = load i64, i64* %8
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
@.str = [79 x i8] c"SELECT COUNT(*) FROM archived_threads WHERE board_id = \22%s\22 AND post_id = %ld;\00"
define i32 @db_archive_status(i32* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sql_generate(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0), i8* %1, i64 %2)
%5 = tail call i64 @db_retrieval(i32* %0, i8* %4)
%6 = tail call i32 @free(i8* %4)
%7 = trunc i64 %5 to i32
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
void DumpBlock(char *b, int size, FILE *D) { fwrite(b, size, 1, D); }


x86 assembly (clang, -O0):
<DumpBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DumpBlock>:
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
define void @DumpBlock(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %0, i32 %1, i32 1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Help() {
  fprintf(stderr, "\nftnuseradd commandline:\n\n");
  fprintf(stderr, "ftnuseradd [gid] [name] [comment] [usersdir]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<Help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"\0Aftnuseradd commandline:\0A\0A\00"
@.str.1 = [46 x i8] c"ftnuseradd [gid] [name] [comment] [usersdir]\0A\00"
define void @Help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"\0Aftnuseradd commandline:\0A\0A\00"
@.str.1 = [46 x i8] c"ftnuseradd [gid] [name] [comment] [usersdir]\0A\00"
define void @Help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int _imax(const int i1, const int i2) { return i1 > i2 ? i1 : i2; }


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

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

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

LLVM IR (-O2):
define i32 @_imax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void addOneBit(int *binrep, int limit) {
  int i;
  limit += 1;
  for (i = 0; i < limit; i++) {
    if (*(binrep + sizeof(int) * i) == 1) {
      *(binrep + sizeof(int) * i) = 0;
    } else {
      *(binrep + sizeof(int) * i) = 1;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<addOneBit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1180 <addOneBit+0x80>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x2,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1155 <addOneBit+0x55>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x2,%rcx
movl   $0x0,(%rax,%rcx,4)
jmp    116d <addOneBit+0x6d>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x2,%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    1180 <addOneBit+0x80>
jmp    1172 <addOneBit+0x72>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111b <addOneBit+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOneBit>:
test   %esi,%esi
js     1126 <addOneBit+0x26>
mov    %esi,%eax
shl    $0x4,%rax
add    $0x10,%rax
xor    %ecx,%ecx
cmpl   $0x1,(%rdi,%rcx,1)
jne    1127 <addOneBit+0x27>
movl   $0x0,(%rdi,%rcx,1)
add    $0x10,%rcx
cmp    %rcx,%rax
jne    1110 <addOneBit+0x10>
ret
movl   $0x1,(%rdi,%rcx,1)
ret

LLVM IR (-O0):
define void @addOneBit(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
store i32 %7, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %33, %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %36
12: ; preds = %8
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = mul i64 4, %15
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %26
20: ; preds = %12
%21 = load i32*, i32** %3
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = mul i64 4, %23
%25 = getelementptr inbounds i32, i32* %21, i64 %24
store i32 0, i32* %25
br label %32
26: ; preds = %12
%27 = load i32*, i32** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = mul i64 4, %29
%31 = getelementptr inbounds i32, i32* %27, i64 %30
store i32 1, i32* %31
br label %36
32: ; preds = %20
br label %33
33: ; preds = %32
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
br label %8
36: ; preds = %26, %8
ret void
}

LLVM IR (-O2):
define void @addOneBit(i32* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = add nuw i32 %1, 1
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %4, %13
%8 = phi i64 [ 0, %4 ], [ %14, %13 ]
%9 = shl nuw nsw i64 %8, 2
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %7
store i32 0, i32* %10
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, %6
br i1 %15, label %17, label %7
16: ; preds = %7
store i32 1, i32* %10
br label %17
17: ; preds = %13, %2, %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("usage: asciisfx [--output filename.wav] command\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"usage: asciisfx [--output filename.wav] command\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [48 x i8] c"usage: asciisfx [--output filename.wav] command\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}